Bug 192193 - statistics broken when switching personalities
statistics broken when switching personalities
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: strace (Show other bugs)
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Roland McGrath
Brian Brock
Depends On:
Blocks: 176344 200893
  Show dependency treegraph
Reported: 2006-05-18 05:47 EDT by Bastien Nocera
Modified: 2007-11-30 17:07 EST (History)
4 users (show)

See Also:
Fixed In Version: RHBA-2007-0302
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-05-07 20:25:13 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
strace-alt-call_summary.diff (3.32 KB, patch)
2006-12-13 19:25 EST, Dmitry V. Levin
no flags Details | Diff

  None (edit)
Description Bastien Nocera 2006-05-18 05:47:36 EDT

$ cat helloWorld.c
#include <stdio.h>

int main ( void )
    printf( "Hello World\n" );
    return 0;
$ gcc -g -m32 -o helloWorld helloWorld.c
$ strace -c ./helloWorld
[ Process PID=18962 runs in 32 bit mode. ]
Hello World
Process 18962 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
  3.96 1275605287168.1374389535023 4196074544597155       304           sendto
  4.51 1451698946383.1460288880979 4257185943319299       341       342 recv
  4.19 1348619729142.1425929142603 4049913378592020       333       334 send
Segmentation fault

The bt under ElectricFence:
2752                    if (counts == NULL || counts[i].calls == 0)
(gdb) bt
#0  0x0000000000405a41 in call_summary (outf=0x3d8e72e680) at syscall.c:2752
#1  0x0000000000403362 in main (argc=18945, argv=0x0) at strace.c:676
#2  0x0000003d8e51c4bb in __libc_start_main (main=0x402c00 <main>, argc=3,
   ubp_av=0x7fbffff6f8, init=0x413500 <__libc_csu_init>, fini=Variable "fini" is
not available.
   at ../sysdeps/generic/libc-start.c:209
(gdb) p i
$3 = 254

A good explanation of the problem from Bryan Mason:
Not only do x86_64 and i386 personalities have different numbers of syscalls
(i386 has 343 and x86_64 has 254), but the syscalls have different numbers.  For
example execve is syscall number 11 in i386 but it's syscall number 59 on x86_64.

The crash occurs when trying to access syscalls > 254.

The work-around is obviously to use the 32-bit strace in the meanwhile.
Comment 2 RHEL Product and Program Management 2006-08-18 11:50:56 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 4 Dmitry V. Levin 2006-12-13 19:25:31 EST
Created attachment 143584 [details]

Proposed fix, please test.
Comment 5 Dmitry V. Levin 2006-12-21 06:46:09 EST
Fixed upstream.
Comment 6 Roland McGrath 2007-01-11 06:16:17 EST
these bugs are fixed upstream in the coming 4.5.15 release
Comment 7 Roland McGrath 2007-01-30 02:46:21 EST
This bug should be fixed in strace-4.5.15-1.el4 rpms.
Comment 12 Red Hat Bugzilla 2007-05-07 20:25:13 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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