Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 06 May 2015 16:02:21 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 200001] gdb 7.9 crashes on certain core files
Message-ID:  <bug-200001-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200001

            Bug ID: 200001
           Summary: gdb 7.9 crashes on certain core files
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: freebsd-ports-bugs@FreeBSD.org
          Reporter: wjenkner@inode.at
                CC: jhb@FreeBSD.org

Created attachment 156437
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=156437&action=edit
C source file

Compile and run the attached foo.c, then examine the resulting core dump with
gdb79 (please see the transcript below).  This results in gdb79 dumping core.
For comparison purposes, gdb782 has a glitch here (a duplicated backtrace for
one thread) but it doesn't crash.

[1 ~]$ uname -a
FreeBSD xxx.yy 10.1-STABLE FreeBSD 10.1-STABLE #0 r280136: Mon Mar 16 18:59:32
CET 2015     adm@xxx.yy:/usr/obj/usr/src/sys/IZNOGOUD  amd64
[2 ~]$ cc -Wall -g -O0 -o foo foo.c -lthr
[3 ~]$ ./foo
Abort trap (core dumped)
[4 ~]$ gdb79 --core=foo.core ./foo
GNU gdb (GDB) 7.9 [GDB v7.9 for FreeBSD]
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-portbld-freebsd10.1".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./foo...done.
[New process 101209]
[New process 100339]
[New Thread 801406800 (LWP 101209)]
[New Thread 801406400 (LWP 100339)]
Core was generated by `foo'.
Program terminated with signal SIGABRT, Aborted.
Invalid selected thread.
(gdb) thread apply all bt

Thread 4 (Thread 801406400 (LWP 100339)):
#0  _nanosleep () at _nanosleep.S:3
#1  0x0000000800829b8c in __thr_nanosleep (time_to_sleep=0x7fffffffe4f8, 
    time_remaining=0x7fffffffe4e8) at
/usr/src/lib/libthr/thread/thr_syscalls.c:269
#2  0x0000000800aa2ffb in __sleep (seconds=2147483647)
    at /usr/src/lib/libc/gen/sleep.c:60
#3  0x0000000000400952 in main () at foo.c:35
Segmentation fault (core dumped)
[5 ~]$ /tmp/usr/local/bin/gdb782 --core=foo.core ./foo
GNU gdb (GDB) 7.8.2 [GDB v7.8.2 for FreeBSD]
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-portbld-freebsd10.1".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./foo...done.
[New process 101209]
[New process 100339]
[New Thread 801406800 (LWP 101209)]
[New Thread 801406400 (LWP 100339)]
Core was generated by `foo'.
Program terminated with signal SIGABRT, Aborted.
#0  thr_kill () at thr_kill.S:3
3    RSYSCALL(thr_kill)
(gdb) thread apply all bt

Thread 4 (Thread 801406400 (LWP 100339)):
#0  _nanosleep () at _nanosleep.S:3
#1  0x0000000800829b8c in __thr_nanosleep (time_to_sleep=0x7fffffffe4f8, 
    time_remaining=0x7fffffffe4e8) at
/usr/src/lib/libthr/thread/thr_syscalls.c:269
#2  0x0000000800aa2ffb in __sleep (seconds=2147483647)
    at /usr/src/lib/libc/gen/sleep.c:60
#3  0x0000000000400952 in main () at foo.c:35

Thread 3 (Thread 801406800 (LWP 101209)):
#0  thr_kill () at thr_kill.S:3
#1  0x0000000800b896c6 in __raise (s=6) at /usr/src/lib/libc/gen/raise.c:51
#2  0x0000000800b87ea9 in abort () at /usr/src/lib/libc/stdlib/abort.c:65
#3  0x00000000004008f0 in foo_thread (arg=0x0) at foo.c:19
#4  0x0000000800827775 in thread_start (curthread=0x801406800)
    at /usr/src/lib/libthr/thread/thr_create.c:288
#5  0x0000000000000000 in ?? ()
Backtrace stopped: Cannot access memory at address 0x7fffdfffe000

Thread 1 (Thread 801406800 (LWP 101209)):
#0  thr_kill () at thr_kill.S:3
#1  0x0000000800b896c6 in __raise (s=6) at /usr/src/lib/libc/gen/raise.c:51
#2  0x0000000800b87ea9 in abort () at /usr/src/lib/libc/stdlib/abort.c:65
#3  0x00000000004008f0 in foo_thread (arg=0x0) at foo.c:19
#4  0x0000000800827775 in thread_start (curthread=0x801406800)
    at /usr/src/lib/libthr/thread/thr_create.c:288
#5  0x0000000000000000 in ?? ()
Backtrace stopped: Cannot access memory at address 0x7fffdfffe000
(gdb) quit
[6 ~]$ gdb --core=foo.core ./foo
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 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 "amd64-marcel-freebsd"...
Core was generated by `foo'.
Program terminated with signal 6, Aborted.
Reading symbols from /lib/libthr.so.3...Reading symbols from
/usr/lib/debug//lib/libthr.so.3.debug...done.
done.
Loaded symbols for /lib/libthr.so.3
Reading symbols from /lib/libc.so.7...Reading symbols from
/usr/lib/debug//lib/libc.so.7.debug...done.
done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /libexec/ld-elf.so.1...Reading symbols from
/usr/lib/debug//libexec/ld-elf.so.1.debug...done.
done.
Loaded symbols for /libexec/ld-elf.so.1
#0  thr_kill () at thr_kill.S:3
3    RSYSCALL(thr_kill)
[New Thread 801406800 (LWP 101209/foo)]
[New Thread 801406400 (LWP 100339/foo)]
(gdb) thread apply all bt

Thread 2 (Thread 801406400 (LWP 100339/foo)):
#0  _nanosleep () at _nanosleep.S:3
#1  0x0000000800829b8c in __thr_nanosleep (time_to_sleep=0x7fffffffe4f8, 
    time_remaining=0x7fffffffe4e8) at
/usr/src/lib/libthr/thread/thr_syscalls.c:269
#2  0x0000000800aa2ffb in __sleep () at /usr/src/lib/libc/gen/sleep.c:60
#3  0x0000000000400952 in main () at foo.c:35
Current language:  auto; currently asm

Thread 1 (Thread 801406800 (LWP 101209/foo)):
#0  thr_kill () at thr_kill.S:3
#1  0x0000000800b896c6 in __raise (s=<value optimized out>)
    at /usr/src/lib/libc/gen/raise.c:51
#2  0x0000000800b87ea9 in abort () at /usr/src/lib/libc/stdlib/abort.c:65
#3  0x00000000004008f0 in foo_thread (arg=0x0) at foo.c:19
#4  0x0000000800827775 in thread_start (curthread=0x801406800)
    at /usr/src/lib/libthr/thread/thr_create.c:288
#5  0x0000000000000000 in ?? ()
(gdb) [7 ~]$

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-200001-13>