Skip to content

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

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:gc_assert
Feb 15, 2024
Merged

gh-115124: Use _PyObject_ASSERT() in gc.c#115125
vstinner merged 1 commit into
python:mainfrom
vstinner:gc_assert

Conversation

@vstinner

@vstinnervstinner commented Feb 7, 2024

Copy link
Copy Markdown
Member

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

@vstinner

Copy link
Copy Markdown
MemberAuthor

!buildbot Windows11 Bigmem

@bedevere-bot

Copy link
Copy Markdown

🤖 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
Copy Markdown
MemberAuthor

@vstinner

Copy link
Copy Markdown
MemberAuthor

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

@vstinner
vstinnerforce-pushed the gc_assert branch 2 times, most recently from 2b625c7 to 3f8a768CompareFebruary 12, 2024 15:56
@vstinner

Copy link
Copy Markdown
MemberAuthor

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

@vstinner

Copy link
Copy Markdown
MemberAuthor

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

@colesburycolesbury left a comment

Copy link
Copy Markdown
Contributor

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

Comment threadPython/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
Copy Markdown
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
Copy Markdown
MemberAuthor

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.

@pablogsalpablogsal 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.

LGTM modulo the compiler warning

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

Copy link
Copy Markdown
MemberAuthor

@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:mainFeb 15, 2024
@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.
LukasWoodtli pushed a commit to LukasWoodtli/cpython that referenced this pull request Jan 22, 2025
Replace assert() with _PyObject_ASSERT() in gc.c to dump the object
when an assertion fails.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@vstinner@bedevere-bot@colesbury@pablogsal