Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: Danois on November 30, 2018, 02:20:12 pm

Title: Crash when typing '#include "'
Post by: Danois on November 30, 2018, 02:20:12 pm
I do not know if it is OK to post bugs here, but I do not have a SVN account, so here we go..

When typing: [RETURN]#include "

into some files, Code::Blocks shows a "Debug report" window and since crashes. The contents of the report is:

Code
<?xml version="1.0" encoding="UTF-8"?>
<report version="1.0" kind="exception">
  <system description="Linux 4.19.5-041905-generic x86_64"/>
  <modules>
    <module path="[heap]" address="563e7687a000" size="04019000"/>
    <module path="/SYSV00000000" address="7fa2b6000000" size="02000000"/>
    <module path="/SYSV00000000" address="7fa2c40f9000" size="00060000"/>
    <module path="/SYSV00000000" address="7fa2fba4b000" size="00003000"/>
    <module path="/SYSV00000000" address="7fa2fbb98000" size="00060000"/>
    <module path="[stack]" address="7ffc52012000" size="00024000"/>
    <module path="[vdso]" address="7ffc5214b000" size="00002000"/>
  </modules>
  <stack>
    <frame level="0"/>
    <frame level="1"/>
    <frame level="2"/>
    <frame level="3" function="CodeCompletion::GetLocalIncludeDirs(cbProject*, wxArrayString const&amp;)" offset="000000b3"/>
    <frame level="4" function="CodeCompletion::DoCodeCompleteIncludes(cbEditor*, int&amp;, int, std::vector&lt;cbCodeCompletionPlugin::CCToken, std::allocator&lt;cbCodeCompletionPlugin::CCToken&gt; &gt;&amp;)" offset="000004f5"/>
    <frame level="5" function="CodeCompletion::GetAutocompList(bool, cbEditor*, int&amp;, int&amp;)" offset="000003b9"/>
    <frame level="6" function="CCManager::OnCompleteCode(CodeBlocksEvent&amp;)" offset="000001f3"/>
    <frame level="7" function="Manager::ProcessEvent(CodeBlocksEvent&amp;)" offset="00000080"/>
    <frame level="8" function="CCManager::OnTimer(wxTimerEvent&amp;)" offset="000002b0"/>
    <frame level="9" function="wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&amp;, wxEvtHandler*, wxEvent&amp;)" offset="0000006e"/>
    <frame level="10" function="wxEvtHandler::SearchDynamicEventTable(wxEvent&amp;)" offset="0000006a"/>
    <frame level="11" function="wxEvtHandler::TryHereOnly(wxEvent&amp;)" offset="0000001f"/>
    <frame level="12" function="wxEvtHandler::ProcessEventLocally(wxEvent&amp;)" offset="00000033"/>
    <frame level="13" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000045"/>
    <frame level="14" function="wxEvtHandler::SafelyProcessEvent(wxEvent&amp;)" offset="00000007"/>
    <frame level="15" function="wxTimerImpl::SendEvent()" offset="00000071"/>
    <frame level="16"/>
    <frame level="17"/>
    <frame level="18" function="g_main_context_dispatch" offset="00000155"/>
    <frame level="19"/>
    <frame level="20" function="g_main_loop_run" offset="000000c2"/>
    <frame level="21" function="gtk_main" offset="000000b7"/>
    <frame level="22" function="wxGUIEventLoop::DoRun()" offset="00000025"/>
    <frame level="23" function="wxEventLoopBase::Run()" offset="00000093"/>
    <frame level="24" function="wxAppConsoleBase::MainLoop()" offset="00000056"/>
    <frame level="25"/>
    <frame level="26" function="wxEntry(int&amp;, wchar_t**)" offset="00000049"/>
    <frame level="27"/>
    <frame level="28" function="__libc_start_main" offset="000000e7"/>
    <frame level="29"/>
  </stack>
</report>

Code::Blocks has been build from the sources found here (http://sourceforge.net/projects/codeblocks/files/Sources/17.12/codeblocks_17.12.tar.xz).
Title: Re: Crash when typing '#include "'
Post by: oBFusCATed on November 30, 2018, 02:31:52 pm
What version are you using?
Is this crash reliably reproducible?
Title: Re: Crash when typing '#include "'
Post by: Danois on November 30, 2018, 02:38:32 pm
I've linked to the sources C::B was build from: 17.12 rev. 11256

It does not happen with all source files, but if it does, it is reproducible every time the sequence is typed.
Title: Re: Crash when typing '#include "'
Post by: oBFusCATed on November 30, 2018, 02:50:59 pm
Can you reproduce this if you download the latest trunk version of the source code?
Title: Re: Crash when typing '#include "'
Post by: Danois on November 30, 2018, 07:27:13 pm
I cannot test the trunk version before some time next late week. Working on project FFQueue (https://github.com/bswebdk/FFQueue) this issue happens when trying to add an include file to src/utils/FFQDebugUtils.cpp - I have had the same issue with other files, but I cannot see what the problem with the files should be.
Title: Re: Crash when typing '#include "'
Post by: Danois on November 30, 2018, 07:51:55 pm
I think I have just solved the issue :)

In the project file (*.cbp) there is a non-existing build-target (Debug_Lin_wx310 (https://github.com/bswebdk/FFQueue/blob/master/FFQueue.cbp#L318)) added to the file that causes the crash. Removing this build target with a text editor has fixed the issue. I have tried with another project which had the same ill behaviour and that project also had a deleted build-target added to some files. Dunno if this has already been fixed, but maybe C::B should remove invalid build targets from the project file when saving it.
Title: Re: Crash when typing '#include "'
Post by: oBFusCATed on November 30, 2018, 08:04:42 pm
This is still a problem in the trunk version. Thanks for reporting.
Title: Re: Crash when typing '#include "'
Post by: Danois on November 30, 2018, 08:39:02 pm
Sounds great, another bug bites the dust! :)
Title: Re: Crash when typing '#include "'
Post by: oBFusCATed on December 15, 2018, 05:22:48 pm
Fixed in trunk. Thanks for reporting.