Skip to content

gh-133741: Fix _can_strace(): check --trace option #133766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2025

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented May 9, 2025

The --trace option needs strace 5.5 or newer.

The --trace option needs strace 5.5 or newer.
@vstinner
Copy link
Member Author

vstinner commented May 9, 2025

@pablogsal: Would you be able to test this change on RHEL7?

@pablogsal
Copy link
Member

(refroot)$ python3.14 -m test test_fileio -v
== CPython 3.14.0b1 (main, May 8 2025, 10:45:27) [Clang 20.1.0 ]
== Linux-3.10.0-957.35.2.el7.x86_64-x86_64-with-glibc2.17 little-endian
== Python build: release shared
== cwd: /bb/data/tmp/test_python_worker_50669æ
== CPU count: 15 (process) / 16 (system)
== encodings: locale=UTF-8 FS=utf-8
== resources: all test resources are disabled, use -u option to unskip tests

Using random seed: 4196976212
0:00:00 load avg: 4.96 Run 1 test sequentially in a single process
0:00:00 load avg: 4.96 [1/1] test_fileio
test_fileio skipped -- need strace 5.5 or newer, found strace 4.12
0:00:00 load avg: 4.96 [1/1] test_fileio skipped

== Tests result: SUCCESS ==

1 test skipped:
    test_fileio

Total duration: 66 ms
Total tests: run=0
Total test files: run=1/1 skipped=1
Result: SUCCESS
(refroot)$ vim refroot/amd64/opt/bb/lib64/python3.14/test/support/strace_helper.py
(refroot)$ python3.14 -m test test_fileio -v
== CPython 3.14.0b1 (main, May 8 2025, 10:45:27) [Clang 20.1.0 ]
== Linux-3.10.0-957.35.2.el7.x86_64-x86_64-with-glibc2.17 little-endian
== Python build: release shared
== cwd: /bb/data/tmp/test_python_worker_96457æ
== CPU count: 15 (process) / 16 (system)
== encodings: locale=UTF-8 FS=utf-8
== resources: all test resources are disabled, use -u option to unskip tests

