Bug 113072 - [PATCH] RHEL3/ia64: strace -f on multithreaded 32 bit applications doesn't work
[PATCH] RHEL3/ia64: strace -f on multithreaded 32 bit applications doesn't work
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel (Show other bugs)
ia64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jason Baron
ia32el fujitsu nec
Depends On:
  Show dependency treegraph
Reported: 2004-01-07 18:55 EST by Arun Sharma
Modified: 2013-03-06 00:56 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-05-11 21:08:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
el3-strace.patch (933 bytes, patch)
2004-01-07 18:59 EST, Arun Sharma
no flags Details | Diff
thread test (1.66 KB, text/plain)
2004-02-25 17:27 EST, Jason Baron
no flags Details
strace -f output (2.81 KB, text/plain)
2004-02-25 17:28 EST, Jason Baron
no flags Details
strace output (4.18 KB, text/plain)
2004-02-25 21:38 EST, Arun Sharma
no flags Details

  None (edit)
Description Arun Sharma 2004-01-07 18:55:55 EST
Description of problem:

strace -f on multithreaded 32 bit applications doesn't work i.e. only
the first thread is straceable.

Version-Release number of selected component (if applicable):


How reproducible:

strace -f one of the NPTL test programs
Comment 1 Arun Sharma 2004-01-07 18:59:26 EST
Created attachment 96822 [details]

The problem happens because the ia64 kernel loads system call arguments from
the memory on to the register stack. strace, when used with the -f flag
modifies some of the system call arguments in memory. Because we're not
reloading the system call arguments from memory, those changes are lost.

The attached patch reloads the system call arguments from the register stack.
The patch is also accepted in 2.6.
Comment 2 Larry Troan 2004-01-12 09:22:43 EST
Arun, is there an Issue Tracker associated with this bug?
Comment 3 Larry Troan 2004-01-19 09:15:54 EST
Issue Tracker 31437 opened as sev 3
Comment 11 Jason Baron 2004-02-19 11:53:57 EST
Arun, what NPTL test programs are you referring to?
Comment 12 Arun Sharma 2004-02-19 14:05:00 EST
Any IA-32 NPTL program. Such as glibc/nptl/tst-basic1.c. 
However, to run ia32 NPTL programs on ia64, you'll need the patch 
attached to Bug #107059.

It might be simpler to reproduce the problem with a non-NPTL 
multithreaded program such as glibc/linuxthreads/Examples/ex1.c

The fix is not specific to NPTL.
Comment 13 Roland McGrath 2004-02-20 18:02:20 EST
Upstream strace just got a patch from David Mosberger that should fix
this.  If the reporter can build strace from the cvs sources on
strace.sourceforge.net, testing that would be helpful.  I'm not sure
off hand where things are set up for IA32 emulation on an RHEL3/IA64
machine in house for me to test.
Comment 14 Arun Sharma 2004-02-20 18:47:44 EST
Are you talking about:

2003-12-31  David Mosberger  <davidm@hpl.hp.com>

	* process.c (struct_user_offsets) [IA64]: Fix up register 
name list.

I can't compile this on RHEL3/ia64.

But any user level change can't possibly fix this problem because the 
kernel is failing to modify system call arguments as requested by 
Comment 15 Jason Baron 2004-02-25 17:27:32 EST
Created attachment 98052 [details]
thread test

thread teset case
Comment 16 Jason Baron 2004-02-25 17:28:21 EST
Created attachment 98053 [details]
strace -f output
Comment 17 Jason Baron 2004-02-25 17:29:43 EST
The 'strace -f' still seems to fail for me with this patch, as shown
in the output in comment 16 with the test case from comment 15. Not
sure what's going on, but i did notice that this patch is different
from the current 2.4 version
Comment 18 Arun Sharma 2004-02-25 18:14:51 EST
The patch is different from 2.4 and 2.6, because of the differences 
in the ptregs layout. The base kernels have the kernel entry/exit 
optimization patch.
Comment 19 Jason Baron 2004-02-25 19:10:12 EST
ok, but you get a correct trace with the program from comment #15?
Comment 20 Arun Sharma 2004-02-25 21:38:35 EST
Created attachment 98059 [details]
strace output

Can't reproduce. Here's how I tested:

- 2.4.21-9.EL
- NPTL patch
- ia32-syscalls-el3.patch (bug #107744)
- sigwait.patch
- missing-paren.patch
- el3-strace.patch

And everything seems to work fine.
Comment 21 Arun Sharma 2004-02-25 21:40:03 EST
Jason, it looks like you're using the 64 bit strace. Can you try the
32 bit strace ?
Comment 22 Jason Baron 2004-02-25 23:09:53 EST
yes that was the problem. thanks.
Comment 24 Tim Burke 2004-03-01 08:06:30 EST
Setting state to modified as Ernie included into U2 on 2/29.
Comment 25 John Flanagan 2004-05-11 21:08:14 EDT
An errata 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.