Page 1 of 1

CodeLite crash when open cpp file

Posted: Fri Aug 25, 2017 11:20 am
by Peter.Jiang
Hi, Iran
I got a problem when using CodeLite.
I come from China, and my windows user name contains Chinese characters.
In this situation, when I create a project, and open the source file within this project, CodeLite will be crash suddenly.
I have debugged this problem, and I found this problem come from CodeLite/CxxLexer.cpp#LexerNew:
///////////////////////////////////////////////////////////////
FILE* fp = ::fopen(fn.GetFullPath().mb_str(wxConvUTF8).data(), "rb");
if(!fp) { // here, the fp is NULL which leads to this crash.
return NULL;
}
///////////////////////////////////////////////////////////////
I am writing just to be curious that is there necessary for CodeLite to support Chinese users ?

Peter.Jiang
Best Regards.

Re: CodeLite crash when open cpp file

Posted: Fri Aug 25, 2017 12:15 pm
by eranif
A backtrace showing how we got to this code will be great

Re: CodeLite crash when open cpp file

Posted: Fri Aug 25, 2017 6:35 pm
by eranif
Hopefully this is now fixed in master

Re: CodeLite crash when open cpp file

Posted: Mon Aug 28, 2017 12:49 pm
by Peter.Jiang
Hi, Eran
The backtrace is as follows:
//////////////////////////////////////////
> libCodeliteud-dbg.dll!yylex(void * yyscanner) line 1240 C++
libCodeliteud-dbg.dll!LexerNext(void * scanner, CxxLexerToken & token) line 3379 C++
libCodeliteud-dbg.dll!CxxPreProcessorScanner::Parse(CxxPreProcessor * pp) line 73 C++
libCodeliteud-dbg.dll!CxxPreProcessor::Parse(const wxFileName & filename, unsigned int options) line 23 C++
plugin_sdk-dbg.dll!Compiler::GetBuiltinMacros() line 801 C++
codelite-dbg.exe!CodeCompletionManager::GetDefinitionsAndSearchPaths(LEditor * editor, wxArrayString & searchPaths, wxArrayString & definitions) line 597 C++
codelite-dbg.exe!CodeCompletionManager::ProcessUsingNamespace(LEditor * editor) line 519 C++
codelite-dbg.exe!CodeCompletionManager::OnFileLoaded(clCommandEvent & event) line 463 C++
wxbase31ud_vc_custom.dll!wxAppConsoleBase::HandleEvent(wxEvtHandler * handler, void(wxEvtHandler::*)(wxEvent &) func, wxEvent & event) line 657 C++
wxbase31ud_vc_custom.dll!wxAppConsoleBase::CallEventHandler(wxEvtHandler * handler, wxEventFunctor & functor, wxEvent & event) line 669 C++
wxbase31ud_vc_custom.dll!wxEvtHandler::ProcessEventIfMatchesId(const wxEventTableEntryBase & entry, wxEvtHandler * handler, wxEvent & event) line 1381 C++
wxbase31ud_vc_custom.dll!wxEvtHandler::SearchDynamicEventTable(wxEvent & event) line 1831 C++
wxbase31ud_vc_custom.dll!wxEvtHandler::TryHereOnly(wxEvent & event) line 1574 C++
wxbase31ud_vc_custom.dll!wxEvtHandler::TryBeforeAndHere(wxEvent & event) line 3656 C++
wxbase31ud_vc_custom.dll!wxEvtHandler::ProcessEventLocally(wxEvent & event) line 1511 C++
wxbase31ud_vc_custom.dll!wxEvtHandler::ProcessEvent(wxEvent & event) line 1484 C++
libCodeliteud-dbg.dll!EventNotifier::ProcessEvent(wxEvent & event) line 149 C++
wxbase31ud_vc_custom.dll!wxEvtHandler::ProcessPendingEvents() line 1348 C++
wxbase31ud_vc_custom.dll!wxAppConsoleBase::ProcessPendingEvents() line 568 C++
wxbase31ud_vc_custom.dll!wxEventLoopManual::ProcessEvents() line 219 C++
wxbase31ud_vc_custom.dll!wxEventLoopManual::DoRun() line 273 C++
wxbase31ud_vc_custom.dll!wxEventLoopBase::Run() line 76 C++
wxbase31ud_vc_custom.dll!wxAppConsoleBase::MainLoop() line 380 C++
wxbase31ud_vc_custom.dll!wxAppConsoleBase::OnRun() line 301 C++
wxmsw31ud_core_vc_custom.dll!01894753() Unknown
////////////////////////////////////////////
When I open a source cpp file in CodeLite's editor, the Ctag module will try to parse the file, and this process leads to the crash.

