IconInfo iconInfo: member call on null pointer
Scott Kostyshak
skostysh at lyx.org
Sat Sep 25 03:20:51 UTC 2021
After building with fsanitize=undefined -fno-omit-frame-pointer, I get the following:
$ cd lib/examples/ && lyx -e pdf Welcome.lyx
/home/scott/lyxbuilds/master/repo/src/frontends/qt/GuiApplication.cpp:558:55: runtime error: member call on null pointer of type 'struct GuiApplication'
/home/scott/lyxbuilds/master/repo/src/frontends/qt/GuiApplication.cpp:558:55: runtime error: member access within null pointer of type 'struct GuiApplication'
After that, LyX gives a backtrace and crashes. I attach the backtrace in case it's useful.
Just for informational purposes (I'm not proposing this as a patch), the following does fix the error:
diff --git a/src/frontends/qt/GuiApplication.cpp b/src/frontends/qt/GuiApplication.cpp
index 01a646de37..b93c4753c7 100644
--- a/src/frontends/qt/GuiApplication.cpp
+++ b/src/frontends/qt/GuiApplication.cpp
@@ -555,6 +555,8 @@ IconInfo iconInfo(FuncRequest const & f, bool unknown, bool rtl)
if (unknown)
names << "unknown";
+ if (!theGuiApp())
+ return res;
search_mode const mode = theGuiApp()->imageSearchMode();
// The folders where icons are searched for
QStringList imagedirs;
Scott
-------------- next part --------------
( 1) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::frontend::Alert::doError(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool)
( 2) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: void std::__invoke_impl<void, void (*&)(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool), std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool&>(std::__invoke_other, void (*&)(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool), std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool&)
( 3) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: std::__invoke_result<void (*&)(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool), std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool&>::type std::__invoke<void (*&)(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool), std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool&>(void (*&)(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool), std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool&)
( 4) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: void std::_Bind<void (*(std::reference_wrapper<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const>, std::reference_wrapper<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const>, std::reference_wrapper<bool>))(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool)>::__call<void, , 0ul, 1ul, 2ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul, 2ul>)
( 5) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: void std::_Bind<void (*(std::reference_wrapper<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const>, std::reference_wrapper<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const>, std::reference_wrapper<bool>))(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool)>::operator()<, void>()
( 6) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: void std::__invoke_impl<void, std::_Bind<void (*(std::reference_wrapper<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const>, std::reference_wrapper<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const>, std::reference_wrapper<bool>))(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool)>&>(std::__invoke_other, std::_Bind<void (*(std::reference_wrapper<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const>, std::reference_wrapper<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const>, std::reference_wrapper<bool>))(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool)>&)
( 7) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: std::enable_if<is_invocable_r_v<void, std::_Bind<void (*(std::reference_wrapper<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const>, std::reference_wrapper<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const>, std::reference_wrapper<bool>))(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool)>&>, void>::type std::__invoke_r<void, std::_Bind<void (*(std::reference_wrapper<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const>, std::reference_wrapper<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const>, std::reference_wrapper<bool>))(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool)>&>(std::_Bind<void (*(std::reference_wrapper<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const>, std::reference_wrapper<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const>, std::reference_wrapper<bool>))(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool)>&)
( 8) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: std::_Function_handler<void (), std::_Bind<void (*(std::reference_wrapper<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const>, std::reference_wrapper<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const>, std::reference_wrapper<bool>))(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool)> >::_M_invoke(std::_Any_data const&)
( 9) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: std::function<void ()>::operator()() const
( 10) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::frontend::InGuiThread<void>::synchronousFunctionCall()
( 11) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::frontend::IntoGuiThreadMover::callInGuiThread()
( 12) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: void lyx::frontend::InGuiThread<void>::call<std::_Bind<void (*(std::reference_wrapper<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const>, std::reference_wrapper<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const>, std::reference_wrapper<bool>))(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool)> >(std::_Bind<void (*(std::reference_wrapper<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const>, std::reference_wrapper<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const>, std::reference_wrapper<bool>))(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool)>)
( 13) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: void lyx::frontend::InGuiThread<void>::call<void (*)(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool), std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, bool>(void (*)(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool), std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool&)
( 14) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::frontend::Alert::error(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool)
( 15) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx(+0x3a7bc83) [0x55c45347dc83]
( 16) /lib/x86_64-linux-gnu/libc.so.6: /lib/x86_64-linux-gnu/libc.so.6(+0x41040) [0x7ff77f63d040]
( 17) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::frontend::iconInfo(lyx::FuncRequest const&, bool, bool)
( 18) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::frontend::Application::iconName[abi:cxx11](lyx::FuncRequest const&, bool)
( 19) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::InsetInfo::updateBuffer(lyx::ParIterator const&, lyx::UpdateType, bool)
( 20) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::Buffer::updateBuffer(lyx::ParIterator&, lyx::UpdateType, bool) const
( 21) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::Buffer::updateBuffer(lyx::Buffer::UpdateScope, lyx::UpdateType) const
( 22) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::Buffer::updateBuffer() const
( 23) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::Buffer::makeLaTeXFile(lyx::support::FileName const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, lyx::OutputParams const&, lyx::Buffer::OutputWhat) const
( 24) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::Buffer::doExport(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const
( 25) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::Buffer::doExport(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const
( 26) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::Buffer::doExport(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) const
( 27) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::Buffer::dispatch(lyx::FuncRequest const&, lyx::DispatchResult&)
( 28) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::Buffer::dispatch(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, lyx::DispatchResult&)
( 29) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::LyX::execWithoutGui(int&, char**)
( 30) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::LyXConsoleApp::doExec()
( 31) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::support::ConsoleApplicationPrivate::doExec()
( 32) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx(+0x53b13e6) [0x55c454db33e6]
( 33) /lib/x86_64-linux-gnu/libQt5Core.so.5: QObject::event(QEvent*)
( 34) /lib/x86_64-linux-gnu/libQt5Core.so.5: QCoreApplication::notifyInternal2(QObject*, QEvent*)
( 35) /lib/x86_64-linux-gnu/libQt5Core.so.5: QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)
( 36) /lib/x86_64-linux-gnu/libQt5Core.so.5: /lib/x86_64-linux-gnu/libQt5Core.so.5(+0x312ba7) [0x7ff78080cba7]
( 37) /lib/x86_64-linux-gnu/libglib-2.0.so.0: /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x25b) [0x7ff77f4fe8eb]
( 38) /lib/x86_64-linux-gnu/libglib-2.0.so.0: /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0xa8d28) [0x7ff77f551d28]
( 39) /lib/x86_64-linux-gnu/libglib-2.0.so.0: /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x33) [0x7ff77f4fc023]
( 40) /lib/x86_64-linux-gnu/libQt5Core.so.5: QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
( 41) /lib/x86_64-linux-gnu/libQt5Core.so.5: QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)
( 42) /lib/x86_64-linux-gnu/libQt5Core.so.5: QCoreApplication::exec()
( 43) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::support::ConsoleApplicationPrivate::execute()
( 44) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::support::ConsoleApplication::exec()
( 45) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: lyx::LyX::exec(int&, char**)
( 46) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx(main+0x70) [0x55c45387b1c6]
( 47) /lib/x86_64-linux-gnu/libc.so.6: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xd5) [0x7ff77f624565]
( 48) /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx: /home/scott/lyxbuilds/master/CMakeBuild/bin/lyx(_start+0x2e) [0x55c452e36ade]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20210924/6ef8513b/attachment-0001.asc>
More information about the lyx-devel
mailing list