This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
gdb/1776: gdb core dump when printing variable
- From: bel at orel dot ru
- To: gdb-gnats at sources dot redhat dot com
- Date: 15 Sep 2004 12:35:20 -0000
- Subject: gdb/1776: gdb core dump when printing variable
- Reply-to: bel at orel dot ru
>Number: 1776
>Category: gdb
>Synopsis: gdb core dump when printing variable
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: patch
>Submitter-Id: net
>Arrival-Date: Wed Sep 15 12:38:02 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: bel@orel.ru
>Release: current-6
>Organization:
>Environment:
FreeBSD bel.localdomain 5.2-CURRENT FreeBSD 5.2-CURRENT #18: Wed Sep 15 13:01:02 MSD 2004 bel@bel.localdomain:/usr/obj/usr/src/sys/SUNC3D sparc64
>Description:
gdb dumps core when I try printing any variable.
=================================================
bel@bel$ gdb53 /usr/ports/devel/gdb6.local/work/gdb+dejagnu-20040914/gdb/gdb gdb6.core
GNU gdb 5.3 (FreeBSD)
This GDB was configured as "sparc64-portbld-freebsd5.2"...
Core was generated by `gdb6'.
Program terminated with signal 4, Illegal instruction.
#0 0x00000000001b4bdc in language_gdbarch_post_init (gdbarch=0x4cf010)
at language.c:1291
1291 if (languages[i] != NULL
(gdb) l
1286 int i;
1287
1288 l = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct language_gdbarch);
1289 for (i = 0; i < languages_size; i++)
1290 {
1291 if (languages[i] != NULL
1292 && languages[i]->la_language_arch_info != NULL)
1293 languages[i]->la_language_arch_info
1294 (gdbarch, l->arch_info + languages[i]->la_language);
1295 }
(gdb) p i
$1 = 13
(gdb) p languages_size
$2 = 13
(gdb) l languages[i]
Junk at end of line specification.
(gdb) p languages[i]
$3 = (const struct language_defn *) 0xd0d0d0d0d0d0d0d0
(gdb) p languages[i-1]
$4 = (const struct language_defn *) 0x2d3298
>How-To-Repeat:
bel@bel$ gdb6 ss
GNU gdb 20040914 [GDB v6.x for FreeBSD]
This GDB was configured as "sparc64-portbld-freebsd5.2"...
(gdb) l
32
33 int
34 main()
35 {
36 pthread_t threads[NTHREADS - 1];
37 struct thr_args args[NTHREADS - 1];
38 int error;
39 int i;
40
41 for (i = 0; i < NTHREADS; i++) {
(gdb) b 42
Breakpoint 1 at 0x100418: file ss.c, line 42.
(gdb) run
Starting program: /home/bel/tmp/kse/ss
Breakpoint 1, main () at ss.c:42
42 args[i].i = i;
(gdb) p i
Segmentation fault (core dumped)
>Fix:
Try attached patch.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="patch-zza"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="patch-zza"
LS0tIGdkYi9sYW5ndWFnZS5jLm9yaWcJU2F0IFNlcCAxMSAxOTowNDoxNiAyMDA0CisrKyBnZGIv
bGFuZ3VhZ2UuYwlXZWQgU2VwIDE1IDE1OjQyOjQ4IDIwMDQKQEAgLTEyODYsNyArMTI4Niw3IEBA
CiAgIGludCBpOwogCiAgIGwgPSBHREJBUkNIX09CU1RBQ0tfWkFMTE9DIChnZGJhcmNoLCBzdHJ1
Y3QgbGFuZ3VhZ2VfZ2RiYXJjaCk7Ci0gIGZvciAoaSA9IDA7IGkgPD0gbGFuZ3VhZ2VzX3NpemU7
IGkrKykKKyAgZm9yIChpID0gMDsgaSA8IGxhbmd1YWdlc19zaXplOyBpKyspCiAgICAgewogICAg
ICAgaWYgKGxhbmd1YWdlc1tpXSAhPSBOVUxMCiAJICAmJiBsYW5ndWFnZXNbaV0tPmxhX2xhbmd1
YWdlX2FyY2hfaW5mbyAhPSBOVUxMKQo=