-
Notifications
You must be signed in to change notification settings - Fork 54
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
Stack overflow for some source code input in debug mode #140
Comments
To be clear, have you ever gotten this on release optimizations, or is that just theoretical? If so, then my potential fix likely won't help. |
JohnnyMorganz/StyLua#38 was done using a release version of StyLua. StyLua also works recursively though, starting at a block and recursively formatting until we reach a TokenReference - this may be compounding onto it? EDIT: Actually I may need to double check this, as I remember asking the user to build from master as there a few unreleased fixes - they may have built the debug version. |
By the way, if you want your debug build to not have that issue, you can specify to compile [profile.dev.package.full_moon]
opt-level = 3 I did this for darklua: https://gitlab.com/seaofvoices/darklua/-/blob/main/Cargo.toml |
Hi @JohnnyMorganz I've tracked a disscussion for a couple of minutes and seems like you know what the issue is about? |
I'm aware it exists, and I know the current workaround is just to use a release build instead. @Kampfkarren looked more into the underlying cause, and I think they pinpointed something. I can't remember exactly what it was though |
Yeah, this is one I'm going to end up taking on my own at some point. I put a thread on the Rust forums and was told to use something called "stacker", which some official Rust products use internally to combat this kind of thing. |
This seems to be no longer an issue if you update to the latest stable rust version!! 🚀 |
For some inputs (eg. JohnnyMorganz/StyLua#38, or other examples shown below), using full-moon produces a stack overflow. This is mostly noticeable in the debug version of full-moon, and is less likely to occur using the release version, but it is still possible.
Some other examples include:
[Roblox Feature Flag - if you replace
accum += delta
with something else likelocal x = 1
, it parses fine][Roblox Feature Flag - if we remove the first if statemenet and keep its body (
if member then ... else end
), it parses fine. If we remove all type information, but retain the roblox feature flag, there is a stack overflow. If we remove all type information and disable the roblox feature flag, it parses fine]The text was updated successfully, but these errors were encountered: