Created attachment 398536 [details] Proposed patch Description of problem: strace incorrectly shows the arguments of fadvise() in 32 bit compat programs Version-Release number of selected component (if applicable): strace-4.5.19-1.fc12.x86_64 How reproducible: Always Steps to Reproduce: 1. Find a program that calls posix_fadvise(2). My sample program calls posix_fadvise(2) like this: posix_fadvise(fd, 0, 0, POSIX_FADV_RANDOM); posix_fadvise(fd, 5, 7, POSIX_FADV_SEQUENTIAL); posix_fadvise64(fd, 0, 0, POSIX_FADV_RANDOM); posix_fadvise64(fd, 5, 7, POSIX_FADV_SEQUENTIAL); (The second and third arguments are only to illustrate the problem, they don't actually have any useful meaning.) 2. Compile it as a 32 bit application 3. Run under strace. Actual results: fadvise64(3, 0, 0, POSIX_FADV_NORMAL) = 0 fadvise64(3, 5, 0, 0x7 /* POSIX_FADV_??? */) = 0 fadvise64_64(3, 0, 0, POSIX_FADV_NORMAL) = 0 fadvise64_64(3, 5, 0, 0x7 /* POSIX_FADV_??? */) = 0 Expected results: fadvise64(3, 0, 0, POSIX_FADV_RANDOM) = 0 fadvise64(3, 5, 7, POSIX_FADV_SEQUENTIAL) = 0 fadvise64_64(3, 0, 0, POSIX_FADV_RANDOM) = 0 fadvise64_64(3, 5, 7, POSIX_FADV_SEQUENTIAL) = 0 Additional info: I originally came across this problem when looking at the fadvise() compat syscall in bug 559410. Having strace print rubbish doesn't help when you are trying to fix problems :-) The attached patch fixes this problem, it is based on this upstream commit: commit b5600fc3df0453ba11f254a9b49add3ffbec9733 Author: Andreas Schwab <schwab> Date: Wed Nov 4 17:08:34 2009 +0100 (The changes are merely needed to make it apply cleanly.)
See also bug 571432 (Fedora 12)
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux release for currently deployed products. This request is not yet committed for inclusion in a release.
This bug is marked NEEDINFO. Do you need information from me? It's a over two years since I filed this bug, but I can probably find whatever you need somewhere.
Michal, if John can't get you a test program it wouldn't be that hard to write our own. All I think we have to do is open a file descriptor, then call fadvise on it like this posix_fadvise (fd, 0, 0, POSIX_FADV_NORMAL); posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL); posix_fadvise (fd, 0, 0, POSIX_FADV_RANDOM); posix_fadvise (fd, 0, 0, POSIX_FADV_NOREUSE); posix_fadvise (fd, 0, 0, POSIX_FADV_WILLNEED); posix_fadvise (fd, 0, 0, POSIX_FADV_DONTNEED); Then again for posix_fadvise64. Then run the resulting program under strace confirming that the last argument is correct.
Created attachment 574903 [details] Program to demonstrate the bug Compile this as a 32 bit application on a 64 bit machine, then run "strace ./a.out". You'll see an open(), two fadvise64() and two fadvise64_64() calls towards the end. All of them should work.
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. http://rhn.redhat.com/errata/RHBA-2013-0010.html