Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-132532: AddCHECK_PERIODIC instruction and use it for CALLs instead of the uop version.#132533

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
iritkatriel wants to merge11 commits intopython:main
base:main
Choose a base branch
Loading
fromiritkatriel:periodic

Conversation

iritkatriel
Copy link
Member

@iritkatrieliritkatriel commentedApr 14, 2025
edited
Loading

@iritkatriel
Copy link
MemberAuthor

@gaogaotiantian this PR adds an instruction (CHECK_PERIODIC) after each call. So now pdb.set_trace() sees that as the next instruction, and thinks it's breaking one line earlier. How do you suggest we fix this? Skip the CHECK_PERIODIC instruction (where would the happen?)

@gaogaotiantian
Copy link
Member

The test_pdb failure is not a real failure. We should just fix(remove) the test. It was a corner case where the instruction afterCALL (POP_TOP) does not have a line number associated with it - and we should not stop there because missing line number would frustratepdb. However, if the following instruction isCHECK_PERIODIC and it has a line number, we should just stop there.

@iritkatriel
Copy link
MemberAuthor

CHECK_PERIODIC has the same line number as the CALL of set_trace(). So it will look like we stopped just before the set_trace call. I don't think that's what we want.

@gaogaotiantian
Copy link
Member

That is what we want. The existing test that failed is an exception, which stopped at the next line. We put a lot of effort to makebreakpoint() stop atbreakpoint(), so this is a desired behavior.

iritkatriel reacted with thumbs up emoji

@@ -4714,7 +4714,8 @@ def _read():
# handlers, which in this case will invoke alarm_interrupt().
signal.alarm(1)
try:
self.assertRaises(ZeroDivisionError, wio.write, large_data)
with self.assertRaises(ZeroDivisionError):
wio.write(large_data)
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I needed to make this change because otherwise the exception is not swallowed (seems that it shows up after the self.assertRaises call has returned).

@markshannon
Copy link
Member

It looks like thespecialize_method_descriptor needs to account for theCHECK_PERIODIC before thePOP_TOP, and presumablyCALL_LIST_APPEND will need to skip the two following instructions.

@python-cla-bot
Copy link

python-cla-botbot commentedApr 18, 2025
edited
Loading

All commit authors signed the Contributor License Agreement.

CLA signed

@markshannon
Copy link
Member

It looks liketranslate_bytecode_to_trace also needs adjusting to account for the extra instruction.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@gaogaotiantiangaogaotiantiangaogaotiantian left review comments

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

@brandtbucherbrandtbucherAwaiting requested review from brandtbucher

@ericsnowcurrentlyericsnowcurrentlyAwaiting requested review from ericsnowcurrentlyericsnowcurrently is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@iritkatriel@gaogaotiantian@markshannon

[8]ページ先頭

©2009-2025 Movatter.jp