Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1788636 - strace doesn't print stack trace for early syscalls
Summary: strace doesn't print stack trace for early syscalls
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: strace
Version: 31
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dmitry V. Levin
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1783584
Blocks: 1790052 1790053 1790054 1790057 1790058
TreeView+ depends on / blocked
 
Reported: 2020-01-07 16:42 UTC by Pavel Zhukov
Modified: 2020-01-19 14:52 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1790052 1790053 1790054 1790057 1790058 (view as bug list)
Environment:
Last Closed: 2020-01-07 19:40:11 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Pavel Zhukov 2020-01-07 16:42:33 UTC
Description of problem:
strace -k doesn't produce stack trace due to no dwarf found if it is being attached to running process.

Version-Release number of selected component (if applicable):
strace-5.3-1.fc31.x86_64

# rpm -qa '*-debuginfo'
dhcp-debuginfo-4.4.1-19.fc31.x86_64
dhcp-server-debuginfo-4.4.1-19.fc31.x86_64
glibc-debuginfo-2.30-8.fc31.x86_64

How reproducible:
100%

Steps to Reproduce:
1. dhcpd -f 
2. strace -k -p `pidof dhcpd`


Actual results:
select(9, [5<RAW:[0.0.0.0:1]> 6<socket:[41801]> 8<UDP:[0.0.0.0:67]>], [], NULL, NULL) = ? ERESTARTNOHAND (To be restarted if no handler)
 > No DWARF information found


Expected results:
select(9, [5<RAW:[0.0.0.0:1]> 6<socket:[43189]> 8<UDP:[0.0.0.0:67]>], [], NULL, NULL) = ? ERESTARTNOHAND (To be restarted if no handler)
 > /usr/lib64/libc-2.30.so(__select+0x1a) [0xf8f1a]
 > /usr/sbin/dhcpd(isc__socketmgr_waitevents+0x76) [0x257e06]
 > /usr/sbin/dhcpd(evloop+0x12f) [0x24725f]
 > /usr/sbin/dhcpd(isc__app_ctxrun+0x138) [0x247778]
 > /usr/sbin/dhcpd(dispatch+0x1b) [0x6cf7b]
 > /usr/sbin/dhcpd(main+0xf66) [0x18d16]
 > /usr/lib64/libc-2.30.so(__libc_start_main+0xf2) [0x271a2]
 > /usr/sbin/dhcpd(_start+0x2d) [0x1949d]


Additional info:

If the application is started under strace the option works fine (as per Expected result)

Comment 1 Dmitry V. Levin 2020-01-07 19:40:11 UTC
This happens due to a cache initialization bug that results to a failure of printing stack trace for early syscalls.
Early syscalls in this case are those that precede the first syscall from memory mapping or execve families.
When a process is started by strace itself, the first syscall is usually execve.

Fixed by upstream commit v5.4-18-g69b2c33a77fa687feb41fafdbe187013aa812384, available at
https://github.com/strace/strace/commit/69b2c33a77fa687feb41fafdbe187013aa812384
https://gitlab.com/strace/strace/commit/69b2c33a77fa687feb41fafdbe187013aa812384

Thanks for reporting!

Comment 2 Dmitry V. Levin 2020-01-07 19:44:40 UTC
FWIW, I have no idea when the fix will reach Fedora because updates of strace package are blocked by https://bugzilla.redhat.com/show_bug.cgi?id=1783584

Comment 3 Dmitry V. Levin 2020-01-07 20:12:11 UTC
Meanwhile, you can install a fixed strace package from the scratch build for f31 at
https://koji.fedoraproject.org/koji/taskinfo?taskID=40246259


Note You need to log in before you can comment on or make changes to this bug.