octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible bug in documentation.cc (de-referencing nullpointer)


From: Torsten
Subject: Re: Possible bug in documentation.cc (de-referencing nullpointer)
Date: Thu, 3 Jan 2019 21:17:55 +0100

On 03.01.19 08:53, Andreas Weber wrote:
> Am 02.01.19 um 23:02 schrieb Andreas Weber:
>> I've just changed line 102 to
>> if (! m_help_engine->setupData() || 1)
>> then rebuilt, executed and got the expected segfault (which obviously
>> is at another place)
> 
> Here a backtrace after modifying line 102 (simulating that
> m_help_engine->setupData() fails):
> 
> Thread 1 "octave-gui" received signal SIGSEGV, Segmentation fault.
> 0x00007f92868b4f70 in QKeySequence::operator==(QKeySequence const&)
> const () from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
> (gdb) bt
> #0  0x00007f92868b4f70 in QKeySequence::operator==(QKeySequence const&)
> const () from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
> #1  0x00007f9286e2b04e in QAction::setShortcut(QKeySequence const&) ()
> from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
> #2  0x00007f928b095218 in octave::shortcut_manager::do_set_shortcut
> (this=0x55c8433c26f0, action=0x55c8437151a0, key=...) at
> ../octave-src/libgui/src/shortcut-manager.cc:515
> #3  0x00007f928afdb9a7 in octave::shortcut_manager::set_shortcut
> (action=0x55c8437151a0, key=...) at
> ../octave-src/libgui/src/shortcut-manager.h:96
> #4  0x00007f928afd77d5 in octave::documentation::notice_settings
> (this=0x55c84373e230, settings=0x55c8433ca940) at
> ../octave-src/libgui/src/documentation.cc:551
> #5  0x00007f928afd363c in
> octave::documentation_dock_widget::notice_settings (this=0x55c84367bc80,
> settings=0x55c8433ca940)
>     at ../octave-src/libgui/src/documentation-dock-widget.cc:62
> #6  0x00007f928b048216 in octave::octave_dock_widget::handle_settings
> (this=0x55c84367bc80, settings=0x55c8433ca940) at
> ../octave-src/libgui/src/octave-dock-widget.cc:461
> #7  0x00007f928b0e127b in octave::octave_dock_widget::qt_static_metacall
> (_o=0x55c84367bc80, _c=QMetaObject::InvokeMetaMethod, _id=7,
> _a=0x7ffe2e875280)
>     at libgui/src/moc-octave-dock-widget.cc:274
> #8  0x00007f92865785e9 in QMetaObject::activate(QObject*, int, int,
> void**) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
> #9  0x00007f928b0d7223 in octave::main_window::settings_changed
> (this=0x55c843340800, _t1=0x55c8433ca940) at
> libgui/src/moc-main-window.cc:948
> #10 0x00007f928b02bb88 in octave::main_window::read_settings
> (this=0x55c843340800) at ../octave-src/libgui/src/main-window.cc:1274
> #11 0x00007f928b02570a in octave::main_window::main_window
> (this=0x55c843340800, oct_qt_app=..., oct_qt_lnk=0x55c8431a7ce0) at
> ../octave-src/libgui/src/main-window.cc:268
> #12 0x00007f928b035bcb in octave::octave_qt_app::create_main_window
> (this=0x7ffe2e875620) at ../octave-src/libgui/src/main-window.cc:2911
> #13 0x00007f928b03587b in octave::octave_qt_app::octave_qt_app
> (this=0x7ffe2e875620, app_context=...) at
> ../octave-src/libgui/src/main-window.cc:2865
> #14 0x00007f928b049dab in octave::gui_application::execute
> (this=0x7ffe2e8756c0) at ../octave-src/libgui/src/octave-gui.cc:62
> #15 0x000055c842455877 in main (argc=9, argv=0x7ffe2e8759f8) at
> ../octave-src/src/main-gui.cc:103

Thanks for the backtrace. In documentation::notice_settings, the actions
are used although they were never initialized when m_help_engine is 0.
Adding a

if (! m_help_engine)
  return;

at the beginning of notice_settings should fix the segfault. I am going
to test this as soon as the current build process on my computer is
finally finished.

Torsten



reply via email to

[Prev in Thread] Current Thread [Next in Thread]