Bug 1765117

Summary: [abrt] gdb-headless: target_ops::shortname(): gdb killed by SIGSEGV
Product: [Fedora] Fedora Reporter: Matej Grabovsky <mgrabovs>
Component: gdbAssignee: Sergio Durigan Junior <sergiodj>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 30CC: dsmith, jan.kratochvil, keiths, kevinb, pmuldoon, sergiodj
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/03e1d1132aa7caeffe93458da710740cd1a95d2f
Whiteboard: abrt_hash:dd01a21f4b48d54b9ee8c6e4b985c661e7c0072b;VARIANT_ID=workstation;
Fixed In Version: gdb-8.3-7.fc30 gdb-8.3.50.20190824-25.fc31 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-26 23:51:54 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: cpuinfo
none
File: dso_list
none
File: environ
none
File: exploitable
none
File: limits
none
File: maps
none
File: mountinfo
none
File: open_fds
none
File: proc_pid_status
none
Coredump on which gdb crashes none

Description Matej Grabovsky 2019-10-24 11:56:06 UTC
Description of problem:
I was debugging a cat coredump and suddenly gdb crashed.

Version-Release number of selected component:
gdb-headless-8.3-6.fc30

Additional info:
reporter:       libreport-2.11.2
backtrace_rating: 4
cmdline:        gdb -q /usr/bin/cat cat_cpu_2019-10-24_12:59:34.9421
crash_function: target_ops::shortname
executable:     /usr/libexec/gdb
journald_cursor: s=cedd7e988fdc453bb576b68846def5b2;i=10c0;b=b80e57815ed243aab415bdbc15e5dbcc;m=25b39464f;t=595a676bab12f;x=2ec67f817efb420
kernel:         5.3.6-200.fc30.x86_64
rootdir:        /
runlevel:       N 5
type:           CCpp
uid:            1000

Truncated backtrace:
Thread no. 1 (10 frames)
 #0 target_ops::shortname at ../../gdb/target.h:452
 #1 tui_make_status_line at ../../gdb/tui/tui-stack.c:80
 #2 tui_show_locator_content at ../../gdb/tui/tui-stack.c:255
 #3 tui_set_key_mode at ../../gdb/tui/tui.c:323
 #4 tui_inferior_exit at ../../gdb/tui/tui-hooks.c:179
 #5 std::function<void (inferior*)>::operator()(inferior*) const at /usr/include/c++/9/bits/std_function.h:685
 #6 gdb::observers::observable<inferior*>::notify at ../../gdb/common/observable.h:106
 #7 exit_inferior_1 at ../../gdb/inferior.c:191
 #8 exit_inferior_silent at ../../gdb/inferior.c:230
 #9 core_target::close at ../../gdb/corelow.c:268

Comment 1 Matej Grabovsky 2019-10-24 11:56:09 UTC
Created attachment 1628825 [details]
File: backtrace

Comment 2 Matej Grabovsky 2019-10-24 11:56:10 UTC
Created attachment 1628826 [details]
File: cgroup

Comment 3 Matej Grabovsky 2019-10-24 11:56:12 UTC
Created attachment 1628827 [details]
File: core_backtrace

Comment 4 Matej Grabovsky 2019-10-24 11:56:13 UTC
Created attachment 1628828 [details]
File: cpuinfo

Comment 5 Matej Grabovsky 2019-10-24 11:56:14 UTC
Created attachment 1628829 [details]
File: dso_list

Comment 6 Matej Grabovsky 2019-10-24 11:56:15 UTC
Created attachment 1628830 [details]
File: environ

Comment 7 Matej Grabovsky 2019-10-24 11:56:16 UTC
Created attachment 1628831 [details]
File: exploitable

Comment 8 Matej Grabovsky 2019-10-24 11:56:17 UTC
Created attachment 1628832 [details]
File: limits

Comment 9 Matej Grabovsky 2019-10-24 11:56:19 UTC
Created attachment 1628833 [details]
File: maps

Comment 10 Matej Grabovsky 2019-10-24 11:56:20 UTC
Created attachment 1628834 [details]
File: mountinfo

Comment 11 Matej Grabovsky 2019-10-24 11:56:22 UTC
Created attachment 1628835 [details]
File: open_fds

Comment 12 Matej Grabovsky 2019-10-24 11:56:23 UTC
Created attachment 1628836 [details]
File: proc_pid_status

Comment 13 Sergio Durigan Junior 2019-10-24 18:37:29 UTC
Thanks for the report.  Can you provide more details, please?  How did you invoke GDB?  I see you were using TUI; did you issue any TUI-specific commands?  Any other GDB commands?  Thanks.

Comment 14 Matej Grabovsky 2019-10-25 09:03:46 UTC
The invocation was
$ gdb -q /usr/bin/cat cat_cpu_2019-10-24_12:59:34.9421
where the coredump was created by ProcDump for Linux.

If I recall correctly, I went into the TUI right away with C-x C-a and then did
some sequence of (possibly repeated) `up`, `bt`, `bt full` and perhaps `i th`.

I think it crashed right after one of the ups, though I can't guarantee that.

I'll see if I can reproduce the crash.

Comment 15 Matej Grabovsky 2019-10-25 09:06:11 UTC
Created attachment 1629062 [details]
Coredump on which gdb crashes

OK, I have a reproducer. With the same invocation as above and the attached coredump, gdb crashes after the sequence of commands
1. C-x a
2. run

Comment 16 Sergio Durigan Junior 2019-10-29 01:55:36 UTC
(In reply to Matej Grabovsky from comment #15)
> Created attachment 1629062 [details]
> Coredump on which gdb crashes
> 
> OK, I have a reproducer. With the same invocation as above and the attached
> coredump, gdb crashes after the sequence of commands
> 1. C-x a
> 2. run

Thanks, I was able to reproduce the bug.  I will investigate it this week.

Comment 17 Sergio Durigan Junior 2019-11-19 00:16:11 UTC
A fix has been proposed and pushed upstream.

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/483

commit 494409bb8a043b259435ad5034c66aa3fee15f52 (HEAD -> master, origin/master, origin/HEAD)
Author: Sergio Durigan Junior <sergiodj>
Date:   Wed Oct 30 13:58:29 2019 -0400

    Fix crash with core + TUI + run


I can backport this to Fedora 30 GDB.  I'll see if I can do this tomorrow.

Comment 18 Fedora Update System 2019-11-21 18:24:09 UTC
FEDORA-2019-2143a7fc75 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-2143a7fc75

Comment 19 Fedora Update System 2019-11-21 18:24:25 UTC
FEDORA-2019-119b19bf0e has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2019-119b19bf0e

Comment 20 Fedora Update System 2019-11-22 02:24:52 UTC
gdb-8.3-7.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-2143a7fc75

Comment 21 Fedora Update System 2019-11-22 02:31:47 UTC
gdb-8.3.50.20190824-25.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-119b19bf0e

Comment 22 Fedora Update System 2019-11-26 23:51:54 UTC
gdb-8.3-7.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 23 Fedora Update System 2019-11-29 00:54:00 UTC
gdb-8.3.50.20190824-25.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.