Bug 1170861

Summary: [abrt] gdb: dump_core(): gdb killed by SIGABRT
Product: [Fedora] Fedora Reporter: Ulrich Drepper <drepper>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: dmalcolm, gbenson, jan.kratochvil, japsmits, matthias.scholz, palves, pmuldoon, redhat, sergiodj, thomas.mey, tromey
Target Milestone: ---Keywords: Reproducer
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/c57d04657e73a21f39f3dcaabdd5a039bd75ddf1
Whiteboard: abrt_hash:bf3ef9266883a16e9a8b9845671f2d65a0bdf2ed
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-02 05:28:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: cgroup
none
File: core_backtrace
none
File: dso_list
none
File: environ
none
File: limits
none
File: maps
none
File: open_fds
none
File: proc_pid_status
none
File: var_log_messages none

Description Ulrich Drepper 2014-12-05 02:34:19 UTC
Description of problem:
Running inferior which crashes.  Upon reaching the prompt I just type

p/x $pc

and gdb crashes.

Version-Release number of selected component:
gdb-7.8.1-32.fc21

Additional info:
reporter:       libreport-2.3.0
backtrace_rating: 4
cmdline:        gdb ./jt3
crash_function: dump_core
executable:     /usr/bin/gdb
kernel:         3.17.4-301.fc21.x86_64
runlevel:       N 5
type:           CCpp
uid:            1000

Truncated backtrace:
Thread no. 1 (10 frames)
 #2 dump_core at ../../gdb/utils.c:612
 #3 internal_vproblem at ../../gdb/utils.c:777
 #4 internal_verror at ../../gdb/utils.c:803
 #5 internal_error at ../../gdb/utils.c:813
 #6 value_of_register_lazy at ../../gdb/findvar.c:292
 #7 value_of_register at ../../gdb/findvar.c:273
 #8 evaluate_subexp_standard at ../../gdb/eval.c:836
 #9 evaluate_subexp_c at ../../gdb/c-lang.c:720
 #10 evaluate_subexp_standard at ../../gdb/eval.c:2057
 #11 evaluate_subexp_c at ../../gdb/c-lang.c:720

Potential duplicate: bug 716627

Comment 1 Ulrich Drepper 2014-12-05 02:34:21 UTC
Created attachment 964916 [details]
File: backtrace

Comment 2 Ulrich Drepper 2014-12-05 02:34:22 UTC
Created attachment 964917 [details]
File: cgroup

Comment 3 Ulrich Drepper 2014-12-05 02:34:23 UTC
Created attachment 964918 [details]
File: core_backtrace

Comment 4 Ulrich Drepper 2014-12-05 02:34:24 UTC
Created attachment 964919 [details]
File: dso_list

Comment 5 Ulrich Drepper 2014-12-05 02:34:24 UTC
Created attachment 964920 [details]
File: environ

Comment 6 Ulrich Drepper 2014-12-05 02:34:25 UTC
Created attachment 964921 [details]
File: limits

Comment 7 Ulrich Drepper 2014-12-05 02:34:26 UTC
Created attachment 964922 [details]
File: maps

Comment 8 Ulrich Drepper 2014-12-05 02:34:26 UTC
Created attachment 964923 [details]
File: open_fds

Comment 9 Ulrich Drepper 2014-12-05 02:34:27 UTC
Created attachment 964925 [details]
File: proc_pid_status

Comment 10 Ulrich Drepper 2014-12-05 02:34:28 UTC
Created attachment 964927 [details]
File: var_log_messages

Comment 11 Ulrich Drepper 2014-12-05 18:02:47 UTC
Here is a self-contained reproducer:

#include <dlfcn.h>
#include <stdlib.h>
int main() {
  system("echo 'int foo() { return foo(); }' | gcc -x c -shared -fpic -o u.so -");
  void *d = dlopen("./u.so", RTLD_LAZY);
  if (d == NULL) {
    puts(dlerror());
    return 1;
  }
  unlink("u.so");
  int (*fp)(void) = (int(*)(void)) dlsym(d, "foo");
  return fp();
}


Run this under gdb and then just execute "p $pc".  Notice that the program crashes due to a stack overrun.  If you have this error in the executable itself it'll work fine.


The problem is that the DSO goes away before gdb reads the debug info.  This happens, for instance, with gcc's JIT.

Comment 12 Dave Malcolm 2014-12-06 01:31:43 UTC
For reference, here is the libgccjit RFE for working around this from the jit side:
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64206
(so that both bugs link to each other)

