Skip to content

gh-132097: skip tests raising an explicit SIGSEV when UB sanitizer is on #132398

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
Apr 12, 2025

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented Apr 11, 2025

@bedevere-app bedevere-app bot added the tests Tests in the Lib/test dir label Apr 11, 2025
@picnixz picnixz self-assigned this Apr 11, 2025
@picnixz picnixz merged commit e1f93ff into python:main Apr 12, 2025
44 checks passed
@picnixz picnixz deleted the fix/ubsan/forced-sigsev-tests-132097 branch April 12, 2025 07:19
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x Fedora Stable LTO + PGO 3.x (tier-3) has failed when building commit e1f93ff.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1627/builds/124) and take a look at the build logs.
  4. Check if the failure is related to this commit (e1f93ff) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1627/builds/124

Summary of the results of the build (if available):

Click to see traceback logs
remote: Enumerating objects: 17, done.        
remote: Counting objects:   5% (1/17)        
remote: Counting objects:  11% (2/17)        
remote: Counting objects:  17% (3/17)        
remote: Counting objects:  23% (4/17)        
remote: Counting objects:  29% (5/17)        
remote: Counting objects:  35% (6/17)        
remote: Counting objects:  41% (7/17)        
remote: Counting objects:  47% (8/17)        
remote: Counting objects:  52% (9/17)        
remote: Counting objects:  58% (10/17)        
remote: Counting objects:  64% (11/17)        
remote: Counting objects:  70% (12/17)        
remote: Counting objects:  76% (13/17)        
remote: Counting objects:  82% (14/17)        
remote: Counting objects:  88% (15/17)        
remote: Counting objects:  94% (16/17)        
remote: Counting objects: 100% (17/17)        
remote: Counting objects: 100% (17/17), done.        
remote: Compressing objects:  10% (1/10)        
remote: Compressing objects:  20% (2/10)        
remote: Compressing objects:  30% (3/10)        
remote: Compressing objects:  40% (4/10)        
remote: Compressing objects:  50% (5/10)        
remote: Compressing objects:  60% (6/10)        
remote: Compressing objects:  70% (7/10)        
remote: Compressing objects:  80% (8/10)        
remote: Compressing objects:  90% (9/10)        
remote: Compressing objects: 100% (10/10)        
remote: Compressing objects: 100% (10/10), done.        
remote: Total 10 (delta 8), reused 2 (delta 0), pack-reused 0 (from 0)        
From https://github.com/python/cpython
 * branch                    main       -> FETCH_HEAD
Note: switching to 'e1f93ff484236363c6dcc34a8a07133b64e708b5'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at e1f93ff4842 gh-132097: skip tests raising an explicit SIGSEV when UB sanitizer is on (#132398)
Switched to and reset branch 'main'

find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
make[2]: [Makefile:3311: clean-retain-profile] Error 1 (ignored)
Python/ceval.c: In function ‘_PyEvalFramePushAndInit_Ex’:
Python/ceval.c:1848:38: warning: ‘stack_array’ may be used uninitialized [-Wmaybe-uninitialized]
 1848 |     _PyInterpreterFrame *new_frame = _PyEvalFramePushAndInit(
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~
 1849 |         tstate, func, locals,
      |         ~~~~~~~~~~~~~~~~~~~~~         
 1850 |         newargs, nargs, kwnames, previous
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1851 |     );
      |     ~                                 
Python/ceval.c:1771:1: note: by argument 4 of type ‘const union _PyStackRef *’ to ‘_PyEvalFramePushAndInit’ declared here
 1771 | _PyEvalFramePushAndInit(PyThreadState *tstate, _PyStackRef func,
      | ^~~~~~~~~~~~~~~~~~~~~~~
Python/ceval.c:1817:17: note: ‘stack_array’ declared here
 1817 |     _PyStackRef stack_array[8];
      |                 ^~~~~~~~~~~
test test_int failed
make: *** [Makefile:996: profile-run-stamp] Error 2

@vstinner
Copy link
Member

An alternative is to use:

        # Sanitizers must not handle SIGSEGV (ex: for test_enable_fd())
        option = 'handle_segv=0'
        support.set_sanitizer_env_var(env, option)

Code snippet from test_faulthandler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants