Bug #16357 2009-10-20 21:16

vshader

GDB debugging mode fails to debug

Platform: Fedora 11 GNU/Linux, kernel 2.6.31 built manually (#1 SMP PREEMPT), x86_64
Version: svn r5870 (bug occured in r581? too), built manually
What happens: I cannot run my application in debugging mode.
Expected behaviour: normal work in debug mode
How to reproduce: Load the project which causes problem, set breakpoint in any source code line, click Debug->Start.

Details:
When I try to run my project in debug mode, the debugger starts, but immediately closes. Often (not always) codeblocks crashes after that "failed" debugger starting. Problem exists in one of my projects, but I cannot determine any reason of the behaviour. Bug still occurs, even if I compile only the easiest code in this project. Other projects works well without any problems.

Log window shows:
(...)
Setting breakpoints
Debugger name and version: GNU gdb (GDB) Fedora (6.8.50.20090302-38.fc11)
Debugger finished with status 1

Additionally, often (but not always) codeblocks crashes (SIGSEGV) after displaying the last message. I ran codeblocks in gdb and got some info:
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe35aaaa7 in DebuggerGDB::DoDebug (this=0x1362db0) at debuggergdb.cpp:1550
1550            m_State.GetDriver()->Start(m_BreakOnEntry);

m_State looks this:
$1 = {m_pPlugin = 0x1396d60, m_pDriver = 0x0, m_Watches = {<wxArrayPtrVoid> = {<wxBaseArrayPtrVoid> = {m_nSize = 0,
        m_nCount = 0, m_pItems = 0x0}, <No data fields>}, <No data fields>}, m_Breakpoints = {<wxBaseArrayPtrVoid> = {
      m_nSize = 16, m_nCount = 1, m_pItems = 0x190c070}, <No data fields>}, m_BpAutoIndex = 1}
Notice that m_pDriver is NULL and I think this is the direct reason of crash.

Top of backtrace:
#0  0x00007fffe35aaaa7 in DebuggerGDB::DoDebug (this=0x13afb60) at debuggergdb.cpp:1550                                      
#1  0x00007ffff7b047f9 in Manager::ProcessEvent (this=<value optimized out>, event=@0x7fffffffc5f0) at manager.cpp:179       
#2  0x00007fffe324df56 in CompilerGCC::NotifyJobDone (this=0x142ab60, showNothingToBeDone=<value optimized out>)             
    at compilergcc.cpp:3816                                                                                                  
#3  0x00007fffe3250fb1 in CompilerGCC::DoRunQueue (this=0x142ab60) at compilergcc.cpp:1165                                   
#4  0x00007fffe32565b0 in CompilerGCC::DoBuild (this=0x142ab60, target=<value optimized out>, clean=<value optimized out>,   
    build=<value optimized out>, clearLog=true) at compilergcc.cpp:2726                                                      
#5  0x00007fffe3243350 in CompilerGCC::Build (this=0x142ab60, target=<value optimized out>) at compilergcc.cpp:2737          
#6  0x00007fffe359b04e in DebuggerGDB::EnsureBuildUpToDate (this=0x13afb60) at debuggergdb.cpp:1194                          
#7  0x00007fffe35ab358 in DebuggerGDB::Debug (this=0x13afb60) at debuggergdb.cpp:1238                                        
#8  0x0000003abdaf2650 in wxEvtHandler::ProcessEventIfMatches (entry=<value optimized out>, handler=0x0,                     
    event=@0x7fffffffcd50) at src/common/event.cpp:1231                                                                      
#9  0x0000003abdaf3624 in wxEventHashTable::HandleEvent (this=<value optimized out>, event=@0x7fffffffcd50, self=0x13afb60)  
    at src/common/event.cpp:906     
(...)

CBP project file looks as below:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
        <FileVersion major="1" minor="6" />
        <Project>
                <Option title="test1" />
                <Option pch_mode="2" />
                <Option compiler="gcc" />
                <Build>
                        <Target title="Debug">
                                <Option output="bin/Debug/test1" prefix_auto="1" extension_auto="1" />
                                <Option object_output="obj/Debug/" />
                                <Option type="1" />
                                <Option compiler="gcc" />
                                <Compiler>
                                        <Add option="-g" />
                                </Compiler>
                        </Target>
                        <Target title="Release">
                                <Option output="bin/Release/test1" prefix_auto="1" extension_auto="1" />
                                <Option object_output="obj/Release/" />
                                <Option type="1" />
                                <Option compiler="gcc" />
                                <Compiler>
                                        <Add option="-O2" />
                                </Compiler>
                        </Target>
                </Build>
                <Compiler>
                        <Add option="-Wall" />
                        <Add option="-std=gnu++0x" />
                        <Add option="-fexceptions" />
                </Compiler>
                <Unit filename="main.cpp" />
                <Extensions>
                        <code_completion />
                        <debugger />
                </Extensions>
        </Project>
</CodeBlocks_project_file>

main.cpp is not reason of problem, I typed easiest possible code:
int main() {
    return 7;
}
but bug still occurs.
Category
Debugger
Group
 
Status
Open
Close date
 
Assigned to