Coder Social home page Coder Social logo

Comments (7)

gvanrossum avatar gvanrossum commented on September 26, 2024

Thanks for finding this. It's this assert:

assert((this_instr + 2)->opcode == _PUSH_FRAME);

in _INIT_CALL_PY_EXACT_ARGS in optimizer_bytecodes.c. I added that a few days ago. I'll come up with a fix.

from cpython.

Fidget-Spinner avatar Fidget-Spinner commented on September 26, 2024

@gvanrossum I dug into this further and it's actually two bugs:

  1. The assert in the optimizer is wrong, it could end with _EXIT_TRACE, but the second bug in the tracer itself is more nefarious and actually crashes uops:
  2. With how we create traces for stuff that goes too deep, it seems it's not side exiting to the correct place.

from cpython.

gvanrossum avatar gvanrossum commented on September 26, 2024

Oh, thanks! If you have time for a fix I can review it.

from cpython.

gvanrossum avatar gvanrossum commented on September 26, 2024

Maybe it's better to back out the entire sequence of uops generated by the CALL_* instruction containing the push?

from cpython.

Fidget-Spinner avatar Fidget-Spinner commented on September 26, 2024

Maybe it's better to back out the entire sequence of uops generated by the CALL_* instruction containing the push?

Yeah that seems better. Right now it's deopting after _INIT_CALL_PY_EXACT_ARGS which creates a new frame, this means the stack is inconsistent with CALL_PY_EXACT_ARGS and the whole thing crashes.

from cpython.

gvanrossum avatar gvanrossum commented on September 26, 2024

In the end I think it's better to emit the _PUSH_TRACE (it was being emitted until I refactored that code a few days ago).

from cpython.

lazorchakp avatar lazorchakp commented on September 26, 2024

Thanks for getting to this so quickly! This fix should also simplify an edge case for #116168 too, which is helpful for me.

from cpython.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.