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 2028163 - [RHEL 8 GTS] assertion when using 'xx' arguments to strace
Summary: [RHEL 8 GTS] assertion when using 'xx' arguments to strace
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: strace
Version: 8.6
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Eugene Syromiatnikov
QA Contact: Jesus Checa
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-01 15:56 UTC by Eugene Syromiatnikov
Modified: 2022-05-10 14:50 UTC (History)
4 users (show)

Fixed In Version: gcc-toolset-11-strace-5.13-5.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2028146
Environment:
Last Closed: 2022-05-10 14:21:17 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-104474 0 None None None 2021-12-01 16:04:20 UTC
Red Hat Product Errata RHBA-2022:1929 0 None None None 2022-05-10 14:21:24 UTC

Description Eugene Syromiatnikov 2021-12-01 15:56:22 UTC
+++ This bug was initially created as a clone of Bug #2028146 +++

Backtrace:

...
(gdb) bt
#0  die () at strace.c:313
#1  0x000000000040d883 in error_msg_and_die (fmt=fmt@entry=0x4640e8 "%s: got unexpected return value %d for snprintf(buf, %zu, %s)") at error_prints.c:74
#2  0x000000000042152a in xsnprintf_ (str=0x6f9a20 <res.6552> "if_nametoindex(\"\\x62\\x6c\\x69\\x6e\\x6", size=36, func=0x484ede <__func__.6555> "get_ifname", argstr=0x484eb0 "(\"if_nametoindex(\" \"%s\" \")\"), name_quoted_buf", 
    format=0x484e9b "if_nametoindex(%s)", format=0x484e9b "if_nametoindex(%s)", argstr=0x484eb0 "(\"if_nametoindex(\" \"%s\" \")\"), name_quoted_buf", func=0x484ede <__func__.6555> "get_ifname", size=36, 
    str=0x6f9a20 <res.6552> "if_nametoindex(\"\\x62\\x6c\\x69\\x6e\\x6") at xstring.h:36
#3  0x0000000000421596 in get_ifname (ifindex=6) at print_ifindex.c:31
#4  print_ifindex (ifindex=6) at print_ifindex.c:44
#5  0x0000000000427a7d in decode_ndmsg (tcp=0x712370, nlmsghdr=<optimized out>, family=<optimized out>, addr=140215372832688, len=60) at rtnl_neigh.c:86
#6  0x000000000041c5c8 in decode_netlink_route (tcp=tcp@entry=0x712370, nlmsghdr=nlmsghdr@entry=0x7fffffffe0b0, addr=addr@entry=140215372832688, len=len@entry=60) at netlink_route.c:120
...

  The problem in frame #3:

(gdb) f 3
#3  0x0000000000421596 in get_ifname (ifindex=6) at print_ifindex.c:31
31			xsprintf(res, INI_PFX "%s" INI_SFX, name_quoted_buf);
(gdb) info local
name_buf = "blink1\000\000\000\000\000\000\000\000\000"
name_quoted_buf = "\"\\x62\\x6c\\x69\\x6e\\x"
res = "if_nametoindex(\"\\x62\\x6c\\x69\\x6e\\x6"
res = "if_nametoindex(\"\\x62\\x6c\\x69\\x6e\\x6"
__func__ = "get_ifname"

  The fix could be to check the 'xflag' global variable and not print in hex
the name, but since all strings are printed in hex, the most likely fix should
be to rework the code in print_ifindex.c. This appears to be buggy:

# define IFNAME_QUOTED_SZ (sizeof(IFNAMSIZ) * 4 + 3)

as it most likely should mean:

# define IFNAME_QUOTED_SZ (IFNAMSIZ * 4 + 3)

because, otherwise it should result in:

sizeof(IFNAMSIZ) that is the same as sizeof(16) and return 4 (as literal
16 should default to type int). So, the code likely did already prepare for
printing in hex, but due to a mistake, used sizeof.

Comment 1 Eugene Syromiatnikov 2021-12-02 21:49:42 UTC
Fixed upstream in strace commit v5.15~1[1].

[1] https://gitlab.com/strace/strace/-/commit/e27b0677

Comment 5 Jesus Checa 2022-01-10 13:04:20 UTC
Verified with TC#612760. Fixed build gcc-toolset-11-strace-5.13-5.el8 does not reproduce the bug anymore. Complete regtest looks good as well.

Comment 9 errata-xmlrpc 2022-05-10 14:21:17 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 (gcc-toolset-11-strace bug fix and enhancement update), 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-2022:1929


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