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-96049: Fix some opcodes leave frame->prev_instr in an incorrect state #96051

Closed
wants to merge 653 commits into from

Conversation

tom-pytel
Copy link
Contributor

@tom-pytel tom-pytel commented Aug 17, 2022

Opcodes which have caches (specifically adaptive calls) leave frame->prev_instr pointing to the last byte of the cache instead of the actual last instruction in Python/ceval.c. This fix stores the location of the actual previous instruction and steps over the cache on the next frame entry.

miss-islington and others added 30 commits July 8, 2022 07:52
Co-authored-by: Serhiy Storchaka <[email protected]>
(cherry picked from commit 6442a9d)

Co-authored-by: Ken Jin <[email protected]>
(cherry picked from commit a10cf2f)

Co-authored-by: Tom Fryers <[email protected]>
…onGH-93994) (pythonGH-94740)

Elide traceback column indicators when the entire line of the
frame is implicated.  This reduces traceback length and draws
more attention to the remaining (very relevant) indicators.

Example:
```
Traceback (most recent call last):
  File "query.py", line 99, in <module>
    bar()
  File "query.py", line 66, in bar
    foo()
  File "query.py", line 37, in foo
    magic_arithmetic('foo')
  File "query.py", line 18, in magic_arithmetic
    return add_counts(x) / 25
           ^^^^^^^^^^^^^
  File "query.py", line 24, in add_counts
    return 25 + query_user(user1) + query_user(user2)
                ^^^^^^^^^^^^^^^^^
  File "query.py", line 32, in query_user
    return 1 + query_count(db, response['a']['b']['c']['user'], retry=True)
                               ~~~~~~~~~~~~~~~~~~^^^^^
TypeError: 'NoneType' object is not subscriptable
```

Automerge-Triggered-By: GH:pablogsal
)

* fix allocator and deallocator

* 📜🤖 Added by blurb_it.

* code review

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit f5b7633)

Co-authored-by: Kumar Aditya <[email protected]>
* fix typo - double spelled word 'use'

* change methods names to the infinitive form
(cherry picked from commit 90a6e56)

Co-authored-by: Max Zhenzhera <[email protected]>
(cherry picked from commit e39ce7d)

Co-authored-by: Benjamin Peterson <[email protected]>
…ythonGH-94754) (python#94780)

This is a quick-and-dirty way to run the C++ tests.
It can definitely be improved in the future, but it should fail when things go wrong.

- Run test functions on import (yes, this can definitely be improved)
- Fudge setuptools metadata (name & version) to make the extension installable
- Install and import the extension in test_cppext
(cherry picked from commit ec5db53)

Co-authored-by: Petr Viktorin <[email protected]>
…ythonGH-94790)

Fixes the failure of PGO building with `mimalloc` on Windows, ensuring that `test_bpo20891` does not break profiling data (`python31*.pgc`).
(cherry picked from commit 4a6bb30)

Co-authored-by: neonene <[email protected]>
(cherry picked from commit 6a15f91)

Co-authored-by: Terry Jan Reedy <[email protected]>
Colum -> Column
(cherry picked from commit 9ea72e9)

Co-authored-by: Ikko Ashimine <[email protected]>
…-94852)

The case where there are more than (1 << 15) lines was not covered.

I don't know if increasing test coverage requires a blurb -- let me know if it does.

Automerge-Triggered-By: GH:brandtbucher
(cherry picked from commit 582ae86)

Co-authored-by: Michael Droettboom <[email protected]>
…hen ndigits is provided (pythonGH-94860) (pythonGH-94882)

(cherry picked from commit 625ba9b)


Co-authored-by: Michael Droettboom <[email protected]>

Automerge-Triggered-By: GH:brandtbucher
@cpython-cla-bot
Copy link

cpython-cla-bot bot commented Aug 17, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

@tom-pytel
Copy link
Contributor Author

The following commit authors need to sign the Contributor License Agreement:

Click the button to sign:CLA not signed

Internal Server Error

@JelleZijlstra
Copy link
Member

Thanks for your PR, but it seems you did something wrong with git; there are way too many commits and merge conflicts. I'm going to close this; please start from latest main, then apply your changes and make a PR.

@tom-pytel tom-pytel deleted the fix-issue-96049 branch August 17, 2022 19:50
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.