<div dir="ltr"><div>I have noticed that RtlCreateUserThread in dlls/ntdll.thread.c uses the following call </div><div><br></div><div>    pthread_attr_setstack( &attr, teb->DeallocationStack, (char *)teb->Tib.StackBase - (char *)teb->DeallocationStack );</div><div><br></div><div><br></div><div>I have the source code from release 1.7.41.</div><div><br></div><div>I am working on a complex project that traces the execution of programs running in Wine (won't go into detail here). </div><div>I have noticed problems in RtlCreateUserThread when services.exe is launched in my environment.</div><div>Basically the call to pthread_create causes a SIGSEGV. </div><div><br></div><div>Let me make it clear that under ordinary conditions, Wine works fine.</div><div><br></div><div>Playing around with things, I note that if I change the call above to be pthread_attr_setstacksize(&attr, 0x10000), then</div><div>I don't get the same problem. </div><div><br></div><div>My question is, why does the exact position of the stack need to be set in this way? </div></div>