Menu

#591 Assert failed in RemoveEventHandler()

Undefined
open
nobody
wx30 (74)
Bug_Report
2022-04-20
2017-12-31
fenugrec
No

Hard to reproduce, steps look like
1- open C:B
2- Settings->Editor
3- "Encoding settings" tab
4- view the drop-down list of encodings but press Esc/click outside to keep the same encoding
5- "Other editor settings" tab
6- change "Highlight line under caret" tickbox
7- press OK.

I get an assertion failure with a very convenient window with the following backtrace:
ASSERT INFO:
./src/common/wincmn.cpp(1517): assert "Assert failure" failed in RemoveEventHandler(): where has the event handler gone?

BACKTRACE: [1] wxWindowBase::RemoveEventHandler(wxEvtHandler*) [2] wxKeyBinder::DetachAll() [3] wxKeyProfile::~wxKeyProfile() [4] cbKeyBinder::OnKeyConfigDialogDone(MyDialog*) [5] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) [6] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) [7] wxEvtHandler::TryHereOnly(wxEvent&) [8] wxEvtHandler::ProcessEventLocally(wxEvent&) [9] wxEvtHandler::ProcessEvent(wxEvent&) [10] wxWindowBase::TryAfter(wxEvent&) [11] wxEvtHandler::SafelyProcessEvent(wxEvent&) [12] g_closure_invoke [13] g_signal_emit_valist [14] g_signal_emit [15] g_closure_invoke [16] g_signal_emit_valist [17] g_signal_emit [18] g_closure_invoke [19] g_signal_emit_valist [20] g_signal_emit [21] gtk_propagate_event [22] gtk_main_do_event [23] g_main_context_dispatch [24] g_main_loop_run [25] gtk_main [26] wxGUIEventLoop::DoRun() [27] wxEventLoopBase::Run() [28] wxDialog::ShowModal() [29] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) [30] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) [31] wxEvtHandler::TryHereOnly(wxEvent&) [32] wxEvtHandler::DoTryChain(wxEvent&) [33] wxEvtHandler::ProcessEvent(wxEvent&) [34] wxWindowBase::TryAfter(wxEvent&) [35] wxEvtHandler::SafelyProcessEvent(wxEvent&) [36] wxMenuBase::SendEvent(int, int) [37] g_closure_invoke [38] g_signal_emit_valist [39] g_signal_emit [40] gtk_widget_activate [41] gtk_menu_shell_activate_item [42] g_closure_invoke [43] g_signal_emit_valist [44] g_signal_emit [45] gtk_propagate_event [46] gtk_main_do_event [47] g_main_context_dispatch [48] g_main_loop_run [49] gtk_main [50] wxGUIEventLoop::DoRun() [51] wxEventLoopBase::Run() [52] wxAppConsoleBase::MainLoop() [53] wxEntry(int&, wchar_t**) [54] __libc_start_main
I'm not sure what exactly CB was doing inside cbKeyBinder::OnKeyConfigDialogDone() ...

