Skip to content

gh-158961: Fix JIT crashes with UBSan - #159119

Open
ashm-dev wants to merge 1 commit into
python:3.14from
ashm-dev:gh-158961
Open

ashm-dev wants to merge 1 commit into
python:3.14from
ashm-dev:gh-158961

Conversation

@ashm-dev

@ashm-dev ashm-dev commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

@ashm-dev ashm-dev changed the title fix(jit): avoid crashes with UBSan gh-158961: Fix JIT crashes with UBSan Oct 10, 2026

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am pretty sure we already had this kind of PR with the memcpy stuff that you once posted and IIRC it was not enough, but maybe this was not this specific code (and maybe it was on aarch64 only i do not remember).

Can you find that issue and see if this change fixed it? IIRC the memcpy was not enoigh for some reason or ended up being impacting performances.

Comment on lines +21 to +25
static inline _Py_CODEUNIT* _Py_NO_SANITIZE_UNDEFINED
_PyJIT_Entry(jit_func jitted, _PyInterpreterFrame *frame,
_PyStackRef *stack_pointer, PyThreadState *tstate)
{
return jitted(frame, stack_pointer, tstate);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
static inline _Py_CODEUNIT* _Py_NO_SANITIZE_UNDEFINED
_PyJIT_Entry(jit_func jitted, _PyInterpreterFrame *frame,
_PyStackRef *stack_pointer, PyThreadState *tstate)
{
return jitted(frame, stack_pointer, tstate);
static inline _Py_CODEUNIT *_Py_NO_SANITIZE_UNDEFINED
_PyJIT_Entry(jit_func jitted, _PyInterpreterFrame *frame,
_PyStackRef *stack_pointer, PyThreadState *tstate)
{
return jitted(frame, stack_pointer, tstate);

@@ -0,0 +1,3 @@
Fix crashes when entering JIT-compiled code with UndefinedBehaviorSanitizer

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Those are not really fixed just suppressed.

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.

2 participants