Skip to content

gh-96049: Fix some opcodes leave frame->prev_instr in an incorrect state #96051

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

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
(cherry picked from commit efb20a9)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: Serhiy Storchaka <3659035+serhiy-storchaka@users.noreply.github.com>
(cherry picked from commit 6442a9d)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
…ythonGH-94658)

(cherry picked from commit 78307c7)

Co-authored-by: Christian Heimes <christian@python.org>
(cherry picked from commit a10cf2f)

Co-authored-by: Tom Fryers <61272761+TomFryers@users.noreply.github.com>
…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 <59607654+kumaraditya303@users.noreply.github.com>
…tion is raised multiple times (pythonGH-30274) (python#94747)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
… (python#94752)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
…ythonGH-94775)

(cherry picked from commit 0c66074)

Co-authored-by: Christian Heimes <christian@python.org>
* fix typo - double spelled word 'use'

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

Co-authored-by: Max Zhenzhera <59729293+maxzhenzhera@users.noreply.github.com>
(cherry picked from commit e39ce7d)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
…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 <encukou@gmail.com>
(cherry picked from commit f5c02af)

Co-authored-by: Christian Heimes <christian@python.org>
…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 <53406459+neonene@users.noreply.github.com>
(cherry picked from commit 07374cc)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
…thongh-94836) (pythongh-94838)

(cherry picked from commit 967da5f)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
(cherry picked from commit 6a15f91)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
…up (pythonGH-94298)

(cherry picked from commit 01ef1f9)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
…ythonGH-94842)

(cherry picked from commit 9b3f779)

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
Colum -> Column
(cherry picked from commit 9ea72e9)

Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
…nGH-94794)

(cherry picked from commit 08f6897)

Co-authored-by: Tin Tvrtković <tinchester@gmail.com>
…python#94849)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
(cherry picked from commit 6cbb57f)
…-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 <mdboom@gmail.com>
…hen ndigits is provided (pythonGH-94860) (pythonGH-94882)

(cherry picked from commit 625ba9b)


Co-authored-by: Michael Droettboom <mdboom@gmail.com>

Automerge-Triggered-By: GH:brandtbucher
@ghost
Copy link

ghost 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.