Comment 13 Dave Malcolm 2015-02-02 16:29:56 UTC
(In reply to Dave Malcolm from comment #12)
> For reference, here is the libgccjit RFE for working around this from the
> jit side:
>   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64206
> (so that both bugs link to each other)

FWIW libgccjit attempts to work around this, as of gcc r219395 (2015-01-09).

Comment 14 redhat 2015-02-06 12:55:19 UTC
Another user experienced a similar problem:

Downloaded winff sources -> https://winff.googlecode.com/files/WinFF-1.5.2-source.tar.gz -> opened in Lazarus IDE -> tried to compile winff 

reporter:       libreport-2.3.0
backtrace_rating: 4
cmdline:        /usr/bin/gdb -silent -i mi -nx
crash_function: dump_core
executable:     /usr/bin/gdb
kernel:         3.18.3-201.fc21.x86_64
package:        gdb-7.8.2-38.fc21
reason:         gdb killed by SIGABRT
runlevel:       N 5
type:           CCpp
uid:            1000

Comment 15 Jan Kratochvil 2015-02-16 21:10:55 UTC
[patch] Do not close BFDs, breaking deleted inferior shlibs
https://sourceware.org/ml/gdb-patches/2015-02/msg00367.html

Comment 16 Thomas Meyer 2015-05-05 19:49:44 UTC
Another user experienced a similar problem:

I debugged an user-mode-linux executable and i always seem to hit this assertion:

The assertion is in:
 409│ static int
 410│ thread_get_info_callback (const td_thrhandle_t *thp, void *argp)

 430│   if (inout->thread_info == NULL)
 431│     {
 432│       /* New thread.  Attach to it now (why wait?).  */
 433│       if (!have_threads (thread_ptid))
 434│         thread_db_find_new_threads_1 (thread_ptid);
 435│       else
 436│         attach_thread (thread_ptid, thp, &ti);
 437│       inout->thread_info = find_thread_ptid (thread_ptid);
 438├>      gdb_assert (inout->thread_info != NULL);
 439│     }
 440│
 441│   return 0;

(gdb) p	thread_ptid
$3 = {pid = 1454508, lwp = -1, tid = 0}

pid 1454508 is the user mode linux kernel exectuable file.

(gdb) p *inout
$5 = {thread_info = 0x0, thread_db_info	= 0x2662eb0}

(gdb) p *inout->thread_db_info
$7 = {next = 0x0, pid = 1454508, handle	= 0x277cd30, filename =	0x0, proc_handle = {ptid = {pid	= 1454508, lwp = 1454508, tid =	0}}, thread_agent = 0x264f440,	need_stale_parent_threads_check	= 0, td_create_bp_addr = 269203038288, td_death_bp_addr	= 269203038304,	td_init_p = 0x7f50b4f82920 <td_init>, td_ta_new_p = 0x7f50b4f82940 <td_ta_new>, td_ta_map_id2thr_p = 0x7f50b4f82b50 <td_ta_map_id2thr>, td_ta_map_lwp2thr_p =	0x7f50b4f82e50 <td_ta_map_lwp2thr>, td_ta_thr_iter_p = 0x7f50b4f83220 <td_ta_thr_iter>,	td_ta_event_addr_p = 0x7f50b4f842d0 <td_ta_event_addr>, td_ta_set_event_p = 0x7f50b4f84a60 <td_ta_set_event>, td_ta_clear_event_p = 0x7f50b4f84f00 <td_ta_clear_event>, td_ta_event_getmsg_p = 0x7f50b4f84c50 <td_ta_event_getmsg>, td_thr_validate_p	= 0x7f50b4f83ef0 <td_thr_validate>, td_thr_get_info_p = 0x7f50b4f83520 <td_thr_get_info>, td_thr_event_enable_p = 0x7f50b4f843b0 <td_thr_event_enable>, td_thr_tls_get_addr_p = 0x7f50b4f85220 <td_thr_tls_get_addr>, td_thr_tlsbase_p = 0x7f50b4f85120 <td_thr_tlsbase>}

any ideas what is going on here?

bug or feature?

I can provide more info about the failing gdb using another gdb :-)

reporter:       libreport-2.3.0
backtrace_rating: 4
cmdline:        gdb --nw --annotate=2 -x /home/thomas/.tgdb/a2_gdb_init ./linux
crash_function: dump_core
executable:     /usr/bin/gdb
kernel:         4.0.0
package:        gdb-7.8.2-38.fc21
reason:         gdb killed by SIGABRT
runlevel:       N 5
type:           CCpp
uid:            1000

Comment 17 Fedora End Of Life 2015-11-04 15:27:13 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 18 Fedora End Of Life 2015-12-02 05:29:02 UTC
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.