gear-lazy-pages: Undefined behavior on Windows #4341
Labels
C0-bug
Something isn't working
D2-node
Gear Node
D4-test
Autotests, and examples
P0-dropeverything
Highest priority
Problem
It is confirmed
x86_64-pc-windows-msvc
has undefined behavior for code transitively usinglazy-pages
(e.g. vectored exception handler) since #4289Steps
cargo test -p pallet-gear wait_lock
Possible Solution
Current possible solution to always compile
corosensei
in release which seems to be ineffective since we have reproduced it in wine even with applied fix: https://github.com/gear-tech/gear/actions/runs/11786273088/job/32829243330?pr=4334#step:16:749.Notes
Reproduction only possible in debug mode.
Any additional function call in exception handler leads test to pass.
What code has been tried:
user_signal_handler_internal
:What code has no effects:
SetThreadStackGuarantee
mfence
instruction at the start and at the end of exception handlerRelevant Log Output
Since behavior is undefined we get different errors even with different tools and on different machines without any code changes.
CI dedicated Windows machine:
cargo test - memory allocation of X bytes failed
Note: debugger shows code tried to
panic!()
and formatregion::Error::ProcfsInput
variant which is UNIX-only and this it's impossible on Windowscargo nextest - BorrowMutError
https://github.com/gear-tech/gear/actions/runs/11635541579/job/32461288334?pr=4289#step:16:445
CI dedicated Linux machine with WINE:
cargo nextest - BorrowMutError
https://github.com/gear-tech/gear/actions/runs/11786273088/job/32829243330?pr=4334#step:16:749
VMWare Fusion Windows 11 ARM with x86 emulation:
cargo test
cargo test -- --nocapture
cargo nextest run --no-capture
Note: test passes without
--no-capture
argument@ByteNacked's native Windows machine:
cargo test -- --nocapture - Externalities not allowed to fail within runtime: "A"
The text was updated successfully, but these errors were encountered: