cairo_native: bug: stack overflow on AotExecutor creation

repro:

clone https://github.com/kkrt-labs/ef-tests checkout cairo-native branch git checkout feat/cairo-native make make setup-kakarot run any test, like: cargo test baseFeeDiffPlaces_d34g0v0_Cancun --features v1,native -- --nocapture

this should fail with a stack overflow.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 22

Most upvoted comments

There is actually another side effect. Now all of our tests revert with an error

 WARN ef_testing::models::result: stStackTests::stackOverflowDUP_d13g0v0_Cancun reverted:
Transaction execution has failed:
0: Error in the called contract (contract address: 0x0000000000000000000000000000000000000000000000000000000000000003, class hash: 0x06153ccf69fd20f832c794df36e19135f0070d0576144f0b47f75a226e4be530, selector: 0x015d40a3d6ca2ac30f4031e42be28da9b056fef9bb7357ac5e85627ee876e5ad):
Error at pc=0:25:
Cairo traceback (most recent call last):
Unknown location (pc=0:731)
Unknown location (pc=0:677)
Unknown location (pc=0:291)
Unknown location (pc=0:314)

1: Error in the called contract (contract address: 0x04c15a3ff2822ca5b75a67a2ff0226b8b18a94c1c7d396b0073269c5b074d14f, class hash: 0x05b953b2f2ed1e6a4943dc934cc8a5fb12de801745a40857f4459bb375c0f04c, selector: 0x007ec457cd7ed1630225a8328f826a29a327b19486f6b2882b4176545ebdbe3d):
Native execution error: Native execution error: Invalid chain id

Something has changed in the process of how we retrieve chain id.

Let me write another issue

The stack overflow should now be fixed (along with most memory leaks) in my PR.

No problem, it was easy to find once the stack trace changed. If everything goes correctly I should have that stack overflow fixed today, but that’s a big if.

I confirm it was what I suspected. Now it should crash with an assert instead of a stack overflow. I’m working on a real fix.

Thank you, it worked.

I see the loop clearly now, and I think I know why that happened. Let me check if I’m right.