Closed 0xcaff closed 7 months ago
Running with
RUST_MIN_STACK=8388608 cargo test
fixes the issue. I believe this has nothing to do with iced. I guess the tls eats up the thread stack space?
It's possible that some of the iced init code called by the lazy_static uses a lot of stack space, I haven't checked, since I never tried the the nightly thread_local feature. Anyway that init code will be rewritten in the next version.
It seems that when using the thread_local nightly feature (https://github.com/rust-lang/rust/issues/29594) inside a test, iced breaks (the decoder fails to construct).
Here's a minimum reproduction:
cargo run
As expected.
cargo test
Stepping through this, it seems like the crash happens even before attempting to parse the instructions.
Changing EXTERNAL_STACK_SEGMENT size
Changing
Seems to change the output code and no longer triggers the issue.
before version (broken)
after version (working)
Environment Information
rust-toolchain.toml
Cargo.lock
This is all for target x86_64-unknown-linux-gnu
Hunches
My guess is this has something to do with lazy_static