As initially reported in the now-closed ticket https://sourceforge.net/p/codeblocks/tickets/774/#479e
When disabling the plugin "ThreadSearch", Code::Blocks consistently and repeatably crashes with a segmentation fault.
Using a debugger, the problem can be isolated to ThreadSearchViewManagerMessagesNotebook::RemoveViewFromManager() ()
, which is called by OnRelease()
.
The issue occurs in current -svn (~11530) but does not occur in 17.12 stable. If I have chance, I can attempt a similar bisection to isolate the responsible change, but that may take a while due to my not-powerful machine.
I get the same error (no crash but unexpected closing) with Windows 10 64 bits, wx3.1.2 32 bits and revision 11555.
The problem arises when reparenting the notebook page in src\plugins\contrib\ThreadSearch\ThreadSearchViewManagerMessagesNotebook.cpp
Last change to this file was done in 2013.
EDIT: wxWidgets docs state that wxNotebook::RemovePage() must be called before reparenting. The manager calls InfoPane::DeleteNonLogger() who calls DeletePage() and not RemovePage(), so m_pThreadSearchView is deleted before calling Reparent().
Last edit: Miguel Gimenez 2019-01-23
In infopane.cpp there is a RemoveNonLogger() function near the DeleteNonLogger(). This function is currently unused.
I think RemoveNonLogger() should be called when cbEVT_REMOVE_LOG_WINDOW is issued and there should be a new cbEVT_DELETE_LOG_WINDOW event for calling DeleteNonLogger(). This makes the event's name match what it realy does (removing or deleting from log).
There are only 13 uses of cbEVT_REMOVE_LOG_WINDOW that can be easiliy changed to cbEVT_DELETE_LOG_WINDOW.
I have just started a thread in the forum requesting comments for the proposed patch.
http://forums.codeblocks.org/index.php/topic,23061.0.html
After some comments in the forum this is my proposed patch; it fixes the issue adding a new event that allows removing the window from the log without deletion.
Probably a plugin rewrite would be a better solution, but the code flow is hard to follow.
This bug should be fix in master. Hopefully I've not broken something else...