Peter.Jiang
Best Regards.

Re: CodeLite crash when open cpp file

Posted: Mon Aug 28, 2017 12:49 pm
by Peter.Jiang
Hi, Eran
The backtrace is as follows:
//////////////////////////////////////////
> libCodeliteud-dbg.dll!yylex(void * yyscanner) line 1240 C++
libCodeliteud-dbg.dll!LexerNext(void * scanner, CxxLexerToken & token) line 3379 C++
libCodeliteud-dbg.dll!CxxPreProcessorScanner::Parse(CxxPreProcessor * pp) line 73 C++
libCodeliteud-dbg.dll!CxxPreProcessor::Parse(const wxFileName & filename, unsigned int options) line 23 C++
plugin_sdk-dbg.dll!Compiler::GetBuiltinMacros() line 801 C++
codelite-dbg.exe!CodeCompletionManager::GetDefinitionsAndSearchPaths(LEditor * editor, wxArrayString & searchPaths, wxArrayString & definitions) line 597 C++
codelite-dbg.exe!CodeCompletionManager::ProcessUsingNamespace(LEditor * editor) line 519 C++
codelite-dbg.exe!CodeCompletionManager::OnFileLoaded(clCommandEvent & event) line 463 C++
wxbase31ud_vc_custom.dll!wxAppConsoleBase::HandleEvent(wxEvtHandler * handler, void(wxEvtHandler::*)(wxEvent &) func, wxEvent & event) line 657 C++
wxbase31ud_vc_custom.dll!wxAppConsoleBase::CallEventHandler(wxEvtHandler * handler, wxEventFunctor & functor, wxEvent & event) line 669 C++
wxbase31ud_vc_custom.dll!wxEvtHandler::ProcessEventIfMatchesId(const wxEventTableEntryBase & entry, wxEvtHandler * handler, wxEvent & event) line 1381 C++
wxbase31ud_vc_custom.dll!wxEvtHandler::SearchDynamicEventTable(wxEvent & event) line 1831 C++
wxbase31ud_vc_custom.dll!wxEvtHandler::TryHereOnly(wxEvent & event) line 1574 C++
wxbase31ud_vc_custom.dll!wxEvtHandler::TryBeforeAndHere(wxEvent & event) line 3656 C++
wxbase31ud_vc_custom.dll!wxEvtHandler::ProcessEventLocally(wxEvent & event) line 1511 C++
wxbase31ud_vc_custom.dll!wxEvtHandler::ProcessEvent(wxEvent & event) line 1484 C++
libCodeliteud-dbg.dll!EventNotifier::ProcessEvent(wxEvent & event) line 149 C++
wxbase31ud_vc_custom.dll!wxEvtHandler::ProcessPendingEvents() line 1348 C++
wxbase31ud_vc_custom.dll!wxAppConsoleBase::ProcessPendingEvents() line 568 C++
wxbase31ud_vc_custom.dll!wxEventLoopManual::ProcessEvents() line 219 C++
wxbase31ud_vc_custom.dll!wxEventLoopManual::DoRun() line 273 C++
wxbase31ud_vc_custom.dll!wxEventLoopBase::Run() line 76 C++
wxbase31ud_vc_custom.dll!wxAppConsoleBase::MainLoop() line 380 C++
wxbase31ud_vc_custom.dll!wxAppConsoleBase::OnRun() line 301 C++
wxmsw31ud_core_vc_custom.dll!01894753() Unknown
////////////////////////////////////////////
When I open a source cpp file in CodeLite's editor, the Ctag module will try to parse the file, and this process leads to the crash.

Peter.Jiang
Best Regards.

Re: CodeLite crash when open cpp file

Posted: Mon Aug 28, 2017 1:26 pm
by eranif
Thanks for the backtrace, this is now fixed