IconInfo iconInfo: member call on null pointer

Kornel Benko kornel at lyx.org
Sat Sep 25 12:15:14 UTC 2021


Am Sat, 25 Sep 2021 08:03:39 -0400
schrieb Scott Kostyshak <skostysh at lyx.org>:

> On Sat, Sep 25, 2021 at 01:08:56PM +0200, Kornel Benko wrote:
> > Am Fri, 24 Sep 2021 23:20:51 -0400
> > schrieb Scott Kostyshak <skostysh at lyx.org>:
> >   
> > > 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  
> > 
> > Why not? Looks perfect to me. But probably not the only place.  
> 
> Because I don't understand what the code does. Can a different PDF be produced if the
> export is from the command line instead of from the GUI?
> 
> Scott

Makes sense.But if that were the case, we would be in trouble. All our tests (without GUI)
were invalid.

	Kornel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: Digitale Signatur von OpenPGP
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20210925/98e17d11/attachment.asc>


More information about the lyx-devel mailing list