Using random seed: 583809345
0:00:00 load avg: 4.36 Run 1 test sequentially in a single process
0:00:00 load avg: 4.36 [1/1] test_fileio
testAttributes (test.test_fileio.CAutoFileTests.testAttributes) ... ok
testBlksize (test.test_fileio.CAutoFileTests.testBlksize) ... ok
testErrnoOnClose (test.test_fileio.CAutoFileTests.testErrnoOnClose) ... ok
testErrnoOnClosedFileno (test.test_fileio.CAutoFileTests.testErrnoOnClosedFileno) ... ok
testErrnoOnClosedIsatty (test.test_fileio.CAutoFileTests.testErrnoOnClosedIsatty) ... ok
testErrnoOnClosedRead (test.test_fileio.CAutoFileTests.testErrnoOnClosedRead) ... ok
testErrnoOnClosedReadable (test.test_fileio.CAutoFileTests.testErrnoOnClosedReadable) ... ok
testErrnoOnClosedReadall (test.test_fileio.CAutoFileTests.testErrnoOnClosedReadall) ... ok
testErrnoOnClosedReadinto (test.test_fileio.CAutoFileTests.testErrnoOnClosedReadinto) ... ok
testErrnoOnClosedSeek (test.test_fileio.CAutoFileTests.testErrnoOnClosedSeek) ... ok
testErrnoOnClosedSeekable (test.test_fileio.CAutoFileTests.testErrnoOnClosedSeekable) ... ok
testErrnoOnClosedTell (test.test_fileio.CAutoFileTests.testErrnoOnClosedTell) ... ok
testErrnoOnClosedTruncate (test.test_fileio.CAutoFileTests.testErrnoOnClosedTruncate) ... ok
testErrnoOnClosedWritable (test.test_fileio.CAutoFileTests.testErrnoOnClosedWritable) ... ok
testErrnoOnClosedWrite (test.test_fileio.CAutoFileTests.testErrnoOnClosedWrite) ... ok
testErrors (test.test_fileio.CAutoFileTests.testErrors) ... ok
testMethods (test.test_fileio.CAutoFileTests.testMethods) ... ok
testOpenDirFD (test.test_fileio.CAutoFileTests.testOpenDirFD) ... ok
testOpendir (test.test_fileio.CAutoFileTests.testOpendir) ... ok
testReadintoByteArray (test.test_fileio.CAutoFileTests.testReadintoByteArray) ... ok
testRecursiveRepr (test.test_fileio.CAutoFileTests.testRecursiveRepr) ... ok
testRepr (test.test_fileio.CAutoFileTests.testRepr) ... ok
testReprNoCloseFD (test.test_fileio.CAutoFileTests.testReprNoCloseFD) ... ok
testSeekTell (test.test_fileio.CAutoFileTests.testSeekTell) ... ok
testWeakRefs (test.test_fileio.CAutoFileTests.testWeakRefs) ... ok
testWritelinesError (test.test_fileio.CAutoFileTests.testWritelinesError) ... ok
testWritelinesList (test.test_fileio.CAutoFileTests.testWritelinesList) ... ok
testWritelinesUserList (test.test_fileio.CAutoFileTests.testWritelinesUserList) ... ok
test_none_args (test.test_fileio.CAutoFileTests.test_none_args) ... ok
test_reject (test.test_fileio.CAutoFileTests.test_reject) ... ok
test_subclass_repr (test.test_fileio.CAutoFileTests.test_subclass_repr) ... ok
test_syscalls_read (test.test_fileio.CAutoFileTests.test_syscalls_read)
Check set of system calls during common I/O patterns ... skipped 'Requires working strace'
testAbles (test.test_fileio.COtherFileTests.testAbles) ... ok
testAppend (test.test_fileio.COtherFileTests.testAppend) ... ok
testBadModeArgument (test.test_fileio.COtherFileTests.testBadModeArgument) ... ok
testBooleanFd (test.test_fileio.COtherFileTests.testBooleanFd) ... ok
testBytesOpen (test.test_fileio.COtherFileTests.testBytesOpen) ... ok
testConstructorHandlesNULChars (test.test_fileio.COtherFileTests.testConstructorHandlesNULChars) ... ok
testInvalidFd (test.test_fileio.COtherFileTests.testInvalidFd) ... ok
testInvalidFd_overflow (test.test_fileio.COtherFileTests.testInvalidFd_overflow) ... ok
testInvalidInit (test.test_fileio.COtherFileTests.testInvalidInit) ... ok
testInvalidModeStrings (test.test_fileio.COtherFileTests.testInvalidModeStrings) ... ok
testModeStrings (test.test_fileio.COtherFileTests.testModeStrings) ... ok
testTruncate (test.test_fileio.COtherFileTests.testTruncate) ... ok
testTruncateOnWindows (test.test_fileio.COtherFileTests.testTruncateOnWindows) ... ok
testUnclosedFDOnException (test.test_fileio.COtherFileTests.testUnclosedFDOnException) ... ok
testUnicodeOpen (test.test_fileio.COtherFileTests.testUnicodeOpen) ... ok
testUtf8BytesOpen (test.test_fileio.COtherFileTests.testUtf8BytesOpen) ... ok
testWarnings (test.test_fileio.COtherFileTests.testWarnings) ... ok
test_open_code (test.test_fileio.COtherFileTests.test_open_code) ... ok
testAttributes (test.test_fileio.PyAutoFileTests.testAttributes) ... ok
testBlksize (test.test_fileio.PyAutoFileTests.testBlksize) ... ok
testErrnoOnClose (test.test_fileio.PyAutoFileTests.testErrnoOnClose) ... ok
testErrnoOnClosedFileno (test.test_fileio.PyAutoFileTests.testErrnoOnClosedFileno) ... ok
testErrnoOnClosedIsatty (test.test_fileio.PyAutoFileTests.testErrnoOnClosedIsatty) ... ok
testErrnoOnClosedRead (test.test_fileio.PyAutoFileTests.testErrnoOnClosedRead) ... ok
testErrnoOnClosedReadable (test.test_fileio.PyAutoFileTests.testErrnoOnClosedReadable) ... ok
testErrnoOnClosedReadall (test.test_fileio.PyAutoFileTests.testErrnoOnClosedReadall) ... ok
testErrnoOnClosedReadinto (test.test_fileio.PyAutoFileTests.testErrnoOnClosedReadinto) ... ok
testErrnoOnClosedSeek (test.test_fileio.PyAutoFileTests.testErrnoOnClosedSeek) ... ok
testErrnoOnClosedSeekable (test.test_fileio.PyAutoFileTests.testErrnoOnClosedSeekable) ... ok
testErrnoOnClosedTell (test.test_fileio.PyAutoFileTests.testErrnoOnClosedTell) ... ok
testErrnoOnClosedTruncate (test.test_fileio.PyAutoFileTests.testErrnoOnClosedTruncate) ... ok
testErrnoOnClosedWritable (test.test_fileio.PyAutoFileTests.testErrnoOnClosedWritable) ... ok
testErrnoOnClosedWrite (test.test_fileio.PyAutoFileTests.testErrnoOnClosedWrite) ... ok
testErrors (test.test_fileio.PyAutoFileTests.testErrors) ... ok
testMethods (test.test_fileio.PyAutoFileTests.testMethods) ... ok
testOpenDirFD (test.test_fileio.PyAutoFileTests.testOpenDirFD) ... ok
testOpendir (test.test_fileio.PyAutoFileTests.testOpendir) ... ok
testReadintoByteArray (test.test_fileio.PyAutoFileTests.testReadintoByteArray) ... ok
testRecursiveRepr (test.test_fileio.PyAutoFileTests.testRecursiveRepr) ... ok
testRepr (test.test_fileio.PyAutoFileTests.testRepr) ... ok
testReprNoCloseFD (test.test_fileio.PyAutoFileTests.testReprNoCloseFD) ... ok
testSeekTell (test.test_fileio.PyAutoFileTests.testSeekTell) ... ok
testWeakRefs (test.test_fileio.PyAutoFileTests.testWeakRefs) ... ok
testWritelinesError (test.test_fileio.PyAutoFileTests.testWritelinesError) ... ok
testWritelinesList (test.test_fileio.PyAutoFileTests.testWritelinesList) ... ok
testWritelinesUserList (test.test_fileio.PyAutoFileTests.testWritelinesUserList) ... ok
test_none_args (test.test_fileio.PyAutoFileTests.test_none_args) ... ok
test_reject (test.test_fileio.PyAutoFileTests.test_reject) ... ok
test_subclass_repr (test.test_fileio.PyAutoFileTests.test_subclass_repr) ... ok
test_syscalls_read (test.test_fileio.PyAutoFileTests.test_syscalls_read)
Check set of system calls during common I/O patterns ... skipped 'Requires working strace'
testAbles (test.test_fileio.PyOtherFileTests.testAbles) ... ok
testAppend (test.test_fileio.PyOtherFileTests.testAppend) ... ok
testBadModeArgument (test.test_fileio.PyOtherFileTests.testBadModeArgument) ... ok
testBooleanFd (test.test_fileio.PyOtherFileTests.testBooleanFd) ... ok
testBytesOpen (test.test_fileio.PyOtherFileTests.testBytesOpen) ... ok
testConstructorHandlesNULChars (test.test_fileio.PyOtherFileTests.testConstructorHandlesNULChars) ... ok
testInvalidFd (test.test_fileio.PyOtherFileTests.testInvalidFd) ... ok
testInvalidInit (test.test_fileio.PyOtherFileTests.testInvalidInit) ... ok
testInvalidModeStrings (test.test_fileio.PyOtherFileTests.testInvalidModeStrings) ... ok
testModeStrings (test.test_fileio.PyOtherFileTests.testModeStrings) ... ok
testTruncate (test.test_fileio.PyOtherFileTests.testTruncate) ... ok
testTruncateOnWindows (test.test_fileio.PyOtherFileTests.testTruncateOnWindows) ... ok
testUnclosedFDOnException (test.test_fileio.PyOtherFileTests.testUnclosedFDOnException) ... ok
testUnicodeOpen (test.test_fileio.PyOtherFileTests.testUnicodeOpen) ... ok
testUtf8BytesOpen (test.test_fileio.PyOtherFileTests.testUtf8BytesOpen) ... ok
testWarnings (test.test_fileio.PyOtherFileTests.testWarnings) ... ok
test_open_code (test.test_fileio.PyOtherFileTests.test_open_code) ... ok

----------------------------------------------------------------------
Ran 99 tests in 0.042s

OK (skipped=2)
0:00:00 load avg: 4.36 [1/1] test_fileio passed

== Tests result: SUCCESS ==

1 test OK.

Total duration: 130 ms
Total tests: run=99 skipped=2
Total test files: run=1/1
Result: SUCCESS

@vstinner
Copy link
Member Author

vstinner commented May 9, 2025

Check set of system calls during common I/O patterns ... skipped 'Requires working strace'

Nice, the change works as expected.

@vstinner vstinner merged commit 6708628 into python:main May 9, 2025
44 checks passed
@vstinner vstinner deleted the can_strace branch May 9, 2025 16:25
@miss-islington-app
Copy link

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 9, 2025
…3766)

The --trace option needs strace 5.5 or newer.
(cherry picked from commit 6708628)

Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-app
Copy link

bedevere-app bot commented May 9, 2025

GH-133774 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label May 9, 2025
vstinner added a commit that referenced this pull request May 9, 2025
…#133774)

gh-133741: Fix _can_strace(): check --trace option (GH-133766)

The --trace option needs strace 5.5 or newer.
(cherry picked from commit 6708628)

Co-authored-by: Victor Stinner <vstinner@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants