-
Notifications
You must be signed in to change notification settings - Fork 1.8k
proc-macro
process stack overflow
#12884
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
Comments
I did guess this proc macro relies on rustc using a stack size larger than the OS default to avoid a stack overflow. It would likely also crash with rustc if you started to nest your code deeper. Rustc itself uses stacker at various places where there can be deep recursion to grow the stack when it would almost overflow. Syn however doesn't do this and is thus susceptible to stack overflow. |
We're already using quite a large stack (8 MiB):
|
The actual proc macro expansion now happens on a new thread without the extra stack:
|
While browsing this file in Materialize: https://github.com/MaterializeInc/materialize/blob/c5b9619ba/src/storage/src/source/persist_source.rs
Stack trace (snipped, the end repeats for hundreds of frames)
rust-analyzer version: rust-analyzer 0.0.0 (c2eebd7 2022-07-26)
rustc version: rustc 1.62.0 (a8314ef7d 2022-06-27)
relevant settings: using emacs lsp-mode, with
lsp-rust-analyzer-proc-macro-enable
set tot
The text was updated successfully, but these errors were encountered: