-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
Line numbers for errors off in traces #106290
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
Comments
Having spent some time trying to debug this, I still have no solution. I do know this: the invariants in the code regarding I think that whenever we're in the body of an instruction (i.e. in bytecodes.c):
When executing regular bytecode, upon failing a When executing uops, there are at least three reasons to distinguish for leaving
The When the executor returns But when I put all this together something's off! I generate uop sequences like this:
where I fear to change the logic in I also believe that if the first uop in a trace fails an PS. The one thing that's not at fault here is the stack pointer. The logic around setting and restoring that is clear and unimpeachable. |
Okay, I think I've got it. In the Explanation: When we return from the executor, we
The All in all this means that if we have a "destination" opcode indicated by the final When we exit because of a failed OTOH, when we exit because of a failed I suppose there are two ways to fix this, given my implementation:
In my PR I have used (2), since it emulates the state of the Tier 1 interpreter (during execution of a certain bytecode, We could also incorporate the decrement in the caller of the executor, but beware: there are two places where it's called:
|
The trick is that EXIT_TRACE must decrement prev_instr.
- Tweak uops debugging output - Fix the bug from gh-106290 - Rename `SET_IP` to `SAVE_IP` (per faster-cpython/ideas#558) - Add a `SAVE_IP` uop at the start of the trace (ditto) - Allow `unbound_local_error`; this gives us uops for `LOAD_FAST_CHECK`, `LOAD_CLOSURE`, and `DELETE_FAST` - Longer traces - Support `STORE_FAST_LOAD_FAST`, `STORE_FAST_STORE_FAST` - Add deps on pycore_uops.h to Makefile(.pre.in)
When a uop encounters an error, the line number is set to -1 or to the wrong place.
@markshannon
Repro (on latest main):
Run this normally and you get this traceback:
But run with
-Xuops
, and you get:Linked PRs
The text was updated successfully, but these errors were encountered: