Skip to content

Conversation

@stratakis
Copy link
Contributor

@stratakis stratakis commented Dec 16, 2025

The jitdump specification specifies a reserved field for padding.

Initialize it so no garbage data is embedded in the jitdump files.

The jitdump specification specifies a reserved field for padding.

Initialize it so no garbage data is embedded in the jitdump files.
@stratakis
Copy link
Contributor Author

cc @pablogsal

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perf_map_jit_write_header() allocates the header on the stack memory:

static void perf_map_jit_write_header(int pid, FILE* out_file) {
    Header header;        

It's correct to initialize the reserved member to 0. Header structure says:

    uint32_t reserved;           // Reserved field (must be 0)

@vstinner vstinner merged commit 77bf4ba into python:main Jan 22, 2026
56 checks passed
@miss-islington-app
Copy link

Thanks @stratakis for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 22, 2026
…GH-142780)

The jitdump specification specifies a reserved field for padding.

Initialize it so no garbage data is embedded in the jitdump files.
(cherry picked from commit 77bf4ba)

Co-authored-by: stratakis <cstratak@redhat.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 22, 2026
…GH-142780)

The jitdump specification specifies a reserved field for padding.

Initialize it so no garbage data is embedded in the jitdump files.
(cherry picked from commit 77bf4ba)

Co-authored-by: stratakis <cstratak@redhat.com>
@bedevere-app
Copy link

bedevere-app bot commented Jan 22, 2026

GH-144159 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 Jan 22, 2026
@bedevere-app
Copy link

bedevere-app bot commented Jan 22, 2026

GH-144160 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jan 22, 2026
@vstinner
Copy link
Member

Merged, thanks for the fix. I backported the change to 3.13 and 3.14 branches.

vstinner pushed a commit that referenced this pull request Jan 22, 2026
…2780) (#144160)

gh-142779: Initialize reserved field for proper padding (GH-142780)

The jitdump specification specifies a reserved field for padding.

Initialize it so no garbage data is embedded in the jitdump files.
(cherry picked from commit 77bf4ba)

Co-authored-by: stratakis <cstratak@redhat.com>
@bedevere-bot
Copy link

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

Hi! The buildbot ARM64 macOS 3.13 (tier-2) has failed when building commit e4e36a7.

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/1404/builds/1485) and take a look at the build logs.
  4. Check if the failure is related to this commit (e4e36a7) 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/1404/builds/1485

Failed tests:

  • test_urllib2net

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

==

Click to see traceback logs
remote: Enumerating objects: 4, done.        
remote: Counting objects:  50% (1/2)        
remote: Counting objects: 100% (2/2)        
remote: Counting objects: 100% (2/2), done.        
remote: Total 4 (delta 1), reused 1 (delta 1), pack-reused 2 (from 1)        
From https://github.com/python/cpython
 * branch                    3.13       -> FETCH_HEAD
Note: switching to 'e4e36a716a779887d5b8d2411810a2bec60c4df2'.

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 e4e36a716a7 [3.13] gh-142779: Initialize reserved field for proper padding (GH-142780) (#144160)
Switched to and reset branch '3.13'

./Modules/selectmodule.c:1988:35: warning: cast from 'PyObject *(*)(PyObject *)' (aka 'struct _object *(*)(struct _object *)') to 'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct _object *)') converts to incompatible function type [-Wcast-function-type-mismatch]
 1988 |     "kqueue_tracking_after_fork", (PyCFunction)kqueue_tracking_after_fork,
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

make: *** [buildbottest] Error 2

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