◐ Shell
clean mode source ↗

Revert "bpo-43693: Add the MAKE_CELL opcode and interleave fast locals offsets. (gh-26396)" by pablogsal · Pull Request #26597 · python/cpython

@pablogsal

CC: @ericsnowcurrently @markshannon I have tried to find the error myself and debug this issue for 30 min, but the patch in 631f993 is quite involved and I need to catch up with the rest of changes made to the compiler so I was not able to find it quickly :(

@pablogsal

The problem is that PyFrame_LocalsToFast(frame, 1); calls into PyFrame_LocalsToFast where co->co_nlocals has a value of 3, and this causes co->co_cell2arg[i - co->co_nlocals]; to access outside the bounds of the array.

@bedevere-bot

🤖 New build scheduled with the buildbot fleet by @pablogsal for commit 01ff3e0 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@ericsnowcurrently

@pablogsal, sorry to impose again! I was watching the buildbots after but ran out of time to wait for them all to finish. Lesson learned.

@pablogsal

@pablogsal, sorry to impose again! I was watching the buildbots after but ran out of time to wait for them all to finish. Lesson learned.

No problem! I will try to improve the experience a bit better if I managed to find the time. Will try to propose some improvements so maybe the failures are reported in a comment or something

@ericsnowcurrently

What's the best way for me to run the address sanitizer locally, to reproduce the failure?

@ericsnowcurrently

...and thanks for the helpful analysis above.

@pablogsal

What's the best way for me to run the address sanitizer locally, to reproduce the failure?

I mentioned it in https://bugs.python.org/msg395321 but I should have mentioned it here as well:

$ export ASAN_OPTIONS=detect_leaks=0:allocator_may_return_null=1:handle_segv=0
$ ./configure --with-address-sanitizer --without-pymalloc
$ make -j -s
$ ./python -m test test_sys_settrace

@pablogsal

I used gcc 10 for this, but I think clang works as well as any recent version of gcc.

@pablogsal

giphy (1)

ericsnowcurrently added a commit to ericsnowcurrently/cpython that referenced this pull request

Jun 8, 2021