Hello,
I’m experiencing trouble when calling “glCreateProgramObjectARB()” from a thread, made by CreateThread.
Sample code to reproduce:
void crashfunc() {
DWORD test = glCreateProgramObjectARB();
_asm push test // do some stuff so the compiler doenst get rid of it
_asm pop eax
}
void main() {
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)CrashFunc, 0, 0, 0);
while(true){Sleep(100);}
}
The program crashes though before it reaches ‘asm push test’.
I’ve traced the problem; and it appears that the FS:[0xEF4] register contains 0…
aka, when in thread, glCreateProgramObjectARB gets called:
mov eax, FS:[0xEF4]; eax = 0
eax is then used as pointer to jmp to the func. This leads to an invalid pointer exception.
This is all occurs in the ATI userland wrapper…
I can apply some hackery, but this isn’t appreciated as this code might be executed at nvidia cards…