You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rust hello world crashes with UC_ERR_READ_UNMAPPED during UCRT startup on Windows x8664 #1627
Describe the bug
Running a minimal Rust Windows hello-world PE under Qiling on x8664_windows crashes during UCRT/CRT startup with UC_ERR_READ_UNMAPPED. The sample never reaches user code. Before the crash, Qiling reports several unimplemented Windows/UCRT APIs such as _initialize_narrow_environment, _initterm, _set_new_mode, FlsGetValue2, and IsThreadAFiber.
I was able to replicate the issue using the latest Qiling dev branch, and the default Rust Hello World project compiled with latest stable Rust.
The "not implemented" warnings are not necessarily indicative of the problem, this simply means that Qiling lacks hooks for those functions, and the native implementations of those functions are allowed to run. The native functions may or may not be working correctly. Most of the time they are, so this is not always a concern.
I did a bit of debugging and the issue is related to Qiling's emulation of TLS on Windows. The Rust runtime init attempts to look up TLS entries via the TLS directory pointer in the TEB. However Qiling makes the assumption that programs will access the TLS via the winapi functions such as TlsSetValue and TlsGetValue. Qiling does not initialize the TLS directory pointer in the TEB, so the pointer the program retrieves from the TEB is null, causing the program to crash.
I am doing some work on it currently, I will put up a PR if I manage to fix it.
Activity
JFarAur commentedon Oct 9, 2026
I was able to replicate the issue using the latest Qiling dev branch, and the default Rust Hello World project compiled with latest stable Rust.
The "not implemented" warnings are not necessarily indicative of the problem, this simply means that Qiling lacks hooks for those functions, and the native implementations of those functions are allowed to run. The native functions may or may not be working correctly. Most of the time they are, so this is not always a concern.
I did a bit of debugging and the issue is related to Qiling's emulation of TLS on Windows. The Rust runtime init attempts to look up TLS entries via the TLS directory pointer in the TEB. However Qiling makes the assumption that programs will access the TLS via the winapi functions such as
TlsSetValueandTlsGetValue. Qiling does not initialize the TLS directory pointer in the TEB, so the pointer the program retrieves from the TEB is null, causing the program to crash.I am doing some work on it currently, I will put up a PR if I manage to fix it.
JFarAur commentedon Oct 16, 2026
Issue is addressed in this PR: #1670
Just awaiting review and revision.