Opened 11 years ago

Closed 11 years ago

#542 closed defect (fixed)

broken signal logic

Reported by: westram Owned by: epruesse
Priority: normal Milestone:
Component: Library (GUI) Version: gtkport
Keywords: Cc: mcottrell

Description

When a signal triggers an application-exit, the signal gets destroyed together with AW_root (causing assertion to fail).

Change History (6)

comment:1 follow-up: Changed 11 years ago by westram

  • Owner changed from devel to westram
  • Status changed from new to _started
  • in ARB_NTREE this does not cause problems
  • in ARB_EDIT4 this causes a SEGV. stacktrace:
    aw_message: '(AW_signal.cxx:186):virtual AW_signal::~AW_signal(): runtime check failed: (prvt->in_emit == 0)'
    
    Program received signal SIGSEGV, Segmentation fault.
    0x0000000000000030 in ?? ()
    (gdb) whe
    #0  0x0000000000000030 in ?? ()
    #1  0x00007ffff6edf833 in aw_refresh_tmp_message_display (awr=0x9a0480) at AW_status.cxx:479
    #2  0x00007ffff6edfac7 in aw_insert_message_in_tmp_message (awr=0x9a0480, message=0xd4d770 "(AW_signal.cxx:186):virtual AW_signal::~AW_signal(): runtime check failed: (prvt->in_emit == 0)") at AW_status.cxx:535
    #3  0x00007ffff6ee0e16 in aw_message (msg=0xd4d770 "(AW_signal.cxx:186):virtual AW_signal::~AW_signal(): runtime check failed: (prvt->in_emit == 0)") at AW_status.cxx:954
    #4  0x00007ffff6ec7ac1 in aw_log_handler (message=0xd4d770 "(AW_signal.cxx:186):virtual AW_signal::~AW_signal(): runtime check failed: (prvt->in_emit == 0)") at AW_root.cxx:227
    #5  0x00007ffff74540c9 in g_logv () from /lib/libglib-2.0.so.0
    #6  0x00007ffff74544e3 in g_log () from /lib/libglib-2.0.so.0
    #7  0x00007ffff745464b in g_warn_message () from /lib/libglib-2.0.so.0
    #8  0x00007ffff6ed66f0 in AW_signal::~AW_signal (this=0xcff218) at AW_signal.cxx:186
    #9  0x00007ffff6e90a5d in AW_action::~AW_action (this=0xcff1d0) at AW_action.cxx:47
    #10 0x00007ffff6ec849c in AW_root::~AW_root (this=0x9a0480) at AW_root.cxx:303
    #11 0x00007ffff6ec73de in destroy_AW_root () at AW_root.cxx:106
    #12 0x00007ffff3d47352 in __run_exit_handlers (status=0) at exit.c:78
    #13 *__GI_exit (status=0) at exit.c:100
    #14 0x00000000004dd08a in ED4_exit () at ED4_no_class.cxx:823
    #15 0x00000000004dd0ce in ED4_quit_editor (aww=0xae0a50) at ED4_no_class.cxx:830
    #16 0x00007ffff6edc5cc in StrictlyTypedCallback<void, AW_window*, long, long>::operator() (this=0xcff2c0, p1=0xae0a50, p2=0, p3=0) at /home/ralf/ARB-bilbo/ARB.gtk.fix_532/INCLUDE/cbtypes.h:117
    #17 0x00007ffff6edb79e in Callback_FVV<void, AW_window*>::operator() (this=<incomplete type>, fixed=0xae0a50) at /home/ralf/ARB-bilbo/ARB.gtk.fix_532/INCLUDE/cbtypes.h:172
    #18 0x00007ffff6edafe3 in WindowCallbackSlot::emit (this=0xcff2b0) at AW_signal.cxx:72
    #19 0x00007ffff6ed6fb4 in AW_signal::emit (this=0xcff218) at AW_signal.cxx:317
    #20 0x00007ffff6e90d42 in AW_action::user_clicked (this=0xcff1d0) at AW_action.cxx:114
    #21 0x00007ffff6e9143e in _aw_signal_received_from_widget (w=0xd00800, data=0xcff1d0) at AW_action.cxx:213
    #22 0x00007ffff4bde5de in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
    #23 0x00007ffff4bf2598 in ?? () from /usr/lib/libgobject-2.0.so.0
    #24 0x00007ffff4bf3a76 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
    #25 0x00007ffff4bf4033 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
    #26 0x00007ffff688e4e5 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
    #27 0x00007ffff4bde5de in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
    #28 0x00007ffff4bf1e61 in ?? () from /usr/lib/libgobject-2.0.so.0
    #29 0x00007ffff4bf3a76 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
    #30 0x00007ffff4bf4033 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
    #31 0x00007ffff688d1ed in ?? () from /usr/lib/libgtk-x11-2.0.so.0
    #32 0x00007ffff693a188 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
    #33 0x00007ffff4bde5de in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
    #34 0x00007ffff4bf21dd in ?? () from /usr/lib/libgobject-2.0.so.0
    #35 0x00007ffff4bf38b9 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
    #36 0x00007ffff4bf4033 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
    #37 0x00007ffff6a510cf in ?? () from /usr/lib/libgtk-x11-2.0.so.0
    #38 0x00007ffff6932653 in gtk_propagate_event () from /usr/lib/libgtk-x11-2.0.so.0
    #39 0x00007ffff693372b in gtk_main_do_event () from /usr/lib/libgtk-x11-2.0.so.0
    #40 0x00007ffff65a786c in ?? () from /usr/lib/libgdk-x11-2.0.so.0
    #41 0x00007ffff74499d2 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
    #42 0x00007ffff744d858 in ?? () from /lib/libglib-2.0.so.0
    #43 0x00007ffff744dd65 in g_main_loop_run () from /lib/libglib-2.0.so.0
    #44 0x00007ffff6933bc7 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
    #45 0x00007ffff6ec9021 in AW_root::main_loop (this=0x9a0480) at AW_root.cxx:489
    #46 0x00000000004c933f in ARB_main (argc=1, argv=0x7fffffffe2d0) at ED4_main.cxx:579
    #47 0x00000000004a489f in main (argc=2, argv=0x7fffffffe2c8) at arb_main.cxx:10
    

comment:2 Changed 11 years ago by mcottrell

  • Cc mcottrell added

comment:3 in reply to: ↑ 1 Changed 11 years ago by westram

  • Status changed from _started to infoneeded
  • in ARB_EDIT4 this causes a SEGV. stacktrace:

SEGV fixed by [12262].

@elmar: please review

comment:4 Changed 11 years ago by epruesse

  • Status changed from infoneeded to assigned

I'll look into it. The AW_signal currently cannot self-destruct. I guess I'll have to put everything into the pimple so that it can defer freeing the data until the emit() is done.

comment:5 Changed 11 years ago by epruesse

  • Owner changed from westram to epruesse

comment:6 Changed 11 years ago by epruesse

  • Resolution set to fixed
  • Status changed from assigned to closed

fixed by r12265 — AW_signal can now be deleted from within its emit() loop. The AW_signal::Pimpl will survive until emit() has completed and self delete at its end.

Note: See TracTickets for help on using tickets.