Menu

#1552 clangd_client : fix crash on reparse

Next_Nightly
applied
pecan
Patch
2025-08-28
2025-08-27
Christo
No

On reparsing, crash is happening due to eventhandler being deleted on event handling by the same eventhandler. Backtrace is given below, we can see that same event handler dispatching event is being deleted as ProcessLanguageClient is subclass of wxEvtHandler.

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007f8f04e647f1 in __GI_abort () at abort.c:79
#2  0x00007f8f0853679b in wxFatalSignalHandler(int) () at ../src/unix/utilsunx.cpp:1522
#3  0x00007f8f057c9980 in <signal handler called> () at /lib/x86_64-linux-gnu/libpthread.so.0
#4  0x00007f8f085530f2 in wxEvtHandler::~wxEvtHandler() (this=0x6a94ba0, __in_chrg=<optimized out>) at ../src/common/event.cpp:1230
#5  0x00007f8ecdb50f09 in ProcessLanguageClient::~ProcessLanguageClient() ()
    at /home/christo/codeblocks/master-install/lib/codeblocks/plugins/libclangd_client.so
#6  0x00007f8ecda76111 in ClgdCompletion::ShutdownLSPclient(cbProject*) ()
    at /home/christo/codeblocks/master-install/lib/codeblocks/plugins/libclangd_client.so
#7  0x00007f8ecda79f16 in ClgdCompletion::OnReparseSelectedProject(wxCommandEvent&) ()
    at /home/christo/codeblocks/master-install/lib/codeblocks/plugins/libclangd_client.so
#8  0x00007f8f0841547d in wxAppConsoleBase::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const
    (this=0x17f1550, handler=0x2d610c0, func=
    (void (wxEvtHandler::*)(class wxEvtHandler * const, class wxEvent &)) 0x7f8ecda79c50 <ClgdCompletion::OnReparseSelectedProject(wxCommandEvent&)>, event=...) at ../src/common/appbase.cpp:678
#9  0x00007f8f084154f0 in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const
    (this=0x17f1550, handler=0x2d610c0, functor=..., event=...) at ../src/common/appbase.cpp:690
#10 0x00007f8f08553f64 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
    (entry=..., handler=0x2d610c0, event=...) at ../src/common/event.cpp:1482
#11 0x00007f8f08552c3c in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
    (this=0x7f8ecdbfc2c0 <ClgdCompletion::sm_eventHashTable>, event=..., self=0x2d610c0) at ../src/common/event.cpp:1087
#12 0x00007f8f0855448d in wxEvtHandler::TryHereOnly(wxEvent&) (this=0x2d610c0, event=...) at ../src/common/event.cpp:1679
#13 0x00007f8f0855b725 in wxEvtHandler::TryBeforeAndHere(wxEvent&) (this=0x2d610c0, event=...) at ../include/wx/event.h:4013
#14 0x00007f8f085541ff in wxEvtHandler::ProcessEvent(wxEvent&) (this=0x2d610c0, event=...) at ../src/common/event.cpp:1581
#15 0x00007f8f08554312 in wxEvtHandler::DoTryChain(wxEvent&) (this=0x6a94ba0, event=...) at ../src/common/event.cpp:1644
#16 0x00007f8f08554294 in wxEvtHandler::ProcessEventLocally(wxEvent&) (this=0x6a94ba0, event=...) at ../src/common/event.cpp:1612
1 Attachments

Discussion

  • pecan

    pecan - 2025-08-28

    Applied rev 13720
    Thanks

     
  • pecan

    pecan - 2025-08-28
    • status: open --> applied
    • assigned_to: pecan
    • Milestone: Undefined --> Next_Nightly
     

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.