Re: IconInfo iconInfo: member call on null pointer
On Sat, Sep 25, 2021 at 12:00:12PM -0400, Scott Kostyshak wrote: > On Sat, Sep 25, 2021 at 04:53:20PM +0200, Jean-Marc Lasgouttes wrote: > > Le 25/09/2021 à 05:20, Scott Kostyshak a écrit : > > > 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' > > > > What I do not understand is why it does not crash without fsanitized. > > I guess it's undefined behavior? > > https://stackoverflow.com/questions/5431420/why-doesnt-the-program-crash-when-i-call-a-member-function-through-a-null-point > > > BTW, with your patch is the output pdf correct? > > I will look at the differences between GUI and command line, and between > patch/no-patch and report back within a couple of days. With the "patch" the export from the command line is wrong (it omits the icon). Without the patch, both GUI and command-line exported PDFs are equivalent, and include the icon. Scott signature.asc Description: PGP signature -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Master regression example with emph and comment
The attached example compiles fine with 2.3.x. On master, the \emph is not closed after "regardless" as what happens on 2.3.x. Scott emph-and-comment-mwe.lyx Description: application/lyx signature.asc Description: PGP signature -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: IconInfo iconInfo: member call on null pointer
On Sat, Sep 25, 2021 at 02:15:14PM +0200, Kornel Benko wrote: > Am Sat, 25 Sep 2021 08:03:39 -0400 > schrieb Scott Kostyshak : > > > 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 : > > > > > > > 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. True, so it's a good idea to figure out whether that's the case :) I don't have much time but I'll look at the differences for this specific case in the next couple of days. Scott signature.asc Description: PGP signature -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: IconInfo iconInfo: member call on null pointer
On Sat, Sep 25, 2021 at 04:53:20PM +0200, Jean-Marc Lasgouttes wrote: > Le 25/09/2021 à 05:20, Scott Kostyshak a écrit : > > 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' > > What I do not understand is why it does not crash without fsanitized. I guess it's undefined behavior? https://stackoverflow.com/questions/5431420/why-doesnt-the-program-crash-when-i-call-a-member-function-through-a-null-point > BTW, with your patch is the output pdf correct? I will look at the differences between GUI and command line, and between patch/no-patch and report back within a couple of days. Scott signature.asc Description: PGP signature -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: IconInfo iconInfo: member call on null pointer
Le 25/09/2021 à 05:20, Scott Kostyshak a écrit : 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' What I do not understand is why it does not crash without fsanitized. BTW, with your patch is the output pdf correct? JMarc -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: IconInfo iconInfo: member call on null pointer
Am Sat, 25 Sep 2021 08:03:39 -0400 schrieb Scott Kostyshak : > 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 : > > > > > 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 pgpr7TDjBPcoP.pgp Description: Digitale Signatur von OpenPGP -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: IconInfo iconInfo: member call on null pointer
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 : > > > 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 signature.asc Description: PGP signature -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: IconInfo iconInfo: member call on null pointer
Am Fri, 24 Sep 2021 23:20:51 -0400 schrieb Scott Kostyshak : > 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. Kornel pgpYYabWmVgv5.pgp Description: Digitale Signatur von OpenPGP -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel