Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
LINUX: Tools Run Crash and Company...
moloh:
I found a bad behaviour under Linux, i want to use cmake Makefile generator from Tools menu, made an entry
(Name:cmake, Executable:cmake, Parameters:${PROJECT_DIR}, Working Directory:${PROJECT_DIR}/.cmake) to configure out-of-the source build and try to run it. Result? crash. Under gdb i get onlt this as backtrace:
--- Code: ---#0 0xb76f10b2 in wxTimer::~wxTimer () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#1 0xb6ed3c27 in g_main_context_wakeup () from /usr/lib/libglib-2.0.so.0
#2 0xb7a6643b in __pthread_alt_unlock () from /lib/libpthread.so.0
--- End code ---
Te get more info i tried to run codeblocks under valgrind, here i present results, i also found other bug in TinyXML usage. Location:
--- Code: ---File: configmanager.cpp
Line: 103-105
Problem: Pass non-NULL terminated string to TinyXML Parse function
Result: Invalid Read after allocated block, but this don't cause any trouble (no crash).
--- End code ---
Now to importand part of valgrind error log:
These warning show before actually Tools is executed in console but after "click":
--- Code: ---==20299== Warning: invalid file descriptor 1014 in syscall close()
==20299== Warning: invalid file descriptor 1015 in syscall close()
==20299== Warning: invalid file descriptor 1016 in syscall close()
==20299== Use --log-fd=<number> to select an alternative log fd.
==20299== Warning: invalid file descriptor 1017 in syscall close()
==20299== Warning: invalid file descriptor 1018 in syscall close()
==20299== Warning: invalid file descriptor 1019 in syscall close()
==20299== Warning: invalid file descriptor 1020 in syscall close()
==20299== Warning: invalid file descriptor 1021 in syscall close()
==20299== Warning: invalid file descriptor 1022 in syscall close()
==20299== Warning: invalid file descriptor 1023 in syscall close()
--- End code ---
And this is valgrind backtrace for error:
--- Code: ---==17229== Invalid read of size 4
==17229== at 0x483AEBA: wxTimer::Stop() (in /usr/lib/libwx_gtk2u_core-2.6.so.0.2.0)
==17229== by 0x4A6B477: wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const (in /usr/lib/libwx_baseu-2.6.so.0.2.0)
==17229== by 0x4AFA602: wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) (in /usr/lib/libwx_baseu-2.6.so.0.2.0)
==17229== by 0x4AFA7C6: wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) (in /usr/lib/libwx_baseu-2.6.so.0.2.0)
==17229== by 0x4AFA8E3: wxEvtHandler::ProcessEvent(wxEvent&) (in /usr/lib/libwx_baseu-2.6.so.0.2.0)
==17229== by 0x4AFAB56: wxEvtHandler::ProcessPendingEvents() (in /usr/lib/libwx_baseu-2.6.so.0.2.0)
==17229== by 0x4A6BA18: wxAppConsole::ProcessPendingEvents() (in /usr/lib/libwx_baseu-2.6.so.0.2.0)
==17229== by 0x4180022: Manager::ProcessPendingEvents() (manager.cpp:105)
==17229== by 0x41E9138: SimpleTextLog::AddLog(wxString const&, bool) (simpletextlog.cpp:66)
==17229== by 0x418496B: MessageManager::Log(wchar_t const*, ...) (messagemanager.cpp:232)
==17229== by 0x41F11AD: ToolsManager::OnToolStdOutput(CodeBlocksEvent&) (toolsmanager.cpp:384)
==17229== by 0x4A6B477: wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const (in /usr/lib/libwx_baseu-2.6.so. 0.2.0)
==17229== Address 0x6DA13FC is 0 bytes after a block of size 164 alloc'd
==17229== at 0x401CC31: operator new(unsigned) (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==17229== by 0x4180589: Manager::GetToolsManager() const (manager.h:139)
==17229== by 0x8090EF4: MainFrame::CreateMenubar() (main.cpp:673)
==17229== by 0x8091DAF: MainFrame::CreateIDE() (main.cpp:537)
==17229== by 0x8092A47: MainFrame::MainFrame(wxWindow*) (main.cpp:458)
==17229== by 0x8065B5A: CodeBlocksApp::InitFrame() (app.cpp:218)
==17229== by 0x8066B66: CodeBlocksApp::OnInit() (app.cpp:378)
==17229== by 0x8067890: wxAppConsole::CallOnInit() (app.h:87)
==17229== by 0x4AA0B91: wxEntry(int&, wchar_t**) (in /usr/lib/libwx_baseu-2.6.so.0.2.0)
==17229== by 0x4B90420: (below main) (in /lib/libc-2.3.6.so)
==17229==
==17229== Invalid write of size 4
==17229== at 0x483AECA: wxTimer::Stop() (in /usr/lib/libwx_gtk2u_core-2.6.so.0.2.0)
==17229== by 0x4A6B477: wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const (in /usr/lib/libwx_baseu-2.6.so.0.2.0)
==17229== by 0x4AFA602: wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) (in /usr/lib/libwx_baseu-2.6.so.0.2.0)
==17229== by 0x4AFA7C6: wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) (in /usr/lib/libwx_baseu-2.6.so.0.2.0)
==17229== by 0x4AFA8E3: wxEvtHandler::ProcessEvent(wxEvent&) (in /usr/lib/libwx_baseu-2.6.so.0.2.0)
==17229== by 0x4AFAB56: wxEvtHandler::ProcessPendingEvents() (in /usr/lib/libwx_baseu-2.6.so.0.2.0)
==17229== by 0x4A6BA18: wxAppConsole::ProcessPendingEvents() (in /usr/lib/libwx_baseu-2.6.so.0.2.0)
==17229== by 0x4180022: Manager::ProcessPendingEvents() (manager.cpp:105)
==17229== by 0x41E9138: SimpleTextLog::AddLog(wxString const&, bool) (simpletextlog.cpp:66)
==17229== by 0x418496B: MessageManager::Log(wchar_t const*, ...) (messagemanager.cpp:232)
==17229== by 0x41F11AD: ToolsManager::OnToolStdOutput(CodeBlocksEvent&) (toolsmanager.cpp:384)
==17229== by 0x4A6B477: wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const (in /usr/lib/libwx_baseu-2.6.so.0.2.0)
==17229== Address 0x6DA13FC is 0 bytes after a block of size 164 alloc'd
==17229== at 0x401CC31: operator new(unsigned) (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==17229== by 0x4180589: Manager::GetToolsManager() const (manager.h:139)
==17229== by 0x8090EF4: MainFrame::CreateMenubar() (main.cpp:673)
==17229== by 0x8091DAF: MainFrame::CreateIDE() (main.cpp:537)
==17229== by 0x8092A47: MainFrame::MainFrame(wxWindow*) (main.cpp:458)
==17229== by 0x8065B5A: CodeBlocksApp::InitFrame() (app.cpp:218)
==17229== by 0x8066B66: CodeBlocksApp::OnInit() (app.cpp:378)
==17229== by 0x8067890: wxAppConsole::CallOnInit() (app.h:87)
==17229== by 0x4AA0B91: wxEntry(int&, wchar_t**) (in /usr/lib/libwx_baseu-2.6.so.0.2.0)
==17229== by 0x4B90420: (below main) (in /lib/libc-2.3.6.so)
==17229==
==17229== Invalid read of size 4
==17229== at 0x483B0B2: (within /usr/lib/libwx_gtk2u_core-2.6.so.0.2.0)
==17229== by 0x50D9C26: (within /usr/lib/libglib-2.0.so.0.800.6)
==17229== Address 0x68 is not stack'd, malloc'd or (recently) free'd
--- End code ---
Crash is caused by last call but, but two previous ones are incorrect... For me it's hard to say what is problem, i am not familiar with Code::Blocks sources.
This is from revision 2449.
thomas:
Regarding invalid read from tinyXML, that is correct, it is a known bug. The buffer is not null-terminated, which was a programming mistake of mine, not tinyXML's fault.
It is not an issue, though. Since March 13, we're using a completely different loading strategy in the development branch, which, among other things, fixes this bug.
However, since nobody ever seemed to have had a problem with the missing '\0' in 7 months (most of the time, there happens to be one by chance), I left the buggy code in HEAD untouched for now.
Modifying the same text block inside the same file in two different revision-controlled source trees causes a lot of havoc, which is something you like to avoid when you can ;)
The trees will be merged by the end of this month, anyway. By that time, this problem will be fixed, too.
The other thing... no bloody idea :)
moloh:
--- Quote from: thomas on May 13, 2006, 01:46:10 pm ---However, since nobody ever seemed to have had a problem with the missing '\0' in 7 months (most of the time, there happens to be one by chance), I left the buggy code in HEAD untouched for now.
--- End quote ---
It is no "problem" as memory allocations rutines usually alloc more space for program, then even as it looks as invalid read, it is read in program memory as far i know.
--- Quote from: thomas on May 13, 2006, 01:46:10 pm ---The other thing... no bloody idea :)
--- End quote ---
I tried to get a debug version of wxwidgets to see if i can get more information but result is the same. Only problem is a bunch of ASSERTS from wxwidgets in load process (like loading if image of size zero). I can locate them all and send reports, but i don't know if You are concerned about them. It only result in that the debug version is unusable with Code::Blocks.
As for error i would say that wxTimer was freed somehow before call, but i may be wrong.
moloh:
I manage to test same configuration (or similar one) on Windows machine. And what? It works... how suprising.
But i use LINUX, may someone help me to debug this problem? Maybe some instructions how this can be made. I want it fixed, i may even try to hack Code::Blocks sources.
thomas:
--- Quote from: moloh on May 16, 2006, 07:47:43 pm ---I manage to test same configuration (or similar one) on Windows machine. And what? It works... how suprising.
--- End quote ---
That confirms the suspicion that I was getting after reading your other thread. Possibly the problem is not to be found in Code::Blocks at all, but in some weird configuration (or buggy library versions) of your gentoo system.
It just seems strange that nothing works for you whereas it mostly works quite OK for everybody.
Navigation
[0] Message Index
[#] Next page
Go to full version