Bug 900 - Segfault on restoring settings when a decoder does not load
Summary: Segfault on restoring settings when a decoder does not load
Status: RESOLVED FIXED
Alias: None
Product: PulseView
Classification: Unclassified
Component: Protocol decoding (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-26 11:57 CET by Marcus Comstedt
Modified: 2017-05-07 07:54 CEST (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Comstedt 2017-02-26 11:57:16 CET
If ~/.config/sigrok/PulseView.conf mentions a decoder which can not be loaded,
then PV dereferences a NULL pointer.  This backtrace should tell everything:

Thread 1 "pulseview" received signal SIGSEGV, Segmentation fault.
pv::Session::add_decoder (this=this@entry=0x1032b260, dec=0x0)
    at /home/marcus/hack/pulseview/pv/session.cpp:624
624                     for (const GSList *i = dec->channels; i; i = i->next)
(gdb) bt
#0  pv::Session::add_decoder (this=this@entry=0x1032b260, dec=0x0)
    at /home/marcus/hack/pulseview/pv/session.cpp:624
#1  0x1003a520 in pv::Session::restore_settings (this=0x1032b260, settings=...)
    at /home/marcus/hack/pulseview/pv/session.cpp:337
#2  0x10028268 in pv::MainWindow::restore_ui_settings (this=this@entry=
    0xffffd1e0) at /home/marcus/hack/pulseview/pv/mainwindow.cpp:470
#3  0x10028650 in pv::MainWindow::MainWindow (this=0xffffd1e0, 
    device_manager=..., open_file_name=..., open_file_format=..., 
    parent=<optimized out>) at /home/marcus/hack/pulseview/pv/mainwindow.cpp:87
#4  0x10018020 in main (argc=1, argv=0xffffd504)
    at /home/marcus/hack/pulseview/main.cpp:163
(gdb) 

(Note parameter dec=0x0 to add_decoder)
Comment 1 Soeren Apel 2017-05-07 07:54:33 CEST
Fixed in a7336fb2d5df57b2ac28db6a2e38c337463fcdce