lmi
[Top][All Lists]
Advanced

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

Re: [lmi] [PATCH] Add undisplayable_exception


From: Greg Chicares
Subject: Re: [lmi] [PATCH] Add undisplayable_exception
Date: Wed, 08 Oct 2014 15:33:35 +0000
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 2014-10-06 18:08Z, Vadim Zeitlin wrote:
[...]
> +class undisplayable_exception

I get a segfault in a case that shouldn't be allowed to arise.

I applied both your 2014-10-06 patches, along with the following...

[BEGIN PATCH]
Index: skeleton.cpp
===================================================================
--- skeleton.cpp        (revision 5974)
+++ skeleton.cpp        (working copy)
@@ -894,6 +894,7 @@

 void Skeleton::UponTestAppStandardException(wxCommandEvent&)
 {
+throw undisplayable_exception("UNDISPLAYABLE");
     throw std::runtime_error("Test a standard exception.");
 }

[END PATCH]
...to find out what would happen if we ever make the mistake of
throwing this new exception from code used in production. Of course,
we should guard against that--perhaps in 'test_coding_rules.cpp', by
forbidding the exception's name in any file not matching '*wx_test*'.
But I wanted to know what would happen.

Because this exception is designed to leak through the production
system's exception colander, I kind of hoped for the behavior that
exit() or a std::terminate_handler might give. But instead I got
the segfault below, and it seems curious enough that I thought I
should ask about it.

Perhaps the SendMessage(WM_MDISETMENU) failure for insufficient
storage is merely incidental and uninteresting. In that case, I'll
just modify 'test_coding_rules' as above. That's the best we can do:
we can't trap this exception at run time in the production system,
because its intended purpose is to elude any such trap. OTOH, might
this reveal a latent issue elsewhere that actually is interesting?

/opt/lmi/bin[0]$gdb ./lmi_wx_shared
[...]
(gdb) set arg --ash_nazg --data_path=/opt/lmi/data
(gdb) r
[...]
warning: In file ../src/msw/mdi.cpp at line 1437: 'SendMessage(WM_MDISETMENU)' 
failed with error 0x00000008 (not enough storage is available to process this 
command.).

Program received signal SIGSEGV, Segmentation fault.
0x003f0319 in ?? ()
(gdb) bt
#0  0x003f0319 in ?? ()
#1  0x64b21d4f in wxDocParentFrameAnyBase::TryProcessEvent(wxEvent&) ()
   from 
/opt/lmi/local/lib/wxmsw30u_gcc_gcc-345-241998efc12205172ed24c18788ea2cd.dll
#2  0x6543cab4 in wxDocParentFrameAny<wxMDIParentFrame>::TryBefore(wxEvent&) ()
   from 
/opt/lmi/local/lib/wxmsw30u_gcc_gcc-345-241998efc12205172ed24c18788ea2cd.dll
#3  0x64781b5a in wxEvtHandler::ProcessEventLocally(wxEvent&) ()
   from 
/opt/lmi/local/lib/wxmsw30u_gcc_gcc-345-241998efc12205172ed24c18788ea2cd.dll
#4  0x64781c25 in wxEvtHandler::ProcessEvent(wxEvent&) ()
   from 
/opt/lmi/local/lib/wxmsw30u_gcc_gcc-345-241998efc12205172ed24c18788ea2cd.dll
#5  0x6477c2cc in wxEvtHandler::SafelyProcessEvent(wxEvent&) ()
   from 
/opt/lmi/local/lib/wxmsw30u_gcc_gcc-345-241998efc12205172ed24c18788ea2cd.dll
#6  0x64c5c94b in wxWindowBase::HandleWindowEvent(wxEvent&) const ()
   from 
/opt/lmi/local/lib/wxmsw30u_gcc_gcc-345-241998efc12205172ed24c18788ea2cd.dll
#7  0x64931ecd in wxWindow::HandleActivate(int, bool, HWND__*) ()
   from 
/opt/lmi/local/lib/wxmsw30u_gcc_gcc-345-241998efc12205172ed24c18788ea2cd.dll
#8  0x649fd674 in wxMDIParentFrame::HandleActivate(int, bool, HWND__*) ()
---Type <return> to continue, or q <return> to quit---
   from 
/opt/lmi/local/lib/wxmsw30u_gcc_gcc-345-241998efc12205172ed24c18788ea2cd.dll
#9  0x64a0429d in wxMDIParentFrame::MSWWindowProc(unsigned int, unsigned int, 
long) ()
   from 
/opt/lmi/local/lib/wxmsw30u_gcc_gcc-345-241998efc12205172ed24c18788ea2cd.dll
#10 0x64939700 in wxWndProc(HWND__*, unsigned int, unsigned int, long) ()
   from 
/opt/lmi/local/lib/wxmsw30u_gcc_gcc-345-241998efc12205172ed24c18788ea2cd.dll
#11 0x7e418734 in USER32!GetDC () from /cygdrive/c/WINDOWS/system32/USER32.dll
#12 0x00bc0682 in ?? ()
#13 0x7e418816 in USER32!GetDC () from /cygdrive/c/WINDOWS/system32/USER32.dll
#14 0x64939650 in wxAssociateWinWithHandle(HWND__*, wxWindow*) ()
   from 
/opt/lmi/local/lib/wxmsw30u_gcc_gcc-345-241998efc12205172ed24c18788ea2cd.dll
#15 0x7e428ea0 in USER32!DefWindowProcW ()
   from /cygdrive/c/WINDOWS/system32/USER32.dll
#16 0x00000000 in ?? ()
(gdb)




reply via email to

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