Bug 902788 - RFE: strace should interpret also the direction and size fields for the ioctl() syscall
Summary: RFE: strace should interpret also the direction and size fields for the ioctl...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: strace
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dmitry V. Levin
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-22 11:51 UTC by Dan Horák
Modified: 2015-03-13 17:23 UTC (History)
3 users (show)

Fixed In Version: strace-4.10-1.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-13 16:56:20 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Dan Horák 2013-01-22 11:51:26 UTC
My understanding is that the strace tool now interprets only the type and number sub-fields (lower 8+8 bits) of request passed to the ioctl() syscall and convert this value to the textual representation. The Linux kernel uses 2 additional fields (direction and size) encoded in the request, but their exact bit sizes depend on platform.

see this output of a test in Ruby test-suite run on Fedora/ppc64
...
open("/dev/urandom", O_RDONLY)          = 5
fstat(5, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 9), ...}) = 0
fstat(5, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 9), ...}) = 0
ioctl(5, TCGETS, 0x3ffffb378ad0)        = -1 EINVAL (Invalid argument)
ioctl(5, RNDGETENTCNT, 0x1001000bd40)   = -1 EINVAL (Invalid argument)
...

The problem here is that the test uses 0x80045200 hardcoded value for the request which valid on x86 and few other arches, while on ppc/ppc64 it should be 0x40045200, the bit sizes differs between x86 (14+2 bits) and ppc (13+3 bits). I think that when strace would interpret also the size and direction fields it would help debugging such problems.

Please see include/uapi/asm-generic/ioctl.h and arch/powerpc/include/uapi/asm/ioctl.h kernel headers for the details about the encoding.

Comment 1 Fedora End Of Life 2013-12-21 10:41:35 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Dmitry V. Levin 2015-02-09 00:48:12 UTC
Full 32-bit ioctl command decoding was implemented in commit v4.9-222-gdf7aa2b:
http://sourceforge.net/p/strace/code/ci/df7aa2b19e6f69c19fbe09180bf1ec4fb52e2615

Comment 3 Fedora Update System 2015-03-06 17:29:39 UTC
strace-4.10-1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/strace-4.10-1.fc22

Comment 4 Fedora Update System 2015-03-06 17:59:46 UTC
strace-4.10-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/strace-4.10-1.fc21

Comment 5 Fedora Update System 2015-03-06 18:24:56 UTC
strace-4.10-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/strace-4.10-1.fc20

Comment 6 Fedora Update System 2015-03-09 08:20:06 UTC
Package strace-4.10-1.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing strace-4.10-1.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-3365/strace-4.10-1.fc21
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2015-03-13 16:56:20 UTC
strace-4.10-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2015-03-13 17:12:36 UTC
strace-4.10-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2015-03-13 17:23:13 UTC
strace-4.10-1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.


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