This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb/242: SIGSEGV received when debugging small threaded test case (regression)



>Number:         242
>Category:       gdb
>Synopsis:       SIGSEGV received when debugging small threaded test case (regression)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 08 08:08:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     mungal@ca.ibm.com
>Release:        5.1
>Organization:
>Environment:
RedHat Linux 7.1 on i686
>Description:
Typing 'run' within gdb results in a SIGSEGV on this testcase.
gdb 5.1 20011101 has no problem.
gdb 5.1 20011105 and newer gets a SIGSEGV.

Here is output from the two debugging sessions:
===========================================================
GNU gdb 20011101
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) run
Starting program: /home/mungal/defects/thread/./hello 
[New Thread 1024 (LWP 20168)]
[New Thread 2049 (LWP 20193)]
[New Thread 1026 (LWP 20194)]
[New Thread 2051 (LWP 20195)]
[New Thread 3076 (LWP 20196)]
Hello World 

Program exited normally.
(gdb) quit
===========================================================
GNU gdb 20011105
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) run
Starting program: /home/mungal/defects/thread/./hello 
[New Thread 1024 (LWP 20198)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 20198)]
0x00000000 in ?? ()
(gdb) quit
The program is running.  Exit anyway? (y or n) y
===========================================================
>How-To-Repeat:
build test case with:
gcc -Wall -g -D_REENTRANT -I/usr/include hello.c -o hello -lpthread -lm
debug test case with:
gdb hello
run
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/msword; name="hello.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="hello.c"

I2luY2x1ZGU8c3RkaW8uaD4KI2luY2x1ZGU8cHRocmVhZC5oPgoKI2RlZmluZSBJVEVSQVRFIDEK
CnZvaWQgcHJpbnRfbWVzc2FnZV9mdW5jdGlvbiggdm9pZCAqcHRyICkKewogICBjaGFyICptZXNz
YWdlOwogICBtZXNzYWdlID0gKGNoYXIgKikgcHRyOwogICBwcmludGYoIiVzIiwgbWVzc2FnZSk7
Cn0KICAKaW50IG1haW4oaW50IGFyZ2MsIGNoYXIgKiphcmd2KQp7CiAgIGludCBpOwogICBwdGhy
ZWFkX3QgdGhyZWFkMSwgdGhyZWFkMiwgdGhyZWFkMzsKICAgY2hhciAqbWVzc2FnZTEgPSAiSGVs
bG8gIjsKICAgY2hhciAqbWVzc2FnZTIgPSAiV29ybGQgIjsKICAgY2hhciAqbWVzc2FnZTMgPSAi
XG4iOwogICAgIAogICBmb3IoaT0wOyBpPElURVJBVEU7IGkrKykKICAgewogICAgICBwdGhyZWFk
X2NyZWF0ZSgmdGhyZWFkMSwgTlVMTCwgKHZvaWQqKSZwcmludF9tZXNzYWdlX2Z1bmN0aW9uLCAo
dm9pZCopIG1lc3NhZ2UxKTsKICAgICAgcHRocmVhZF9jcmVhdGUoJnRocmVhZDIsIE5VTEwsICh2
b2lkKikmcHJpbnRfbWVzc2FnZV9mdW5jdGlvbiwgKHZvaWQqKSBtZXNzYWdlMik7CiAgICAgIHB0
aHJlYWRfY3JlYXRlKCZ0aHJlYWQzLCBOVUxMLCAodm9pZCopJnByaW50X21lc3NhZ2VfZnVuY3Rp
b24sICh2b2lkKikgbWVzc2FnZTMpOwogICB9IAogICByZXR1cm4gMDsKfQo=


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]