Skip to content
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

gh-115124: Use _PyObject_ASSERT() in gc.c #115125

Merged
merged 1 commit into from
Feb 15, 2024
Merged

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Feb 7, 2024

Replace assert() with _PyObject_ASSERT() in gc.c to dump the object when an assertion fails.

@vstinner
Copy link
Member Author

vstinner commented Feb 7, 2024

!buildbot Windows11 Bigmem

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @vstinner for commit 468de57 🤖

The command will test the builders whose names match following regular expression: Windows11 Bigmem

The builders matched are:

  • AMD64 Windows11 Bigmem PR

@vstinner
Copy link
Member Author

vstinner commented Feb 7, 2024

cc @pablogsal @DinoV @markshannon

@vstinner
Copy link
Member Author

vstinner commented Feb 7, 2024

AMD64 Windows11 Bigmem PR job: https://buildbot.python.org/all/#/builders/1088/builds/308

@vstinner vstinner force-pushed the gc_assert branch 2 times, most recently from 2b625c7 to 3f8a768 Compare February 12, 2024 15:56
@vstinner
Copy link
Member Author

@pablogsal: I rebased my PR. Would you mind to review the change?

@vstinner
Copy link
Member Author

@colesbury @nascheme: Would you mind to review this change?

Copy link
Contributor

@colesbury colesbury left a comment

Choose a reason for hiding this comment

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

There's a compiler warning, but otherwise LGTM

Python/gc.c Outdated
next isn't, so they can't
be the same */
// wrasgc is reachable, but next isn't, so they can't be the same
_PyObject_ASSERT(wr, wrasgc != next);
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a GitHub actions warning: I think this needs a (PyObject *) cast on wr.

Copy link
Member Author

Choose a reason for hiding this comment

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

Alright, I missed that warning. It's now fixed.

Copy link
Member

@pablogsal pablogsal left a comment

Choose a reason for hiding this comment

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

LGTM modulo the compiler warning

Replace assert() with _PyObject_ASSERT() in gc.c to dump the object
when an assertion fails.
@vstinner
Copy link
Member Author

@colesbury @pablogsal: Thanks for reviews. I rebased my PR on main, fixed the compiler warning, and enabled "auto-merge".

@vstinner vstinner merged commit 94f1334 into python:main Feb 15, 2024
33 checks passed
@vstinner vstinner deleted the gc_assert branch February 15, 2024 14:29
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
Replace assert() with _PyObject_ASSERT() in gc.c to dump the object
when an assertion fails.
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