[Top][All Lists]

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

[lmi] Sporadic segfault during catastrophic exit

From: Greg Chicares
Subject: [lmi] Sporadic segfault during catastrophic exit
Date: Mon, 26 Jul 2010 16:27:58 +0000
User-agent: Thunderbird (Windows/20100228)

To reproduce, spoil 'validated.md5' (e.g. by altering an md5 sum) and try
to start 'lmi_wx_shared.exe' with no arguments. This message:
  At least one required file is missing, altered, or invalid. Try reinstalling.
  [file /lmi/src/lmi/authenticity.cpp, line 286]
is supposed to be shown. However, sometimes a segfault occurs. I can
reproduce it more than half the time with
which today corresponds to lmi-20100701T1133Z HEAD (though I plan to
update that archive every month or so). With current HEAD, I can
reproduce it only about two to five percent of the time.

Here's a backtrace:

(gdb) bt
#0  0x6d212ee3 in __DTOR_LIST__ ()
   from /home/chicares/bsdtar/testing/extracted/lmi-20100701T1133Z/liblmi.dll
#1  0x004a4b45 in _Unwind_RaiseException_Phase2 ()
#2  0x004a4f95 in _Unwind_SjLj_Resume ()
#3  0x00484ddb in (anonymous namespace)::concrete_system_command (
    address@hidden) at /opt/lmi/local/include/wx-2.9/wx/utils.h:660
#4  0x6cf9cf0d in Authenticity::Assay (address@hidden,
    address@hidden) at /lmi/src/lmi/authenticity.hpp:89
#5  0x6cf9d5e3 in authenticate_system () at /lmi/src/lmi/authenticity.cpp:280
#6  0x00442c73 in Skeleton::OnInit (this=0x1cf7c30)
    at /lmi/src/lmi/main_wx.cpp:630
#7  0x004c3eb1 in wxAppConsoleBase::CallOnInit (this=0x2)
    at /opt/lmi/local/include/wx-2.9/wx/app.h:78
#8  0x618cc5c9 in wxEntryReal ()
   from /home/chicares/bsdtar/testing/extracted/lmi-20100701T1133Z/wxmsw290u_gcc
#9  0x619b867e in wxEntry ()
   from /home/chicares/bsdtar/testing/extracted/lmi-20100701T1133Z/wxmsw290u_gcc
#10 0x0043638d in WinMain (hInstance=0x2, hPrevInstance=0x2,
    lpCmdLine=0x2 <Address 0x2 out of bounds>, nCmdShow=2)
    at /lmi/src/lmi/main_wx.cpp:212
#11 0x004a4258 in main ()

Here's the relevant part of 'authenticity.cpp':

        system_command("md5sum --check --status " + std::string(md5sum_file()));
        warning() << diagnostic_message << LMI_FLUSH;

where system_command() ultimately calls wxExecute().

The reason for using std::exit() is greppably documented elsewhere:

/// If 'new(wx) wxMenuBar' fails, then the program would crash except
/// for the explicit test below. Use std::exit() instead of wxExit()
/// because wxExit() itself can lead to a crash.

though that old comment doesn't record the circumstances under which
I saw a crash with wxExit() (which would have been five years ago,
with wx-2.5.4 or so, whereas now we're using wx-2.9.0).

Curiously, sometimes my JIT debugger pops up with that segfault,
and then the expected
  At least one required file is missing, altered, or ...
messagebox pops up--so maybe std::exit() is a red herring. The one
thing that's constant is that the command
        system_command("md5sum --check --status " + std::string(md5sum_file()));
has to fail (indicating a problem in the distribution). Normally,
the command wouldn't fail; and the normal, non-failing invocation is
probably run hundreds of times a day on many machines, so we ought
to have heard about any segfault in those circumstances.

reply via email to

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