On Apr 19 14:16, Ryan Johnson wrote:
I actually hadn't noticed that thread stack before making the diff,
so at this point it's a toss-up which of the thread or locale.nls
got there first and messed up the other. Does Windows tend to map
files at the same address every time, or just executable images it
hopes to share as-is between processes? Without knowing that it's
hard to say what happened.
I assume it will map the file to the same address if there's nothing
else already in the way. This should make virtual memory handling
easier. OTOH locale.nls is just a data file, so Win32 shouldn't care
at all where it's located.
Regardless of file mapping behavior, though, I don't see right off
how to make this problem go away.
Just an idea: What if we map locale.nls to some fixed address ourselves
before any NLS function is called? Somewhere early in dll_crt0_1.
If the file is already mapped, there should be no reason for the OS to
map it again at some other address.