[ wxwindows-Bugs-1145490 ] except sample crashes
SourceForge.net
noreply at sourceforge.net
Fri Sep 14 01:10:50 PDT 2007
Bugs item #1145490, was opened at 2005-02-21 15:59
Message generated for change (Comment added) made by lmichalski
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1145490&group_id=9863
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxGTK specific
Group: Fatal
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Lukasz Michalski (lmichalski)
Assigned to: Nobody/Anonymous (nobody)
Summary: except sample crashes
Initial Comment:
exept sample crashes when trying to throw int or object. Only
throwing wxString from MyFrame works ok.
Steps to reproduce:
1. Run except sample
2. Select "throw int" from menu.
wxGTK 2.5.x (CVS), gtk 2.4.14.
Backtrace from gdb:
Program terminated with signal 6, Aborted.
warning: current_sos: Can't read pathname for load map:
Input/output error
Reading symbols
from /home/users/zork/sources/wx_build/debug/lib/libwx_gtk2d_core-2.5.so.4...done.
Loaded symbols for ../../lib/libwx_gtk2d_core-2.5.so.4
[...]
#0 0x40d13841 in kill () from /lib/libc.so.6
#1 0x40ca1af1 in pthread_kill () from /lib/libpthread.so.0
#2 0x40ca1e6b in raise () from /lib/libpthread.so.0
#3 0x40d135d4 in raise () from /lib/libc.so.6
#4 0x40d14b0d in abort () from /lib/libc.so.6
#5 0x40c66e57 in __cxa_call_unexpected ()
from /usr/lib/libstdc++.so.5
#6 0x40c66e94 in std::terminate ()
from /usr/lib/libstdc++.so.5
#7 0x40c67006 in __cxa_throw ()
from /usr/lib/libstdc++.so.5
#8 0x080520a2 in MyDialog::OnThrowInt (this=0xbfffd180)
at /home/users/zork/sources/wxWidgets/samples/except/except.cpp:421
#9 0x403e1e0a in wxAppConsole::HandleEvent
(this=0x805d800, handler=0xbfffd180, func=
{__pfn = 0x8052072
<MyDialog::OnThrowInt(wxCommandEvent&)>, __delta =
0}, event=@0xbfffc2a0)
at /home/users/zork/sources/wxWidgets/src/common/appbase.cpp:307
#10 0x404929ff in wxEvtHandler::ProcessEventIfMatches
(entry=@0x8055de0, handler=0xbfffd180,
event=@0xbfffc2a0)
at /home/users/zork/sources/wxWidgets/src/common/event.cpp:1212
#11 0x40491a26 in wxEventHashTable::HandleEvent
(this=0x8055db0, event=@0xbfffc2a0, self=0xbfffd180)
at /home/users/zork/sources/wxWidgets/src/common/event.cpp:870
#12 0x40492c18 in wxEvtHandler::ProcessEvent
(this=0xbfffd180, event=@0xbfffc2a0)
at /home/users/zork/sources/wxWidgets/src/common/event.cpp:1274
#13 0x4028480f in wxWindowBase::TryParent
(this=0x81abbd0, event=@0xbfffc2a0)
at /home/users/zork/sources/wxWidgets/src/common/wincmn.cpp:2461
#14 0x40492c7a in wxEvtHandler::ProcessEvent
(this=0x81abbd0, event=@0xbfffc2a0)
at /home/users/zork/sources/wxWidgets/src/common/event.cpp:1287
#15 0x401b4bb7 in gtk_button_clicked_callback
(button=0x81abbd0)
at /home/users/zork/sources/wxWidgets/src/gtk/button.cpp:59
#16 0x40a977c1 in g_cclosure_marshal_VOID__VOID ()
from /usr/lib/libgobject-2.0.so.0
#17 0x40a83140 in g_closure_invoke ()
from /usr/lib/libgobject-2.0.so.0
#18 0x40a97148 in g_signal_emit_by_name ()
from /usr/lib/libgobject-2.0.so.0
#19 0x40a96281 in g_signal_emit_valist ()
from /usr/lib/libgobject-2.0.so.0
#20 0x40a96584 in g_signal_emit ()
from /usr/lib/libgobject-2.0.so.0
#21 0x4055b9a5 in gtk_button_clicked ()
from /usr/lib/libgtk-x11-2.0.so.0
#22 0x4055c98b in gtk_button_get_relief ()
from /usr/lib/libgtk-x11-2.0.so.0
#23 0x40a977c1 in g_cclosure_marshal_VOID__VOID ()
from /usr/lib/libgobject-2.0.so.0
#24 0x40a834d7 in g_cclosure_new_swap ()
from /usr/lib/libgobject-2.0.so.0
#25 0x40a83140 in g_closure_invoke ()
from /usr/lib/libgobject-2.0.so.0
#26 0x40a96af1 in g_signal_emit_by_name ()
from /usr/lib/libgobject-2.0.so.0
#27 0x40a96281 in g_signal_emit_valist ()
from /usr/lib/libgobject-2.0.so.0
#28 0x40a96584 in g_signal_emit ()
from /usr/lib/libgobject-2.0.so.0
#29 0x4055b8f5 in gtk_button_released ()
from /usr/lib/libgtk-x11-2.0.so.0
#30 0x4055c80b in gtk_button_get_relief ()
from /usr/lib/libgtk-x11-2.0.so.0
#31 0x40618654 in gtk_marshal_VOID__UINT_STRING ()
from /usr/lib/libgtk-x11-2.0.so.0
#32 0x40a834d7 in g_cclosure_new_swap ()
from /usr/lib/libgobject-2.0.so.0
#33 0x40a83140 in g_closure_invoke ()
from /usr/lib/libgobject-2.0.so.0
#34 0x40a96cf5 in g_signal_emit_by_name ()
from /usr/lib/libgobject-2.0.so.0
#35 0x40a9606d in g_signal_emit_valist ()
from /usr/lib/libgobject-2.0.so.0
#36 0x40a96584 in g_signal_emit ()
from /usr/lib/libgobject-2.0.so.0
#37 0x407176d9 in gtk_widget_send_expose ()
from /usr/lib/libgtk-x11-2.0.so.0
#38 0x40616bf2 in gtk_propagate_event ()
from /usr/lib/libgtk-x11-2.0.so.0
#39 0x40615946 in gtk_main_do_event ()
from /usr/lib/libgtk-x11-2.0.so.0
#40 0x4080c725 in gdk_x11_register_standard_event_type
() from /usr/lib/libgdk-x11-2.0.so.0
#41 0x40ae10d2 in g_main_depth ()
from /usr/lib/libglib-2.0.so.0
#42 0x40ae21c8 in g_main_context_dispatch ()
from /usr/lib/libglib-2.0.so.0
#43 0x40ae24fc in g_main_context_dispatch ()
from /usr/lib/libglib-2.0.so.0
#44 0x40ae2b43 in g_main_loop_run ()
from /usr/lib/libglib-2.0.so.0
#45 0x40615203 in gtk_main ()
from /usr/lib/libgtk-x11-2.0.so.0
#46 0x401c1f38 in wxDialog::ShowModal (this=0xbfffd180)
at /home/users/zork/sources/wxWidgets/src/gtk/dialog.cpp:217
#47 0x08051151 in MyFrame::OnDialog (this=0x80a2128)
at /home/users/zork/sources/wxWidgets/samples/except/except.cpp:347
#48 0x403e1e0a in wxAppConsole::HandleEvent
(this=0x805d800, handler=0x80a2128, func=
{__pfn = 0x8051124
<MyFrame::OnDialog(wxCommandEvent&)>, __delta = 0},
event=@0xbfffd480)
at /home/users/zork/sources/wxWidgets/src/common/appbase.cpp:307
#49 0x404929ff in wxEvtHandler::ProcessEventIfMatches
(entry=@0x8055cf0, handler=0x80a2128,
event=@0xbfffd480)
at /home/users/zork/sources/wxWidgets/src/common/event.cpp:1212
#50 0x40491a26 in wxEventHashTable::HandleEvent
(this=0x8055ca0, event=@0xbfffd480, self=0x80a2128)
at /home/users/zork/sources/wxWidgets/src/common/event.cpp:870
#51 0x40492c18 in wxEvtHandler::ProcessEvent
(this=0x80a2128, event=@0xbfffd480)
at /home/users/zork/sources/wxWidgets/src/common/event.cpp:1274
#52 0x0805109b in MyFrame::ProcessEvent
(this=0x80a2128, event=@0xbfffd480)
at /home/users/zork/sources/wxWidgets/samples/except/except.cpp:325
#53 0x401d07c2 in gtk_menu_clicked_callback
(widget=0x80b2528, menu=0x80acbb8)
at /home/users/zork/sources/wxWidgets/src/gtk/menu.cpp:654
#54 0x40a977c1 in g_cclosure_marshal_VOID__VOID ()
from /usr/lib/libgobject-2.0.so.0
#55 0x40a83140 in g_closure_invoke ()
from /usr/lib/libgobject-2.0.so.0
#56 0x40a972c8 in g_signal_emit_by_name ()
from /usr/lib/libgobject-2.0.so.0
#57 0x40a96281 in g_signal_emit_valist ()
from /usr/lib/libgobject-2.0.so.0
#58 0x40a96584 in g_signal_emit ()
from /usr/lib/libgobject-2.0.so.0
#59 0x407178a7 in gtk_widget_activate ()
from /usr/lib/libgtk-x11-2.0.so.0
#60 0x406293c2 in gtk_menu_shell_activate_item ()
from /usr/lib/libgtk-x11-2.0.so.0
#61 0x406286fd in gtk_menu_shell_deactivate ()
from /usr/lib/libgtk-x11-2.0.so.0
#62 0x40621266 in gtk_menu_reorder_child ()
from /usr/lib/libgtk-x11-2.0.so.0
#63 0x40618654 in gtk_marshal_VOID__UINT_STRING ()
from /usr/lib/libgtk-x11-2.0.so.0
#64 0x40a834d7 in g_cclosure_new_swap ()
from /usr/lib/libgobject-2.0.so.0
#65 0x40a83140 in g_closure_invoke ()
from /usr/lib/libgobject-2.0.so.0
#66 0x40a96cf5 in g_signal_emit_by_name ()
from /usr/lib/libgobject-2.0.so.0
#67 0x40a9606d in g_signal_emit_valist ()
from /usr/lib/libgobject-2.0.so.0
#68 0x40a96584 in g_signal_emit ()
from /usr/lib/libgobject-2.0.so.0
#69 0x407176d9 in gtk_widget_send_expose ()
from /usr/lib/libgtk-x11-2.0.so.0
#70 0x40616bf2 in gtk_propagate_event ()
from /usr/lib/libgtk-x11-2.0.so.0
#71 0x40615946 in gtk_main_do_event ()
from /usr/lib/libgtk-x11-2.0.so.0
#72 0x4080c725 in gdk_x11_register_standard_event_type
() from /usr/lib/libgdk-x11-2.0.so.0
#73 0x40ae10d2 in g_main_depth ()
from /usr/lib/libglib-2.0.so.0
#74 0x40ae21c8 in g_main_context_dispatch ()
from /usr/lib/libglib-2.0.so.0
#75 0x40ae24fc in g_main_context_dispatch ()
from /usr/lib/libglib-2.0.so.0
#76 0x40ae2b43 in g_main_loop_run ()
from /usr/lib/libglib-2.0.so.0
#77 0x40615203 in gtk_main ()
from /usr/lib/libgtk-x11-2.0.so.0
#78 0x4016282a in wxEventLoop::Run (this=0x81a22b0)
at /home/users/zork/sources/wxWidgets/src/gtk/evtloop.cpp:80
#79 0x401f0408 in wxAppBase::MainLoop (this=0x805d800)
at /home/users/zork/sources/wxWidgets/src/common/appcmn.cpp:272
#80 0x401f0566 in wxAppBase::OnRun (this=0x805d800)
at /home/users/zork/sources/wxWidgets/src/common/appcmn.cpp:340
#81 0x40424e05 in wxEntry (argc=@0xbfffe040,
argv=0xbfffe094)
at /home/users/zork/sources/wxWidgets/src/common/init.cpp:417
#82 0x0804f97e in main (argc=1, argv=0xbfffe094)
at /home/users/zork/sources/wxWidgets/samples/except/except.cpp:206
----------------------------------------------------------------------
>Comment By: Lukasz Michalski (lmichalski)
Date: 2007-09-14 10:10
Message:
Logged In: YES
user_id=638563
Originator: YES
I saw some tutorials how to distribute binary for linux and they mention
that GTK should not be linked as static. If this is true then I think that
this solution is not possible to achieve.
I hardly know anything about GTK+ but I was thinking about replacing
gtk_main() with one loop iteration and postpone event sending like this
pseudo code:
while(mainloop_running) {
//run one gtk loop iteration, gather all information
//into wx callback structures for event posting
gtk_do_one_iteration();
//see what events do we need to post
//in wx callback structures and post them
call_requested_callbacks();
};
This probably needs many changes in current code, but I don't think it is
impossible.
----------------------------------------------------------------------
Comment By: Vadim Zeitlin (vadz)
Date: 2007-09-13 17:56
Message:
Logged In: YES
user_id=71618
Originator: NO
This is the "best" way except, of course, that there is no way to do
it...
AFAIK you really need to build GTK+ with -fexceptions, I don't see any
other solution.
----------------------------------------------------------------------
Comment By: Lukasz Michalski (lmichalski)
Date: 2007-09-07 23:51
Message:
Logged In: YES
user_id=638563
Originator: YES
I think that this post describes the problem:
http://gcc.gnu.org/ml/gcc/2000-02/msg00263.html
The best solution would be to redesign GTK port in the way that C++
callbacks would not be called from inside of GTK stack.
----------------------------------------------------------------------
Comment By: Lukasz Michalski (lmichalski)
Date: 2007-09-07 23:30
Message:
Logged In: YES
user_id=638563
Originator: YES
I've done some research and found that terminate is called inside
gtk_main() from wxEventLoop::Run().
Changing it to:
try {
gtk_main();
} catch (int) {
puts("got it 3");
};
and running except sample never shows this debug message. Moving this
try..catch block to MyFrame::ProcessEvent in except.cpp caauses debug
message to be shown.
I am unable to debug GTK library to find exactly where throwed exception
stops.
I am using gtk 2.8.20
----------------------------------------------------------------------
Comment By: Lukasz Michalski (lmichalski)
Date: 2007-09-07 22:09
Message:
Logged In: YES
user_id=638563
Originator: YES
This problem is rahter critical and makes exception handling unusable.
They never reach OnRun for reasons unknown to me.
I checked 2.8.0 and today's HEAD and this problem still exists.
Any chance to resolve this in near future?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1145490&group_id=9863
More information about the wx-dev
mailing list