Discussion

  • fenugrec

    fenugrec - 2017-12-31

    Sorry about the poor formatting. I can't edit the report... here's the bt:

    ASSERT INFO:
    ./src/common/wincmn.cpp(1517): assert "Assert failure" failed in RemoveEventHandler(): where has the event handler gone?
    
    BACKTRACE:
    [1] wxWindowBase::RemoveEventHandler(wxEvtHandler*)
    [2] wxKeyBinder::DetachAll()
    [3] wxKeyProfile::~wxKeyProfile()
    [4] cbKeyBinder::OnKeyConfigDialogDone(MyDialog*)
    [5] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
    [6] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
    [7] wxEvtHandler::TryHereOnly(wxEvent&)
    [8] wxEvtHandler::ProcessEventLocally(wxEvent&)
    [9] wxEvtHandler::ProcessEvent(wxEvent&)
    [10] wxWindowBase::TryAfter(wxEvent&)
    [11] wxEvtHandler::SafelyProcessEvent(wxEvent&)
    [12] g_closure_invoke
    [13] g_signal_emit_valist
    [14] g_signal_emit
    [15] g_closure_invoke
    [16] g_signal_emit_valist
    [17] g_signal_emit
    [18] g_closure_invoke
    [19] g_signal_emit_valist
    [20] g_signal_emit
    [21] gtk_propagate_event
    [22] gtk_main_do_event
    [23] g_main_context_dispatch
    [24] g_main_loop_run
    [25] gtk_main
    [26] wxGUIEventLoop::DoRun()
    [27] wxEventLoopBase::Run()
    [28] wxDialog::ShowModal()
    [29] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
    [30] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
    [31] wxEvtHandler::TryHereOnly(wxEvent&)
    [32] wxEvtHandler::DoTryChain(wxEvent&)
    [33] wxEvtHandler::ProcessEvent(wxEvent&)
    [34] wxWindowBase::TryAfter(wxEvent&)
    [35] wxEvtHandler::SafelyProcessEvent(wxEvent&)
    [36] wxMenuBase::SendEvent(int, int)
    [37] g_closure_invoke
    [38] g_signal_emit_valist
    [39] g_signal_emit
    [40] gtk_widget_activate
    [41] gtk_menu_shell_activate_item
    [42] g_closure_invoke
    [43] g_signal_emit_valist
    [44] g_signal_emit
    [45] gtk_propagate_event
    [46] gtk_main_do_event
    [47] g_main_context_dispatch
    [48] g_main_loop_run
    [49] gtk_main
    [50] wxGUIEventLoop::DoRun()
    [51] wxEventLoopBase::Run()
    [52] wxAppConsoleBase::MainLoop()
    [53] wxEntry(int&, wchar_t**)
    [54] __libc_start_main
    
     
  • Teodor Petrov

    Teodor Petrov - 2018-01-02

    Are you able to reproduce this more than once? Reliably?

     
    • fenugrec

      fenugrec - 2018-01-02

      Unfortunately not. I was able to repro 2-3 times in a row when I filed the report, but not anymore. I find it strange to see cbKeyBinder in that backtrace when I wasn't in the Keyboard shortcuts menu...

       
  • Quiss

    Quiss - 2018-03-14

    Same assert failure: http://forums.codeblocks.org/index.php/topic,22489.0.html
    This happens (not every single time but less than 10 I think) when:
    - select Settings->Editor
    - Just hit Ok. (even if you do not change anything)

    Windows 10 - 1709, Tdm-gcc-5.1.0, wxWidgets 3.0.3
    Codeblocks svn 11317

    #0 0x76372cc3   KERNELBASE!DebugBreak() (C:\WINDOWS\System32\KernelBase.dll:??)
    #1 0x6a600ede   wxWindowBase::RemoveEventHandler(wxEvtHandler*) () (F:\cb\codeblocks_sf\src\devel30\wxmsw30u_gcc_custom.dll:??)
    #2 0x6b02e468   wxWindowBase::GetBackgroundColour() const::__FUNCTION__() (F:\cb\codeblocks_sf\src\devel30\wxmsw30u_gcc_custom.dll:??)
    #3 0x6b02c970   wxNumValidatorBase::sm_eventTable() (F:\cb\codeblocks_sf\src\devel30\wxmsw30u_gcc_custom.dll:??)
    #4 0x6b02d5ec   wxNumValidatorBase::sm_eventTable() (F:\cb\codeblocks_sf\src\devel30\wxmsw30u_gcc_custom.dll:??)
    #5 0x3  ?? () (??:??)
    #6 0x192ce84    ?? () (??:??)
    #7 0x6402442f   wxBinderEvtHandler::~wxBinderEvtHandler(this=0x11cde7d0, __in_chrg=<optimized out>) (F:/cb/codeblocks_sf/src/plugins/contrib/keybinder/keybinder.h:554)
    #8 0x63fd4584   wxKeyBinder::DetachAll(this=0x11993030) (F:\cb\codeblocks_sf\src\plugins\contrib\keybinder\keybinder.cpp:1374)
    #9 0x6401fe1d   wxKeyBinder::~wxKeyBinder(this=0x11993030, __in_chrg=<optimized out>) (F:/cb/codeblocks_sf/src/plugins/contrib/keybinder/keybinder.h:743)
    #10 0x64020943  wxKeyProfile::~wxKeyProfile(this=0x11993030, __in_chrg=<optimized out>) (F:/cb/codeblocks_sf/src/plugins/contrib/keybinder/keybinder.h:963)
    #11 0x640208ff  wxKeyProfile::~wxKeyProfile(this=0x11993030, __in_chrg=<optimized out>) (F:/cb/codeblocks_sf/src/plugins/contrib/keybinder/keybinder.h:963)
    #12 0x6402395a  wxKeyProfileArray::Cleanup(this=0x119c97f0) (F:/cb/codeblocks_sf/src/plugins/contrib/keybinder/keybinder.h:1097)
    #13 0x640239b9  wxKeyProfileArray::DeepCopy(this=0x119c97f0, p=...) (F:/cb/codeblocks_sf/src/plugins/contrib/keybinder/keybinder.h:1071)
    #14 0x64023e21  wxKeyProfileArray::operator=(this=0x119c97f0, tocopy=...) (F:/cb/codeblocks_sf/src/plugins/contrib/keybinder/keybinder.h:1078)
    #15 0x63fc4cef  cbKeyBinder::OnKeyConfigDialogDone(this=0xf1194e8, dlg=0x93cd7b0) (F:\cb\codeblocks_sf\src\plugins\contrib\keybinder\cbkeybinder.cpp:548)
    #16 0x63fc9c9b  MyDialog::OnApply(this=0x93cd7b0) (F:\cb\codeblocks_sf\src\plugins\contrib\keybinder\cbkeybinder.cpp:1053)
    #17 0x448d33    EditorConfigurationDlg::EndModal(this=0x192f1c4, retCode=5100) (F:\cb\codeblocks_sf\src\src\editorconfigurationdlg.cpp:1168)
    #18 0x6a4ea49e  wxDialogBase::AcceptAndClose() () (F:\cb\codeblocks_sf\src\devel30\wxmsw30u_gcc_custom.dll:??)
    #19 0x24    ?? () (??:??)
    #20 0x775b0142  ??() (C:\WINDOWS\System32\shell32.dll:??)
    #21 0x6a0832a2  wxAppConsoleBase::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&) (F:\cb\codeblocks_sf\src\devel30\wxmsw30u_gcc_custom.dll:??)
    #22 0x192e290   ?? () (??:??)
    
     

    Last edit: Quiss 2018-03-14
  • Teodor Petrov

    Teodor Petrov - 2018-03-14
    • labels: --> wx30
     
  • Robert Morin

    Robert Morin - 2018-11-02

    Hi,

    got the same problem when changing the syntax highlighting for markdown (got assert failure 5 times). I cannot reproduce it.

    Seems related to the number of changes I made in the foreground/background colors.

    svn 11499
    Build Sep 30 2018, 09:22:11 - wx3.1.1 (Windows , unicode) - 64 bit.

    Win 7 Professional, SP 1, i7-4790, 16 GB of RAM.

     
  • Andrew Cottrell

    Andrew Cottrell - 2022-04-20

    The assert may/could possibly be wxwidget related. See ticket #795 for same/similar assert which was fixed in SVN11628.

    Someone with more wxWidget knowledge should look at ticket 795 and see if the fix in that ticket also fixes the issue in this ticket.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.