RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1790053 - [RHEL 8] strace doesn't print stack trace for early syscalls
Summary: [RHEL 8] strace doesn't print stack trace for early syscalls
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: strace
Version: 8.2
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: 8.2
Assignee: Eugene Syromiatnikov
QA Contact: Edjunior Barbosa Machado
URL:
Whiteboard:
Depends On: 1783584 1788636 1790054 1790057 1790058
Blocks: 1710951 1711971
TreeView+ depends on / blocked
 
Reported: 2020-01-11 15:01 UTC by Eugene Syromiatnikov
Modified: 2020-12-20 06:07 UTC (History)
10 users (show)

Fixed In Version: strace-4.24-8.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1788636
Environment:
Last Closed: 2020-04-28 17:00:14 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
IBM Linux Technology Center 183358 0 None None None 2020-01-19 14:46:24 UTC
Red Hat Product Errata RHBA-2020:1888 0 None None None 2020-04-28 17:00:24 UTC

Description Eugene Syromiatnikov 2020-01-11 15:01:45 UTC
+++ This bug was initially created as a clone of Bug #1788636 +++

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)

--- Additional comment from Dmitry V. Levin on 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!

--- Additional comment from Dmitry V. Levin on 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

--- Additional comment from Dmitry V. Levin on 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

Comment 1 Eugene Syromiatnikov 2020-01-22 23:53:09 UTC
Upstream commits:
69b2c33a77fa687feb41fafdbe187013aa812384 "unwind-libdw: fix initialization of libdwfl cache"
35e080ae319d25c1df82855cda3a1bb014e90ba6 "syscall: do not capture stack trace while the tracee executes strace code"
8e515c744935fe67e6a1b941f4c5414472c163b7 "tests: add strace-k-p test"

Comment 2 Eugene Syromiatnikov 2020-01-23 14:12:45 UTC
Correction: 35e080ae319d25c1df82855cda3a1bb014e90ba6 "syscall: do not capture stack trace while the tracee executes strace code" is not needed, as it is based on top of  v4.26~72 "Enhance error diagnostics when the first exec fails".

Comment 5 Edjunior Barbosa Machado 2020-02-04 16:32:11 UTC
Verified that strace-4.24-9.el8 now presents stack trace as expected.

The only minor nitpick is that, on aarch64 only, the "No DWARF information found" message still appears after the trace:

strace: Process 23953 attached
pselect6(1024, [3], NULL, NULL, NULL, NULL) = ? ERESTARTNOHAND (To be restarted if no handler)
 > /usr/lib64/libc-2.28.so(__select+0x74) [0xc9e7c]
 > /tmp/tmp.MitN3JhK0p/tcpserver(main+0xf7) [0x400c9b]
 > /usr/lib64/libc-2.28.so(__libc_start_main+0xe3) [0x20be3]
 > /tmp/tmp.MitN3JhK0p/tcpserver(.annobin_elf_init.c_end.exit+0x4b) [0x4009bb]
 > /tmp/tmp.MitN3JhK0p/tcpserver(.annobin_elf_init.c_end.exit+0x4b) [0x4009bb]
 > No DWARF information found
--- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=23540, si_uid=0} ---
+++ killed by SIGTERM +++

Comment 9 errata-xmlrpc 2020-04-28 17:00:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:1888


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