-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
RuntimeError: out of bounds memory access
when using plugin on a large nested AST
#9782
Comments
upon further investigation, it seems the bug only happen when AST tree is too deep, not the breadth |
So my guess is that it's about stack overflow rather than a memory usage. Stack sizes are limited, and I think |
I believe we have same issues in the host as well? if depth is deep enough, either host or plugin won't able to traverse down with visitor. |
Right now the host and guest have different limit. I think it makes sense to have same limit for host and guest |
Current host limit is bigger, so the identical file can run without plugin but not with plugin |
I'm not sure if this is configurable on our end, ideally hope to do so. |
No, I mean it's failing with |
I'm able to reproduce this issue in a unit test |
Describe the bug
When a large nested file being loaded to swc with plugin, the plugin_runner will crash.
When same file being loaded to swc without plugin, no error is thrown.
Input code
Config
Playground link (or link to the minimal reproduction)
https://github.com/jzhan-canva/swc-plugin-bug
SWC Info output
No response
Expected behavior
Same a running swc without plugin, that it should run
Actual behavior
Crash
Version
"@swc/cli": "^0.5.2", "@swc/core": "^1.9.3", "@swc/plugin-noop": "^5.0.0"
Additional context
No response
The text was updated successfully, but these errors were encountered: