[Freewx-maint] Bug#646654: mriconvert: FTBFS: help2man: can't get `--help' info from obj-x86_64-linux-gnu/release/mcverter

Olly Betts olly at survex.com
Fri Nov 11 04:12:50 UTC 2011


On Tue, Oct 25, 2011 at 10:59:25PM -0500, Steve M. Robbins wrote:
> The underlying problem is that "mcverter" segfaults in the
> wxCmdLineParser.Parse() call.  Below is a small test case that
> exhibits this problem.
> 
> Test transcript:
[snip]

This seems to be an issue with wx upstream.  If I build their console
sample to test wxCmdLine then it also segfaults:

g++ -oconsole -DTEST_CMDLINE `wx-config --cxxflags` console.cpp `wx-config --libs`

Either removing the use of wxInitializer or passing argc and argv to its
constructor fixes the segfault.

The issue is that (at least in wx2.8) the app name used by wxCmdLineParser
is got from wxTheApp->argv if wxTheApp is non-NULL, without checking
further.  I'll patch wxwidgets2.8 to also check wxTheApp->argc > 0 there,
as it does elsewhere in the same source file before using
wxTheApp->argv[0].  Then it'll use the argv passed to wxCmdLineParser
instead in this case (it seems a bit odd that it uses a different argv at
all, but I'd rather not diverge from what wx upstream have chosen to do
here).

The code in mriconvert can probably easily work around this by passing argc
and argv to wxInitializer (and it probably ought to in upstream versions so
that it works with current wx 2.8 releases).

Cheers,
    Olly





More information about the Freewx-maint mailing list