Bug 2354997

Summary: gstack in gdb 16 no longer provides file names and line numbers
Product: [Fedora] Fedora Reporter: Peter Hutterer <peter.hutterer>
Component: gdbAssignee: Keith Seitz <keiths>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 41CC: ahajkova, fweimer, guinevere, jan, keiths, kevinb, mcermak, mkolar, suraj.ghimire7
Target Milestone: ---Keywords: Regression
Target Release: ---Flags: keiths: mirror+
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: gdb-16.2-3.fc42 gdb-16.2-2.fc41 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-04-01 00:18:43 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
test.c none

Description Peter Hutterer 2025-03-26 05:56:06 UTC
gdb 16's gstack now unconditionally passes --readnever to gdb which omits most of the useful information that I've come to rely, in particular the file and line number.

There doesn't appear to be a way to override this. gstack supports $GDBARGS but that cannot be used to override the hardcoded --readnever.

Test program to illustrate the case is attached - it forks off a worker process and then gstack to print the stacktrace of that process. This resembles the real-world use-case I've had in the libinput test suite for the last 10y or so. The output of that program on three different versions is:

Fedora 41 with gdb-15.1-1.fc41.x86_64:

#0  0x00007f79c7bc1117 in clock_nanosleep.5 () from /lib64/libc.so.6
#1  0x00007f79c7bcd247 in nanosleep () from /lib64/libc.so.6
#2  0x00007f79c7bdf8b1 in sleep () from /lib64/libc.so.6
#3  0x00000000004011a1 in tired () at test.c:9
#4  0x00000000004011ca in main () at test.c:16

Fedora 41 with gdb-16.2-1.fc41.x86_64:

Thread 1 (Thread 0x7fae7acff740 (LWP 52285) "test"):
#0  0x00007fae7adbf117 in clock_nanosleep.5 () from /lib64/libc.so.6
#1  0x00007fae7adcb247 in nanosleep () from /lib64/libc.so.6
#2  0x00007fae7addd8b1 in sleep () from /lib64/libc.so.6
#3  0x0000000038bd3536 in ?? ()
#4  0x0000000001000000 in ?? ()
#5  0x2a736384ed9f5000 in ?? ()
#6  0x00007ffd77630598 in ?? ()
#7  0x0000000000000001 in ?? ()
#8  0x00007ffd77630440 in ?? ()
#9  0x00000000004011a1 in tired ()

gdb 16 cannot resolve the function name but nothing else, gdb 15 still has gstack without --readnever so that provides all the information I need - files and line numbers.

Reproducible: Always

Steps to Reproduce:
1. gcc -ggdb -Wall -o test test.c
2. sudo ./test
Actual Results:  
gdb 16 omits any file names and line numbers

Expected Results:  
file names/line numbers included, or at least included upon passing some option

If --readnever is a requirement for some use cases it should IMO be toggle-able because right now gstack lost a good part of its rather convenient functionality.

Comment 1 Peter Hutterer 2025-03-26 05:56:54 UTC
Created attachment 2082042 [details]
test.c

Comment 2 Keith Seitz 2025-03-27 13:24:34 UTC
My apologies, --readnever slipped in when I upstreamed our
local gstack Fedora patch. I'll get this fixed and backported.

Comment 3 Keith Seitz 2025-03-28 17:03:36 UTC
PRs pending for f41, f42, and rawhide.

Comment 4 Fedora Update System 2025-03-29 23:19:08 UTC
FEDORA-2025-c457a97ef4 (gdb-16.2-3.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-c457a97ef4

Comment 5 Fedora Update System 2025-03-29 23:19:24 UTC
FEDORA-2025-65b1e5d0e8 (gdb-16.2-2.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-65b1e5d0e8

Comment 6 Fedora Update System 2025-03-30 01:28:20 UTC
FEDORA-2025-65b1e5d0e8 has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-65b1e5d0e8`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-65b1e5d0e8

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2025-03-30 01:58:47 UTC
FEDORA-2025-c457a97ef4 has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-c457a97ef4`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-c457a97ef4

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2025-04-01 00:18:43 UTC
FEDORA-2025-c457a97ef4 (gdb-16.2-3.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Peter Hutterer 2025-04-01 05:16:06 UTC
Thanks for the quick fix, much appreciated

Comment 10 Fedora Update System 2025-04-04 02:31:33 UTC
FEDORA-2025-65b1e5d0e8 (gdb-16.2-2.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.