Author Topic: Clang CC  (Read 255828 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Clang CC
« Reply #210 on: February 23, 2017, 08:48:26 am »
No, it has not been updated.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: Clang CC
« Reply #211 on: February 23, 2017, 09:10:15 am »
Dear Yves,

I've tried to compile this plugin on a more recent compiler. I suggest to apply the patch that is attached to:
- get rid of the deprecated auto_ptr
- simplify the singleton pattern
- fix an compiler error in non-PCH builds due to missing #include <iostream>

The patch applies to 2 files on the staging branch only: cclogger{.h/.cpp}.

I applied your patch. Thank you!

Maybe apply it also on the builltin codecompletion plugin since it has the same file?

Yves
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Clang CC
« Reply #212 on: February 27, 2017, 01:17:55 am »
Hi, your last commit seems to have fixed my previous crash.
But on project closing (like the codeblocks project file) i get sometimes this crash report:

Code
AddrPC   Params
02FEABF6 0000002E FFFFFFFF 0028BAD4  wxmsw28u_gcc_custom.dll!wxStringBase::rfind
02FED382 0000002E 00000001 0028BB64  wxmsw28u_gcc_custom.dll!wxString::Find
02FED3DB 2F772C98 0000002E 0028E488  wxmsw28u_gcc_custom.dll!wxString::AfterLast
618734B6 2F772C98 00000001 00000000  codeblocks.dll!FileTypeOf
0BA78572 2D171550 0E8AA3B0 2B0D5A50  compiler.dll!SetupIncludeDirs  [codeblocks_sf/src/plugins/compilergcc/compilerMINGWgenerator.cpp @ 55]
    53:         {
    54:             ProjectFile* f = *it;
>   55:             if (FileTypeOf(f->relativeFilename) == ftHeader &&
    56:                 f->compile)
    57:             {
6181B4CA 2AA20288 0A84315C 00000024  codeblocks.dll!CompilerCommandGenerator::Init
0BA75442 2AA20288 0028E488 00000000  compiler.dll!GetCommandGenerator  [codeblocks_sf/src/plugins/compilergcc/compilerMINGW.cpp @ 51]
    49: {
    50:     CompilerMINGWGenerator *generator = new CompilerMINGWGenerator;
>   51:     generator->Init(project);
    52:     return generator;
    53: }
0A756A6E 063E0198 2F789598 2D29D1C8  clanglib.dll!GetCompileCommand  [ClangLib/src/clangplugin.cpp @ 1186]
  1184:     if (compileCommandStr.IsEmpty())
  1185:         compileCommandStr = wxT("$options $includes");
> 1186:     CompilerCommandGenerator* gen = comp->GetCommandGenerator(proj);
  1187:     if (gen)
  1188:         gen->GenerateCommandLine(compileCommandStr, target, pf, filename,
0A757958 2D29D070 FFFFFFFC 0028C484  clanglib.dll!UpdateCompileCommand  [ClangLib/src/clangplugin.cpp @ 1262]
  1260: int ClangPlugin::UpdateCompileCommand(cbEditor* ed)
  1261: {
> 1262:     std::vector<wxString> compileCommand = GetCompileCommand( ed->GetProjectFile(), ed->GetFilename() );
  1263:
  1264:     if (compileCommand.empty())
0A753B54 0028C518 0028C484 0028C3D4  clanglib.dll!OnEditorActivate  [ClangLib/src/clangplugin.cpp @ 656]
   654:         if(m_TranslUnitId == wxNOT_FOUND)
   655:             m_TranslUnitId = GetTranslationUnitId(filename);
>  656:         UpdateCompileCommand(ed);
   657:         if (m_TranslUnitId == wxNOT_FOUND)
   658:         {
0A7B008F 0028C518 0028C418 06332D18  clanglib.dll!Call  [wxWidgets-2.8.12/include/wx/buffer.h @ 127]
   125: #endif // wxABI_VERSION >= 20804
   126:
>  127: DEFINE_BUFFER(wxCharBuffer, char, wxStrdupA);
   128: #if wxABI_VERSION >= 20804
   129: DEFINE_WRITABLE_BUFFER(wxWritableCharBuffer, wxCharBuffer, char);
6188D58E 0028C518 FFFFFFFC 0028C454  codeblocks.dll!Manager::ProcessEvent
618A321B 0028C518 FFFFFFFF 00000000  codeblocks.dll!PluginManager::NotifyPlugins
61856F4D 0028D044 2D3508C8 0028C5D4  codeblocks.dll!EditorManager::OnPageChanged
02FA1261 06331094 61856DBA FFFFFFFC  wxmsw28u_gcc_custom.dll!wxAppConsole::HandleEvent
0302436E 61C32430 06331094 0028D044  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEventIfMatches
0302443A 0028D044 06331094 030243E3  wxmsw28u_gcc_custom.dll!wxEventHashTable::HandleEvent
03024895 0028D044 06332D1C 030243E3  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
 --- repeats 16 times ---
03024829 0028D044 0028C828 030243E3  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
0A751716 0028D044 06585ED0 0028C954  clanglib.dll!ProcessEvent  [ClangLib/src/clangplugin.cpp @ 222]
   220: bool ClangPlugin::ProcessEvent( wxEvent& event )
   221: {
>  222:     if (cbPlugin::ProcessEvent(event))
   223:         return true;
   224:     for (std::vector<ClangPluginComponent*>::iterator it = m_ActiveComponentList.begin(); it != m_ActiveComponentList.end(); ++it)
03024829 0028D044 0641E648 525A6C97  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
--- repeats 54 times ---
03024829 0028D044 00000000 FEEDBAB1  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
031338F2 0028D044 05DFD9A8 0323C913  wxmsw28u_gcc_custom.dll!wxWindowBase::TryParent
03024829 0028D044 000000B3 033B31D5  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
03247331 0000002B 0028D0C4 0028D0C8  wxmsw28u_gcc_custom.dll!wxAuiNotebook::SetSelection
03247B2A 0000001E 0028D168 033B9FCC  wxmsw28u_gcc_custom.dll!wxAuiNotebook::RemovePage
03247BC3 0000001E 2D3508C8 0028D1E0  wxmsw28u_gcc_custom.dll!wxAuiNotebook::DeletePage
617C7E84 0000001E 00000003 2CC706A4  codeblocks.dll!cbAuiNotebook::DeletePage
618531BA 2D3508C8 00000001 0028D1C4  codeblocks.dll!EditorManager::Close
61853140 0028D22C 00000001 0028D224  codeblocks.dll!EditorManager::Close
617F27E4 00000001 00000000 00000000  codeblocks.dll!cbProject::CloseAllFiles
618C1F53 2AA20288 00000000 00000001  codeblocks.dll!ProjectManager::CloseProject
0049091E 0028DF84 0000000D 0000001A  codeblocks.exe!ProjectManagerUI::OnCloseProject
02FA1261 05ECBAE8 004906FC 00000000  wxmsw28u_gcc_custom.dll!wxAppConsole::HandleEvent
0302436E 00590460 05ECBAE8 0028DF84  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEventIfMatches
0302443A 0028DF84 05ECBAE8 0028D4E4  wxmsw28u_gcc_custom.dll!wxEventHashTable::HandleEvent
03024895 0028DF84 05E18F48 0028D504  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
 --- repeats 16 times ---
03024829 0028DF84 00000000 0028D724  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
0A751716 0028DF84 06585ED0 00000040  clanglib.dll!ProcessEvent  [ClangLib/src/clangplugin.cpp @ 222]
   220: bool ClangPlugin::ProcessEvent( wxEvent& event )
   221: {
>  222:     if (cbPlugin::ProcessEvent(event))
   223:         return true;
   224:     for (std::vector<ClangPluginComponent*>::iterator it = m_ActiveComponentList.begin(); it != m_ActiveComponentList.end(); ++it)
03024829 0028DF84 0641E648 0028D784  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
--- repeats 53 times ---
03024829 0028DF84 00000000 FEEDBAB1  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
031338F2 0028DF84 062EDBD8 FEEDBAB1  wxmsw28u_gcc_custom.dll!wxWindowBase::TryParent
03024829 0028DF84 04102D6C 2F7B7CB0  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
031338F2 0028DF84 00000366 00000084  wxmsw28u_gcc_custom.dll!wxWindowBase::TryParent
0310DA81 00000366 00000000 00000000  wxmsw28u_gcc_custom.dll!wxMenuBase::SendEvent
0309A32B 00000000 00000366 00000000  wxmsw28u_gcc_custom.dll!wxMenu::MSWCommand
0306DAB0 00000366 00000000 00000000  wxmsw28u_gcc_custom.dll!wxWindow::HandleCommand
0307134C 00000111 00000366 00000000  wxmsw28u_gcc_custom.dll!wxWindow::MSWWindowProc
030BF047 00000111 00000366 00000000  wxmsw28u_gcc_custom.dll!wxTreeCtrl::MSWWindowProc
0306ADAE 00040AA8 00000111 00000366  wxmsw28u_gcc_custom.dll!wxWndProc
770E62FA 0306AD60 00040AA8 00000111  USER32.dll!_InternalCallWinProc@20
770E6D3A 00000000 0306AD60 00040AA8  USER32.dll!_UserCallWinProcCheckWow@32
770E77C4 0306AD60 00000000 0028E588  USER32.dll!_DispatchMessageWorker@8
770E788A 0028E554 00000000 00000111  USER32.dll!_DispatchMessageW@4
0306FBB9 0028E664 0000007E 00000066  wxmsw28u_gcc_custom.dll!wxWindow::DoPopupMenu
004F7C06 0028E664 0028E8B8 0028E800  codeblocks.exe!wxWindowBase::PopupMenu
0048AC05 2E0A2378 0028E8B8 00770020  codeblocks.exe!ProjectManagerUI::ShowMenu
0048DB76 0028F468 00000000 00000000  codeblocks.exe!ProjectManagerUI::OnTreeItemRightClick
02FA1261 05ECBAE8 0048DAD2 00000000  wxmsw28u_gcc_custom.dll!wxAppConsole::HandleEvent
0302436E 00590178 05ECBAE8 0028F468  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEventIfMatches
0302443A 0028F468 05ECBAE8 00000000  wxmsw28u_gcc_custom.dll!wxEventHashTable::HandleEvent
03024895 0028F468 05E18F48 00000000  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
--- repeats 16 times ---
03024829 0028F468 00000000 00000000  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
0A751716 0028F468 06585ED0 2FD76F80  clanglib.dll!ProcessEvent  [ClangLib/src/clangplugin.cpp @ 222]
   220: bool ClangPlugin::ProcessEvent( wxEvent& event )
   221: {
>  222:     if (cbPlugin::ProcessEvent(event))
   223:         return true;
   224:     for (std::vector<ClangPluginComponent*>::iterator it = m_ActiveComponentList.begin(); it != m_ActiveComponentList.end(); ++it)
03024829 0028F468 0641E648 6DBFBC4E  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
---- repeats 54 times -----
03024829 0028F468 00000000 FEEDBAB1  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
031338F2 0028F468 062EDBD8 0028F3B8  wxmsw28u_gcc_custom.dll!wxWindowBase::TryParent
03024829 0028F468 770E965E 00000014  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
031338F2 0028F468 00001111 00000000  wxmsw28u_gcc_custom.dll!wxWindowBase::TryParent
030BDF15 00000361 0028F968 0028F618  wxmsw28u_gcc_custom.dll!wxTreeCtrl::MSWOnNotify
0307240C 0000004E 00000361 0028F968  wxmsw28u_gcc_custom.dll!wxWindow::MSWWindowProc
0306ADAE 00090BAE 0000004E 00000361  wxmsw28u_gcc_custom.dll!wxWndProc
770E62FA 0306AD60 00090BAE 0000004E  USER32.dll!_InternalCallWinProc@20
770E6D3A 00000000 0306AD60 00090BAE  USER32.dll!_UserCallWinProcCheckWow@32
770E965E 04512E20 00000000 0306AD60  USER32.dll!_SendMessageWorker@24
770E96C5 00090BAE 0000004E 00000361  USER32.dll!_SendMessageW@16
030BFBE4 00000204 00000002 0066007E  wxmsw28u_gcc_custom.dll!wxTreeCtrl::MSWWindowProc
0306ADAE 00040AA8 00000204 00000002  wxmsw28u_gcc_custom.dll!wxWndProc
770E62FA 0306AD60 00040AA8 00000204  USER32.dll!_InternalCallWinProc@20
770E6D3A 00000000 0306AD60 00040AA8  USER32.dll!_UserCallWinProcCheckWow@32
770E77C4 0306AD60 00000000 0028FBE8  USER32.dll!_DispatchMessageWorker@8
770E788A 0028FBC4 00000000 00000000  USER32.dll!_DispatchMessageW@4
0304FAEF 2A7D0B58 00000001 0028FD40  wxmsw28u_gcc_custom.dll!wxEventLoop::Dispatch

seems to be a recursive loop? Hope this helps.
greetings keep up the good work!!!

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: Clang CC
« Reply #213 on: February 27, 2017, 07:06:00 am »
>   55:             if (FileTypeOf(f->relativeFilename) == ftHeader &&
I would also verify "f"not being NULL:
if (f && FileTypeOf(f->relativeFilename) == ftHeader &&
...especially on shut-down.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Clang CC
« Reply #214 on: February 27, 2017, 08:51:19 am »
And reversing the conditions speeds things quite a bit. :)
Checking f->compile is quite a lot faster than calling FileTypeOf and most of the times it is false.
This change will land in master/head soon.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Clang CC
« Reply #215 on: March 01, 2017, 05:01:06 pm »
And an other crash report:
Code
77B9E49B 2B27A350 0ABEF9C0 0FBA7650  ntdll.dll!0x2e49b
77B9E0A3 040C0000 00000000 2B27A350  ntdll.dll!_RtlFreeHeap@12
754C98CD 2B27A350 2B27A350 0004F980  msvcrt.dll!_free
033C793D 2DDE13EC 034FDDAC FFFFFFFF  wxmsw28u_gcc_custom.dll!wxWCharBuffer::~wxWCharBuffer
0A3039BF 0ABEF928 2DDE13EC 7FCE500D  clanglib.dll!FromUTF8  [wxWidgets-2.8.12/include/wx/buffer.h @ 127]
   125: #endif // wxABI_VERSION >= 20804
   126:
>  127: DEFINE_BUFFER(wxCharBuffer, char, wxStrdupA);
   128: #if wxABI_VERSION >= 20804
   129: DEFINE_WRITABLE_BUFFER(wxWritableCharBuffer, wxCharBuffer, char);
0A2C834E 2EA192D8 0ABEFA2C 00000001  clanglib.dll!UpdateIncludeDiagnosticsVisitor  [ClangLib/src/translationunit.cpp @ 630]
   628:
   629:     str = clang_getFileName(included_file);
>  630:     wxString includedFileName = wxString::FromUTF8(clang_getCString(str));
   631:     clang_disposeString(str);
   632:     if (data->errorIncludes.find( includedFileName ) != data->errorIncludes.end())
« Last Edit: March 01, 2017, 06:07:34 pm by BlueHazzard »

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: Clang CC
« Reply #216 on: March 06, 2017, 06:24:27 am »
>   55:             if (FileTypeOf(f->relativeFilename) == ftHeader &&
I would also verify "f"not being NULL:
if (f && FileTypeOf(f->relativeFilename) == ftHeader &&
...especially on shut-down.

Sorry this is in compiler.dll and not in the clanglib plugin.

Yves
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: Clang CC
« Reply #217 on: March 07, 2017, 02:15:09 pm »
And an other crash report:
Code
77B9E49B 2B27A350 0ABEF9C0 0FBA7650  ntdll.dll!0x2e49b
77B9E0A3 040C0000 00000000 2B27A350  ntdll.dll!_RtlFreeHeap@12
754C98CD 2B27A350 2B27A350 0004F980  msvcrt.dll!_free
033C793D 2DDE13EC 034FDDAC FFFFFFFF  wxmsw28u_gcc_custom.dll!wxWCharBuffer::~wxWCharBuffer
0A3039BF 0ABEF928 2DDE13EC 7FCE500D  clanglib.dll!FromUTF8  [wxWidgets-2.8.12/include/wx/buffer.h @ 127]
   125: #endif // wxABI_VERSION >= 20804
   126:
>  127: DEFINE_BUFFER(wxCharBuffer, char, wxStrdupA);
   128: #if wxABI_VERSION >= 20804
   129: DEFINE_WRITABLE_BUFFER(wxWritableCharBuffer, wxCharBuffer, char);
0A2C834E 2EA192D8 0ABEFA2C 00000001  clanglib.dll!UpdateIncludeDiagnosticsVisitor  [ClangLib/src/translationunit.cpp @ 630]
   628:
   629:     str = clang_getFileName(included_file);
>  630:     wxString includedFileName = wxString::FromUTF8(clang_getCString(str));
   631:     clang_disposeString(str);
   632:     if (data->errorIncludes.find( includedFileName ) != data->errorIncludes.end())

I wrote a little sikuliscript to reproduce this issue by continuously opening and closing projects and the same trace as you show here is there on a CentOS7 system. I think the problem comes from the fact that wxString is not thread safe since it is doing a double free of the wxString data and I pass these wxString objects between threads. Normally I try to keep these wxString objects created&destroyed on the same thread or deep-copied if they need to be handed over from one thread to another. It's probably better if I switch to std::string for anything that crosses these threads and force c++11 to assure thread-safety. I'll make a POC and see if that improves reliability.

Yves
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6036
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Clang CC
« Reply #218 on: March 07, 2017, 02:52:50 pm »
It's probably better if I switch to std::string for anything that crosses these threads and force c++11 to assure thread-safety. I'll make a POC and see if that improves reliability.
wxString in wxWidgets 2.8.12 is not thread safe, and it should be thread safe in wxWidgets 3.0+, because it use std::string, and std::string is atomic reference counted.  There is same issue in the native CC, and it's hard to solve unless we move to wx3.0+.

What does POC mean?  Prove of Concept?
« Last Edit: March 07, 2017, 03:13:15 pm by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Clang CC
« Reply #219 on: March 07, 2017, 03:17:56 pm »
Hi, sorry i forget to answer and report my findings:

Code
77B9E0A3 040C0000 00000000 2B27A350  ntdll.dll!_RtlFreeHeap@12
754C98CD 2B27A350 2B27A350 0004F980  msvcrt.dll!_free
033C793D 2DDE13EC 034FDDAC FFFFFFFF  wxmsw28u_gcc_custom.dll!wxWCharBuffer::~wxWCharBuffer
0A3039BF 0ABEF928 2DDE13EC 7FCE500D  clanglib.dll!FromUTF8  [wxWidgets-2.8.12/include/wx/buffer.h @ 127]
   125: #endif // wxABI_VERSION >= 20804
   126:
>  127: DEFINE_BUFFER(wxCharBuffer, char, wxStrdupA);
   128: #if wxABI_VERSION >= 20804
   129: DEFINE_WRITABLE_BUFFER(wxWritableCharBuffer, wxCharBuffer, char);
0A2C834E 2EA192D8 0ABEFA2C 00000001  clanglib.dll!UpdateIncludeDiagnosticsVisitor  [ClangLib/src/translationunit.cpp @ 630]
   628:
   629:     str = clang_getFileName(included_file);
>  630:     wxString includedFileName = wxString::FromUTF8(clang_getCString(str));
   631:     clang_disposeString(str);
   632:     if (data->errorIncludes.find( includedFileName ) != data->errorIncludes.end())
about this crash: I replaced the function
Code
wxString::FromUTF8(clang_getCString(str))
with (pseudocode, have the actual code at home)
Code
wxString clang_to_wxString(clangstring* str)
{
if(str == nullptr)
return wxEmptyString;
else
return wxString::FromUTF8(clang_getCString(str));
}

and i have no crashes with this bt so far, but i tested it not that much.

« Last Edit: March 07, 2017, 03:26:19 pm by BlueHazzard »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Clang CC
« Reply #220 on: March 07, 2017, 03:23:00 pm »
regarding this crash:
Quote
Quote from: MortenMacFly on 27-02-2017, 07:06:00

    Quote from: BlueHazzard on 27-02-2017, 01:17:55

        >   55:             if (FileTypeOf(f->relativeFilename) == ftHeader &&

    I would also verify "f"not being NULL:
    if (f && FileTypeOf(f->relativeFilename) == ftHeader &&
    ...especially on shut-down.


Sorry this is in compiler.dll and not in the clanglib plugin.
with the bt:
Code
AddrPC   Params
02FEABF6 0000002E FFFFFFFF 0028BAD4  wxmsw28u_gcc_custom.dll!wxStringBase::rfind
02FED382 0000002E 00000001 0028BB64  wxmsw28u_gcc_custom.dll!wxString::Find
02FED3DB 2F772C98 0000002E 0028E488  wxmsw28u_gcc_custom.dll!wxString::AfterLast
618734B6 2F772C98 00000001 00000000  codeblocks.dll!FileTypeOf
0BA78572 2D171550 0E8AA3B0 2B0D5A50  compiler.dll!SetupIncludeDirs  [codeblocks_sf/src/plugins/compilergcc/compilerMINGWgenerator.cpp @ 55]
    53:         {
    54:             ProjectFile* f = *it;
>   55:             if (FileTypeOf(f->relativeFilename) == ftHeader &&
    56:                 f->compile)
    57:             {
6181B4CA 2AA20288 0A84315C 00000024  codeblocks.dll!CompilerCommandGenerator::Init
0BA75442 2AA20288 0028E488 00000000  compiler.dll!GetCommandGenerator  [codeblocks_sf/src/plugins/compilergcc/compilerMINGW.cpp @ 51]
    49: {
    50:     CompilerMINGWGenerator *generator = new CompilerMINGWGenerator;
>   51:     generator->Init(project);
    52:     return generator;
    53: }
0A756A6E 063E0198 2F789598 2D29D1C8  clanglib.dll!GetCompileCommand  [ClangLib/src/clangplugin.cpp @ 1186]
  1184:     if (compileCommandStr.IsEmpty())
  1185:         compileCommandStr = wxT("$options $includes");
> 1186:     CompilerCommandGenerator* gen = comp->GetCommandGenerator(proj);
  1187:     if (gen)
  1188:         gen->GenerateCommandLine(compileCommandStr, target, pf, filename,
0A757958 2D29D070 FFFFFFFC 0028C484  clanglib.dll!UpdateCompileCommand  [ClangLib/src/clangplugin.cpp @ 1262]
  1260: int ClangPlugin::UpdateCompileCommand(cbEditor* ed)
  1261: {
> 1262:     std::vector<wxString> compileCommand = GetCompileCommand( ed->GetProjectFile(), ed->GetFilename() );
  1263:
  1264:     if (compileCommand.empty())
0A753B54 0028C518 0028C484 0028C3D4  clanglib.dll!OnEditorActivate  [ClangLib/src/clangplugin.cpp @ 656]
   654:         if(m_TranslUnitId == wxNOT_FOUND)
   655:             m_TranslUnitId = GetTranslationUnitId(filename);
>  656:         UpdateCompileCommand(ed);
   657:         if (m_TranslUnitId == wxNOT_FOUND)
   658:         {
0A7B008F 0028C518 0028C418 06332D18  clanglib.dll!Call  [wxWidgets-2.8.12/include/wx/buffer.h @ 127]
   125: #endif // wxABI_VERSION >= 20804
   126:
>  127: DEFINE_BUFFER(wxCharBuffer, char, wxStrdupA);
   128: #if wxABI_VERSION >= 20804
   129: DEFINE_WRITABLE_BUFFER(wxWritableCharBuffer, wxCharBuffer, char);
6188D58E 0028C518 FFFFFFFC 0028C454  codeblocks.dll!Manager::ProcessEvent
618A321B 0028C518 FFFFFFFF 00000000  codeblocks.dll!PluginManager::NotifyPlugins
61856F4D 0028D044 2D3508C8 0028C5D4  codeblocks.dll!EditorManager::OnPageChanged
02FA1261 06331094 61856DBA FFFFFFFC  wxmsw28u_gcc_custom.dll!wxAppConsole::HandleEvent
0302436E 61C32430 06331094 0028D044  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEventIfMatches
0302443A 0028D044 06331094 030243E3  wxmsw28u_gcc_custom.dll!wxEventHashTable::HandleEvent
03024895 0028D044 06332D1C 030243E3  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
 --- repeats 16 times ---
03024829 0028D044 0028C828 030243E3  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
0A751716 0028D044 06585ED0 0028C954  clanglib.dll!ProcessEvent  [ClangLib/src/clangplugin.cpp @ 222]
   220: bool ClangPlugin::ProcessEvent( wxEvent& event )
   221: {
>  222:     if (cbPlugin::ProcessEvent(event))
   223:         return true;
   224:     for (std::vector<ClangPluginComponent*>::iterator it = m_ActiveComponentList.begin(); it != m_ActiveComponentList.end(); ++it)
03024829 0028D044 0641E648 525A6C97  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
--- repeats 54 times ---
03024829 0028D044 00000000 FEEDBAB1  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
031338F2 0028D044 05DFD9A8 0323C913  wxmsw28u_gcc_custom.dll!wxWindowBase::TryParent
03024829 0028D044 000000B3 033B31D5  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
03247331 0000002B 0028D0C4 0028D0C8  wxmsw28u_gcc_custom.dll!wxAuiNotebook::SetSelection
03247B2A 0000001E 0028D168 033B9FCC  wxmsw28u_gcc_custom.dll!wxAuiNotebook::RemovePage
03247BC3 0000001E 2D3508C8 0028D1E0  wxmsw28u_gcc_custom.dll!wxAuiNotebook::DeletePage
617C7E84 0000001E 00000003 2CC706A4  codeblocks.dll!cbAuiNotebook::DeletePage
618531BA 2D3508C8 00000001 0028D1C4  codeblocks.dll!EditorManager::Close
61853140 0028D22C 00000001 0028D224  codeblocks.dll!EditorManager::Close
617F27E4 00000001 00000000 00000000  codeblocks.dll!cbProject::CloseAllFiles
618C1F53 2AA20288 00000000 00000001  codeblocks.dll!ProjectManager::CloseProject
0049091E 0028DF84 0000000D 0000001A  codeblocks.exe!ProjectManagerUI::OnCloseProject
02FA1261 05ECBAE8 004906FC 00000000  wxmsw28u_gcc_custom.dll!wxAppConsole::HandleEvent
0302436E 00590460 05ECBAE8 0028DF84  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEventIfMatches
0302443A 0028DF84 05ECBAE8 0028D4E4  wxmsw28u_gcc_custom.dll!wxEventHashTable::HandleEvent
03024895 0028DF84 05E18F48 0028D504  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
 --- repeats 16 times ---
03024829 0028DF84 00000000 0028D724  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
0A751716 0028DF84 06585ED0 00000040  clanglib.dll!ProcessEvent  [ClangLib/src/clangplugin.cpp @ 222]
   220: bool ClangPlugin::ProcessEvent( wxEvent& event )
   221: {
>  222:     if (cbPlugin::ProcessEvent(event))
   223:         return true;
   224:     for (std::vector<ClangPluginComponent*>::iterator it = m_ActiveComponentList.begin(); it != m_ActiveComponentList.end(); ++it)
03024829 0028DF84 0641E648 0028D784  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
--- repeats 53 times ---
03024829 0028DF84 00000000 FEEDBAB1  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
031338F2 0028DF84 062EDBD8 FEEDBAB1  wxmsw28u_gcc_custom.dll!wxWindowBase::TryParent
03024829 0028DF84 04102D6C 2F7B7CB0  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
031338F2 0028DF84 00000366 00000084  wxmsw28u_gcc_custom.dll!wxWindowBase::TryParent
0310DA81 00000366 00000000 00000000  wxmsw28u_gcc_custom.dll!wxMenuBase::SendEvent
0309A32B 00000000 00000366 00000000  wxmsw28u_gcc_custom.dll!wxMenu::MSWCommand
0306DAB0 00000366 00000000 00000000  wxmsw28u_gcc_custom.dll!wxWindow::HandleCommand
0307134C 00000111 00000366 00000000  wxmsw28u_gcc_custom.dll!wxWindow::MSWWindowProc
030BF047 00000111 00000366 00000000  wxmsw28u_gcc_custom.dll!wxTreeCtrl::MSWWindowProc
0306ADAE 00040AA8 00000111 00000366  wxmsw28u_gcc_custom.dll!wxWndProc
770E62FA 0306AD60 00040AA8 00000111  USER32.dll!_InternalCallWinProc@20
770E6D3A 00000000 0306AD60 00040AA8  USER32.dll!_UserCallWinProcCheckWow@32
770E77C4 0306AD60 00000000 0028E588  USER32.dll!_DispatchMessageWorker@8
770E788A 0028E554 00000000 00000111  USER32.dll!_DispatchMessageW@4
0306FBB9 0028E664 0000007E 00000066  wxmsw28u_gcc_custom.dll!wxWindow::DoPopupMenu
004F7C06 0028E664 0028E8B8 0028E800  codeblocks.exe!wxWindowBase::PopupMenu
0048AC05 2E0A2378 0028E8B8 00770020  codeblocks.exe!ProjectManagerUI::ShowMenu
0048DB76 0028F468 00000000 00000000  codeblocks.exe!ProjectManagerUI::OnTreeItemRightClick
02FA1261 05ECBAE8 0048DAD2 00000000  wxmsw28u_gcc_custom.dll!wxAppConsole::HandleEvent
0302436E 00590178 05ECBAE8 0028F468  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEventIfMatches
0302443A 0028F468 05ECBAE8 00000000  wxmsw28u_gcc_custom.dll!wxEventHashTable::HandleEvent
03024895 0028F468 05E18F48 00000000  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
--- repeats 16 times ---
03024829 0028F468 00000000 00000000  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
0A751716 0028F468 06585ED0 2FD76F80  clanglib.dll!ProcessEvent  [ClangLib/src/clangplugin.cpp @ 222]
   220: bool ClangPlugin::ProcessEvent( wxEvent& event )
   221: {
>  222:     if (cbPlugin::ProcessEvent(event))
   223:         return true;
   224:     for (std::vector<ClangPluginComponent*>::iterator it = m_ActiveComponentList.begin(); it != m_ActiveComponentList.end(); ++it)
03024829 0028F468 0641E648 6DBFBC4E  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
---- repeats 54 times -----
03024829 0028F468 00000000 FEEDBAB1  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
031338F2 0028F468 062EDBD8 0028F3B8  wxmsw28u_gcc_custom.dll!wxWindowBase::TryParent
03024829 0028F468 770E965E 00000014  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
031338F2 0028F468 00001111 00000000  wxmsw28u_gcc_custom.dll!wxWindowBase::TryParent
030BDF15 00000361 0028F968 0028F618  wxmsw28u_gcc_custom.dll!wxTreeCtrl::MSWOnNotify
0307240C 0000004E 00000361 0028F968  wxmsw28u_gcc_custom.dll!wxWindow::MSWWindowProc
0306ADAE 00090BAE 0000004E 00000361  wxmsw28u_gcc_custom.dll!wxWndProc
770E62FA 0306AD60 00090BAE 0000004E  USER32.dll!_InternalCallWinProc@20
770E6D3A 00000000 0306AD60 00090BAE  USER32.dll!_UserCallWinProcCheckWow@32
770E965E 04512E20 00000000 0306AD60  USER32.dll!_SendMessageWorker@24
770E96C5 00090BAE 0000004E 00000361  USER32.dll!_SendMessageW@16
030BFBE4 00000204 00000002 0066007E  wxmsw28u_gcc_custom.dll!wxTreeCtrl::MSWWindowProc
0306ADAE 00040AA8 00000204 00000002  wxmsw28u_gcc_custom.dll!wxWndProc
770E62FA 0306AD60 00040AA8 00000204  USER32.dll!_InternalCallWinProc@20
770E6D3A 00000000 0306AD60 00040AA8  USER32.dll!_UserCallWinProcCheckWow@32
770E77C4 0306AD60 00000000 0028FBE8  USER32.dll!_DispatchMessageWorker@8
770E788A 0028FBC4 00000000 00000000  USER32.dll!_DispatchMessageW@4
0304FAEF 2A7D0B58 00000001 0028FD40  wxmsw28u_gcc_custom.dll!wxEventLoop::Dispatch

you will note that this is a stack overflow crash. And the stack is nearly 210 calls in the clang library. Actually it is in the event handling code of wx 210 calls. So i think there is somewhere a recursive event loop. So this is a clang problem.
I am not this familiar with the event system so i didn't looked over it to much...
This is underlined by this messages from the bt I think this is a clang problem because of this returning bt information:
Code
0A751716 0028F468 06585ED0 2FD76F80  clanglib.dll!ProcessEvent  [ClangLib/src/clangplugin.cpp @ 222]
   220: bool ClangPlugin::ProcessEvent( wxEvent& event )
   221: {
>  222:     if (cbPlugin::ProcessEvent(event))
   223:         return true;
   224:     for (std::vector<ClangPluginComponent*>::iterator it = m_ActiveComponentList.begin(); it != m_ActiveComponentList.end(); ++it)
[Edit:] correcting the hypothesis
« Last Edit: March 07, 2017, 03:31:00 pm by BlueHazzard »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Clang CC
« Reply #221 on: March 07, 2017, 03:30:07 pm »
A other problem i noted quite frequently is if you open a new cpp file, enter code at the end of the file (no line text after the last line code) and this code has errors, so they get reported by the instant error reporting wxScilite will report some error about writing past the buffer, or writing non printable characters or something like this. I am actively investigating in this if i find some time.
This is no crash, but a assert()

I don't recall how i can reproduce this, but i will report as soon i am able to reproduce it...

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: Clang CC
« Reply #222 on: March 07, 2017, 03:48:33 pm »
It's probably better if I switch to std::string for anything that crosses these threads and force c++11 to assure thread-safety. I'll make a POC and see if that improves reliability.
wxString in wxWidgets 2.8.12 is not thread safe, and it should be thread safe in wxWidgets 3.0+, because it use std::string, and std::string is atomic reference counted.  There is same issue in the native CC, and it's hard to solve unless we move to wx3.0+.

What does POC mean?  Prove of Concept?
Yes, Prove of Concept, I adapt some operations that are used in the project load&unload scenario that I was using and see if this specific problem is fixed.

Yves
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: Clang CC
« Reply #223 on: March 07, 2017, 03:52:23 pm »
A other problem i noted quite frequently is if you open a new cpp file, enter code at the end of the file (no line text after the last line code) and this code has errors, so they get reported by the instant error reporting wxScilite will report some error about writing past the buffer, or writing non printable characters or something like this. I am actively investigating in this if i find some time.
This is no crash, but a assert()

I don't recall how i can reproduce this, but i will report as soon i am able to reproduce it...
Sounds familiar, I fixed something similar in the past, but it was only reproducible on Windows. Sadly I don't test it often on Windows. It's hard enough as it is to test on wx28, wx30, ubuntu, centos, ...

Yves
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: Clang CC
« Reply #224 on: March 07, 2017, 09:15:47 pm »
regarding this crash:
Quote
Quote from: MortenMacFly on 27-02-2017, 07:06:00

    Quote from: BlueHazzard on 27-02-2017, 01:17:55

        >   55:             if (FileTypeOf(f->relativeFilename) == ftHeader &&

    I would also verify "f"not being NULL:
    if (f && FileTypeOf(f->relativeFilename) == ftHeader &&
    ...especially on shut-down.


Sorry this is in compiler.dll and not in the clanglib plugin.
with the bt:
Code
AddrPC   Params
02FEABF6 0000002E FFFFFFFF 0028BAD4  wxmsw28u_gcc_custom.dll!wxStringBase::rfind
02FED382 0000002E 00000001 0028BB64  wxmsw28u_gcc_custom.dll!wxString::Find
02FED3DB 2F772C98 0000002E 0028E488  wxmsw28u_gcc_custom.dll!wxString::AfterLast
618734B6 2F772C98 00000001 00000000  codeblocks.dll!FileTypeOf
0BA78572 2D171550 0E8AA3B0 2B0D5A50  compiler.dll!SetupIncludeDirs  [codeblocks_sf/src/plugins/compilergcc/compilerMINGWgenerator.cpp @ 55]
    53:         {
    54:             ProjectFile* f = *it;
>   55:             if (FileTypeOf(f->relativeFilename) == ftHeader &&
    56:                 f->compile)
    57:             {
6181B4CA 2AA20288 0A84315C 00000024  codeblocks.dll!CompilerCommandGenerator::Init
0BA75442 2AA20288 0028E488 00000000  compiler.dll!GetCommandGenerator  [codeblocks_sf/src/plugins/compilergcc/compilerMINGW.cpp @ 51]
    49: {
    50:     CompilerMINGWGenerator *generator = new CompilerMINGWGenerator;
>   51:     generator->Init(project);
    52:     return generator;
    53: }
0A756A6E 063E0198 2F789598 2D29D1C8  clanglib.dll!GetCompileCommand  [ClangLib/src/clangplugin.cpp @ 1186]
  1184:     if (compileCommandStr.IsEmpty())
  1185:         compileCommandStr = wxT("$options $includes");
> 1186:     CompilerCommandGenerator* gen = comp->GetCommandGenerator(proj);
  1187:     if (gen)
  1188:         gen->GenerateCommandLine(compileCommandStr, target, pf, filename,
0A757958 2D29D070 FFFFFFFC 0028C484  clanglib.dll!UpdateCompileCommand  [ClangLib/src/clangplugin.cpp @ 1262]
  1260: int ClangPlugin::UpdateCompileCommand(cbEditor* ed)
  1261: {
> 1262:     std::vector<wxString> compileCommand = GetCompileCommand( ed->GetProjectFile(), ed->GetFilename() );
  1263:
  1264:     if (compileCommand.empty())
0A753B54 0028C518 0028C484 0028C3D4  clanglib.dll!OnEditorActivate  [ClangLib/src/clangplugin.cpp @ 656]
   654:         if(m_TranslUnitId == wxNOT_FOUND)
   655:             m_TranslUnitId = GetTranslationUnitId(filename);
>  656:         UpdateCompileCommand(ed);
   657:         if (m_TranslUnitId == wxNOT_FOUND)
   658:         {
0A7B008F 0028C518 0028C418 06332D18  clanglib.dll!Call  [wxWidgets-2.8.12/include/wx/buffer.h @ 127]
   125: #endif // wxABI_VERSION >= 20804
   126:
>  127: DEFINE_BUFFER(wxCharBuffer, char, wxStrdupA);
   128: #if wxABI_VERSION >= 20804
   129: DEFINE_WRITABLE_BUFFER(wxWritableCharBuffer, wxCharBuffer, char);
6188D58E 0028C518 FFFFFFFC 0028C454  codeblocks.dll!Manager::ProcessEvent
618A321B 0028C518 FFFFFFFF 00000000  codeblocks.dll!PluginManager::NotifyPlugins
61856F4D 0028D044 2D3508C8 0028C5D4  codeblocks.dll!EditorManager::OnPageChanged
02FA1261 06331094 61856DBA FFFFFFFC  wxmsw28u_gcc_custom.dll!wxAppConsole::HandleEvent
0302436E 61C32430 06331094 0028D044  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEventIfMatches
0302443A 0028D044 06331094 030243E3  wxmsw28u_gcc_custom.dll!wxEventHashTable::HandleEvent
03024895 0028D044 06332D1C 030243E3  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
 --- repeats 16 times ---
03024829 0028D044 0028C828 030243E3  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
0A751716 0028D044 06585ED0 0028C954  clanglib.dll!ProcessEvent  [ClangLib/src/clangplugin.cpp @ 222]
   220: bool ClangPlugin::ProcessEvent( wxEvent& event )
   221: {
>  222:     if (cbPlugin::ProcessEvent(event))
   223:         return true;
   224:     for (std::vector<ClangPluginComponent*>::iterator it = m_ActiveComponentList.begin(); it != m_ActiveComponentList.end(); ++it)
03024829 0028D044 0641E648 525A6C97  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
--- repeats 54 times ---
03024829 0028D044 00000000 FEEDBAB1  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
031338F2 0028D044 05DFD9A8 0323C913  wxmsw28u_gcc_custom.dll!wxWindowBase::TryParent
03024829 0028D044 000000B3 033B31D5  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
03247331 0000002B 0028D0C4 0028D0C8  wxmsw28u_gcc_custom.dll!wxAuiNotebook::SetSelection
03247B2A 0000001E 0028D168 033B9FCC  wxmsw28u_gcc_custom.dll!wxAuiNotebook::RemovePage
03247BC3 0000001E 2D3508C8 0028D1E0  wxmsw28u_gcc_custom.dll!wxAuiNotebook::DeletePage
617C7E84 0000001E 00000003 2CC706A4  codeblocks.dll!cbAuiNotebook::DeletePage
618531BA 2D3508C8 00000001 0028D1C4  codeblocks.dll!EditorManager::Close
61853140 0028D22C 00000001 0028D224  codeblocks.dll!EditorManager::Close
617F27E4 00000001 00000000 00000000  codeblocks.dll!cbProject::CloseAllFiles
618C1F53 2AA20288 00000000 00000001  codeblocks.dll!ProjectManager::CloseProject
0049091E 0028DF84 0000000D 0000001A  codeblocks.exe!ProjectManagerUI::OnCloseProject
02FA1261 05ECBAE8 004906FC 00000000  wxmsw28u_gcc_custom.dll!wxAppConsole::HandleEvent
0302436E 00590460 05ECBAE8 0028DF84  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEventIfMatches
0302443A 0028DF84 05ECBAE8 0028D4E4  wxmsw28u_gcc_custom.dll!wxEventHashTable::HandleEvent
03024895 0028DF84 05E18F48 0028D504  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
 --- repeats 16 times ---
03024829 0028DF84 00000000 0028D724  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
0A751716 0028DF84 06585ED0 00000040  clanglib.dll!ProcessEvent  [ClangLib/src/clangplugin.cpp @ 222]
   220: bool ClangPlugin::ProcessEvent( wxEvent& event )
   221: {
>  222:     if (cbPlugin::ProcessEvent(event))
   223:         return true;
   224:     for (std::vector<ClangPluginComponent*>::iterator it = m_ActiveComponentList.begin(); it != m_ActiveComponentList.end(); ++it)
03024829 0028DF84 0641E648 0028D784  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
--- repeats 53 times ---
03024829 0028DF84 00000000 FEEDBAB1  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
031338F2 0028DF84 062EDBD8 FEEDBAB1  wxmsw28u_gcc_custom.dll!wxWindowBase::TryParent
03024829 0028DF84 04102D6C 2F7B7CB0  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
031338F2 0028DF84 00000366 00000084  wxmsw28u_gcc_custom.dll!wxWindowBase::TryParent
0310DA81 00000366 00000000 00000000  wxmsw28u_gcc_custom.dll!wxMenuBase::SendEvent
0309A32B 00000000 00000366 00000000  wxmsw28u_gcc_custom.dll!wxMenu::MSWCommand
0306DAB0 00000366 00000000 00000000  wxmsw28u_gcc_custom.dll!wxWindow::HandleCommand
0307134C 00000111 00000366 00000000  wxmsw28u_gcc_custom.dll!wxWindow::MSWWindowProc
030BF047 00000111 00000366 00000000  wxmsw28u_gcc_custom.dll!wxTreeCtrl::MSWWindowProc
0306ADAE 00040AA8 00000111 00000366  wxmsw28u_gcc_custom.dll!wxWndProc
770E62FA 0306AD60 00040AA8 00000111  USER32.dll!_InternalCallWinProc@20
770E6D3A 00000000 0306AD60 00040AA8  USER32.dll!_UserCallWinProcCheckWow@32
770E77C4 0306AD60 00000000 0028E588  USER32.dll!_DispatchMessageWorker@8
770E788A 0028E554 00000000 00000111  USER32.dll!_DispatchMessageW@4
0306FBB9 0028E664 0000007E 00000066  wxmsw28u_gcc_custom.dll!wxWindow::DoPopupMenu
004F7C06 0028E664 0028E8B8 0028E800  codeblocks.exe!wxWindowBase::PopupMenu
0048AC05 2E0A2378 0028E8B8 00770020  codeblocks.exe!ProjectManagerUI::ShowMenu
0048DB76 0028F468 00000000 00000000  codeblocks.exe!ProjectManagerUI::OnTreeItemRightClick
02FA1261 05ECBAE8 0048DAD2 00000000  wxmsw28u_gcc_custom.dll!wxAppConsole::HandleEvent
0302436E 00590178 05ECBAE8 0028F468  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEventIfMatches
0302443A 0028F468 05ECBAE8 00000000  wxmsw28u_gcc_custom.dll!wxEventHashTable::HandleEvent
03024895 0028F468 05E18F48 00000000  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
--- repeats 16 times ---
03024829 0028F468 00000000 00000000  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
0A751716 0028F468 06585ED0 2FD76F80  clanglib.dll!ProcessEvent  [ClangLib/src/clangplugin.cpp @ 222]
   220: bool ClangPlugin::ProcessEvent( wxEvent& event )
   221: {
>  222:     if (cbPlugin::ProcessEvent(event))
   223:         return true;
   224:     for (std::vector<ClangPluginComponent*>::iterator it = m_ActiveComponentList.begin(); it != m_ActiveComponentList.end(); ++it)
03024829 0028F468 0641E648 6DBFBC4E  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
---- repeats 54 times -----
03024829 0028F468 00000000 FEEDBAB1  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
031338F2 0028F468 062EDBD8 0028F3B8  wxmsw28u_gcc_custom.dll!wxWindowBase::TryParent
03024829 0028F468 770E965E 00000014  wxmsw28u_gcc_custom.dll!wxEvtHandler::ProcessEvent
031338F2 0028F468 00001111 00000000  wxmsw28u_gcc_custom.dll!wxWindowBase::TryParent
030BDF15 00000361 0028F968 0028F618  wxmsw28u_gcc_custom.dll!wxTreeCtrl::MSWOnNotify
0307240C 0000004E 00000361 0028F968  wxmsw28u_gcc_custom.dll!wxWindow::MSWWindowProc
0306ADAE 00090BAE 0000004E 00000361  wxmsw28u_gcc_custom.dll!wxWndProc
770E62FA 0306AD60 00090BAE 0000004E  USER32.dll!_InternalCallWinProc@20
770E6D3A 00000000 0306AD60 00090BAE  USER32.dll!_UserCallWinProcCheckWow@32
770E965E 04512E20 00000000 0306AD60  USER32.dll!_SendMessageWorker@24
770E96C5 00090BAE 0000004E 00000361  USER32.dll!_SendMessageW@16
030BFBE4 00000204 00000002 0066007E  wxmsw28u_gcc_custom.dll!wxTreeCtrl::MSWWindowProc
0306ADAE 00040AA8 00000204 00000002  wxmsw28u_gcc_custom.dll!wxWndProc
770E62FA 0306AD60 00040AA8 00000204  USER32.dll!_InternalCallWinProc@20
770E6D3A 00000000 0306AD60 00040AA8  USER32.dll!_UserCallWinProcCheckWow@32
770E77C4 0306AD60 00000000 0028FBE8  USER32.dll!_DispatchMessageWorker@8
770E788A 0028FBC4 00000000 00000000  USER32.dll!_DispatchMessageW@4
0304FAEF 2A7D0B58 00000001 0028FD40  wxmsw28u_gcc_custom.dll!wxEventLoop::Dispatch

you will note that this is a stack overflow crash. And the stack is nearly 210 calls in the clang library. Actually it is in the event handling code of wx 210 calls. So i think there is somewhere a recursive event loop. So this is a clang problem.
I am not this familiar with the event system so i didn't looked over it to much...
This is underlined by this messages from the bt I think this is a clang problem because of this returning bt information:
Code
0A751716 0028F468 06585ED0 2FD76F80  clanglib.dll!ProcessEvent  [ClangLib/src/clangplugin.cpp @ 222]
   220: bool ClangPlugin::ProcessEvent( wxEvent& event )
   221: {
>  222:     if (cbPlugin::ProcessEvent(event))
   223:         return true;
   224:     for (std::vector<ClangPluginComponent*>::iterator it = m_ActiveComponentList.begin(); it != m_ActiveComponentList.end(); ++it)
[Edit:] correcting the hypothesis

No it is not a recursing problem. On some operations wx is processing events for a short while, thats why you see them stacking up.

Yves
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib