Thread Join/StackTrace
I am having problems debugging an application under Linux using gdb and
the boost threads library. The problem I am basically having is the
stack trace is only going back to the join statement rather than to
point in the program that caused the crash. My application is
reasonable complicated so to reproduce it I have created a buggy version
of the helloword4 tutorial. The slightly modified the helloworld4
tutorial program to loop 7 times and then crash. The stack trace given
in gdb points back to the join statement rather than the source code
line that generated the error. Has anyone else come across this
problem?
// Copyright (C) 2001-2003
// William E. Kempf
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appear in all copies and
// that both that copyright notice and this permission notice appear
// in supporting documentation. William E. Kempf makes no
representations
// about the suitability of this software for any purpose.
// It is provided "as is" without express or implied warranty.
#include
Fallon, David wrote:
I am having problems debugging an application under Linux using gdb and the boost threads library. The problem I am basically having is the stack trace is only going back to the join statement rather than to point in the program that caused the crash. My application is reasonable complicated so to reproduce it I have created a buggy version of the helloword4 tutorial. The slightly modified the helloworld4 tutorial program to loop 7 times and then crash. The stack trace given in gdb points back to the join statement rather than the source code line that generated the error. Has anyone else come across this problem?
This behaviour seems correct to me. gdb is showing you the state of the first thread. If you want to see the state of the other thread, you have to switch to that first - use "info threads" to list the thread numbers and then "thread <n>" to switch. Ben.
participants (2)
-
Ben Hutchings
-
Fallon, David