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

bpo-42979: Use _Py_CheckSlotResult() to check slots result #24356

Merged
merged 1 commit into from Jan 29, 2021

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Jan 28, 2021

When Python is built in debug mode (with C assertions), calling a
type slot like sq_length (len() in Python) now fails with a fatal
error if the slot succeeded with an exception set, or failed with no
exception set.

  • Check the result of all slots using _Py_CheckSlotResult().
  • No longer pass op_name to ternary_op() in release mode.
  • Replace operator with dunder Python method name in error messages.
    For example, replace "*" with "mul".
  • Fix compiler_exit_scope() when an exception is set.
  • Fix bytearray.extend() when an exception is set: don't call
    bytearray_setslice() with an exception set.

https://bugs.python.org/issue42979

@vstinner vstinner requested review from markshannon and rhettinger as code owners Jan 28, 2021
@vstinner vstinner force-pushed the vstinner:more_slot_assert branch 3 times, most recently from 04c2696 to 5d020bc Jan 28, 2021
When Python is built in debug mode (with C assertions), calling a
type slot like sq_length (__len__() in Python) now fails with a fatal
error if the slot succeeded with an exception set, or failed with no
exception set. The error message contains the slot, the type name,
and the current exception (if an exception is set).

* Check the result of all slots using _Py_CheckSlotResult().
* No longer pass op_name to ternary_op() in release mode.
* Replace operator with dunder Python method name in error messages.
  For example, replace "*" with "__mul__".
* Fix compiler_exit_scope() when an exception is set.
* Fix bytearray.extend() when an exception is set: don't call
  bytearray_setslice() with an exception set.
@vstinner vstinner force-pushed the vstinner:more_slot_assert branch from 5d020bc to a7eb557 Jan 29, 2021
@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Jan 29, 2021

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

If you want to schedule another build, you need to add the "🔨 test-with-buildbots" label again.

@vstinner
Copy link
Member Author

@vstinner vstinner commented Jan 29, 2021

Replace operator with dunder Python method name in error messages. For example, replace "*" with "mul".

Note for myself: I reverted this change, since the operator was part of some TypeError error messages.

@vstinner
Copy link
Member Author

@vstinner vstinner commented Jan 29, 2021

buildbot/AMD64 FreeBSD Shared PR

"3 tests failed again: test_gdb test_subprocess test_venv"

These errors seem to be unrelated to my PR.

@vstinner
Copy link
Member Author

@vstinner vstinner commented Jan 29, 2021

I didn't some basic sanity tests and they completed successfully:

  • create a venv
  • install cinder and run ./env/bin/python -m cinder.service (I had to fix two minor Python 3.10 issues in eventlet and oslo.context)
  • pip commands: cache dir, cache info, cache list, freeze, install -U pip
@vstinner vstinner merged commit a619263 into python:master Jan 29, 2021
62 of 63 checks passed
62 of 63 checks passed
Docs
Details
Check for source changes
Details
Check if generated files are up to date
Details
Windows (x86)
Details
Windows (x64)
Details
macOS
Details
Ubuntu
Details
buildbot/AMD64 FreeBSD Shared PR Build done.
Details
Azure Pipelines PR #20210129.8 succeeded
Details
Travis CI - Pull Request Build Passed
Details
bedevere/issue-number Issue number 42979 found
Details
bedevere/news News entry found in Misc/NEWS.d
buildbot/AMD64 Arch Linux Asan Debug PR Build done.
Details
buildbot/AMD64 Arch Linux Asan PR Build done.
Details
buildbot/AMD64 Arch Linux TraceRefs PR Build done.
Details
buildbot/AMD64 Debian PGO PR Build done.
Details
buildbot/AMD64 Debian root PR Build done.
Details
buildbot/AMD64 Fedora Stable Clang Installed PR Build done.
Details
buildbot/AMD64 Fedora Stable Clang PR Build done.
Details
buildbot/AMD64 Fedora Stable LTO + PGO PR Build done.
Details
buildbot/AMD64 Fedora Stable LTO PR Build done.
Details
buildbot/AMD64 Fedora Stable PR Build done.
Details
buildbot/AMD64 Fedora Stable Refleaks PR Build done.
Details
buildbot/AMD64 RHEL7 LTO + PGO PR Build done.
Details
buildbot/AMD64 RHEL7 LTO PR Build done.
Details
buildbot/AMD64 RHEL7 PR Build done.
Details
buildbot/AMD64 RHEL7 Refleaks PR Build done.
Details
buildbot/AMD64 RHEL8 LTO + PGO PR Build done.
Details
buildbot/AMD64 RHEL8 LTO PR Build done.
Details
buildbot/AMD64 RHEL8 PR Build done.
Details
buildbot/AMD64 RHEL8 Refleaks PR Build done.
Details
buildbot/AMD64 Ubuntu Shared PR Build done.
Details
buildbot/AMD64 Windows10 PR Build done.
Details
buildbot/PPC64LE Fedora Stable Clang Installed PR Build done.
Details
buildbot/PPC64LE Fedora Stable Clang PR Build done.
Details
buildbot/PPC64LE Fedora Stable LTO + PGO PR Build done.
Details
buildbot/PPC64LE Fedora Stable LTO PR Build done.
Details
buildbot/PPC64LE Fedora Stable PR Build done.
Details
buildbot/PPC64LE Fedora Stable Refleaks PR Build done.
Details
buildbot/PPC64LE RHEL7 LTO + PGO PR Build done.
Details
buildbot/PPC64LE RHEL7 LTO PR Build done.
Details
buildbot/PPC64LE RHEL7 PR Build done.
Details
buildbot/PPC64LE RHEL7 Refleaks PR Build done.
Details
buildbot/PPC64LE RHEL8 LTO + PGO PR Build done.
Details
buildbot/PPC64LE RHEL8 LTO PR Build done.
Details
buildbot/PPC64LE RHEL8 PR Build done.
Details
buildbot/PPC64LE RHEL8 Refleaks PR Build done.
Details
buildbot/aarch64 Fedora Stable PR Build done.
Details
buildbot/aarch64 RHEL7 PR Build done.
Details
buildbot/aarch64 RHEL8 PR Build done.
Details
buildbot/s390x Debian PR Build done.
Details
buildbot/s390x RHEL7 LTO + PGO PR Build done.
Details
buildbot/s390x RHEL7 LTO PR Build done.
Details
buildbot/s390x RHEL7 PR Build done.
Details
buildbot/s390x RHEL7 Refleaks PR Build done.
Details
buildbot/s390x RHEL8 LTO + PGO PR Build done.
Details
buildbot/s390x RHEL8 LTO PR Build done.
Details
buildbot/s390x RHEL8 PR Build done.
Details
buildbot/s390x RHEL8 Refleaks PR Build done.
Details
buildbot/s390x SLES PR Build done.
Details
buildbot/x86 Gentoo Installed with X PR Build done.
Details
buildbot/x86 Gentoo Non-Debug with X PR Build done.
Details
buildbot/x86-64 macOS PR Build done.
Details
@vstinner vstinner deleted the vstinner:more_slot_assert branch Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants