Skip to content

gh-146388: Add null check for sym_new(ctx) in make_bottom#146389

Open
A0su wants to merge 7 commits intopython:mainfrom
A0su:Fix_null_deref_in_make_bottom
Open

gh-146388: Add null check for sym_new(ctx) in make_bottom#146389
A0su wants to merge 7 commits intopython:mainfrom
A0su:Fix_null_deref_in_make_bottom

Conversation

@A0su
Copy link
Contributor

@A0su A0su commented Mar 24, 2026

optimizer_symbols.c: make_bottom NULL deref when arena full

sym_new(ctx) at line 1535 can return NULL when the type arena is full. Result immediately dereferenced without check. Every other sym_new call site checks for NULL.

This is a sub-issue of #146102 with gist details

@bedevere-app
Copy link

bedevere-app bot commented Mar 24, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented Mar 24, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@A0su A0su marked this pull request as draft March 24, 2026 19:42
@bedevere-app
Copy link

bedevere-app bot commented Mar 24, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@A0su A0su marked this pull request as ready for review March 25, 2026 01:58
@aisk
Copy link
Member

aisk commented Mar 26, 2026

I think this fix is simple enough which doesn't requires a test, but the news entry is required. Can you add it follow the Dev Guide? https://devguide.python.org/getting-started/pull-request-lifecycle/#updating-news-and-what-s-new-in-python

@A0su
Copy link
Contributor Author

A0su commented Mar 26, 2026

@aisk, blurb added. Thanks for the review!

@@ -0,0 +1 @@
Add a null check for :func:`sym_new(ctx)` in :func:`make_bottom`
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't tell much. Can it be more descriptive please? Something like

Handle when JIT optimizer runs out of space when dealing with contradictions.

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.

4 participants