Skip to content
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

CPX library doesn't work on CPX (recursion depth hit) #8053

Closed
tannewt opened this issue May 31, 2023 · 4 comments · Fixed by #8071
Closed

CPX library doesn't work on CPX (recursion depth hit) #8053

tannewt opened this issue May 31, 2023 · 4 comments · Fixed by #8071
Assignees
Milestone

Comments

@tannewt
Copy link
Member

tannewt commented May 31, 2023

https://forums.adafruit.com/viewtopic.php?p=974225#p974225

@tannewt tannewt added this to the 8.2.0 milestone May 31, 2023
@bill88t
Copy link

bill88t commented May 31, 2023

Pystack again?

@RetiredWizard
Copy link

I enabled MICROPY_STACKLESS which resulted in the same "RuntimeError: maximum recursion depth exceeded" message but without the traceback.

I then disabled CIRCUITPY_FULL_BUILD, CIRCUITPY_COUNTIO and CIRCUITPY_BITBANGIO and enabled CIRCUITPY_AUDIOIO and CIRCUITPY_PIXELBUF and the example scripts from the forum post ran without crashing.

I know this isn't a solution but figured it might at least help zero in on the issue.

@bill88t
Copy link

bill88t commented May 31, 2023

Stackless should never print that message..
Across all the testing I ever did on stackless it never showed it, even in depths >2.000.000.
Something is horribly going wrong for that to show.

@RetiredWizard
Copy link

The CPX has a lot less SRAM (32K I believe) than the chips you were probably testing on, would actually running out of available memory possibly trigger the error?

@tannewt tannewt self-assigned this Jun 5, 2023
tannewt added a commit that referenced this issue Jun 7, 2023
This reduces the stack frame size of mp_builtin___import__ by
limiting the support path length of files from 256 to 96. This
function can be called recursively for nested imports so it adds up.

Also reduce mp_execute_bytecode (vm.c) from 206 a bc call to 124.
This too is recursive and adds up. It is reduced by preventing
some inlining. It may decrease performance slightly when importing
and unpacking.

Adds two new scripts for debugging. One is used from gdb to print
frame sizes in a backtrace. The other prints what pcs use a
particular stack offset. This helps find infrequently used stack
space.

Fixes #8053.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants