http://bugs.winehq.org/show_bug.cgi?id=29551
Bug #: 29551 Summary: Panta Rhei demoscene demo crashes on startup due to missing opengl32.dll glDebugEntry export/stub Product: Wine Version: 1.3.36 Platform: x86 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: opengl AssignedTo: wine-bugs@winehq.org ReportedBy: focht@gmx.net Classification: Unclassified
Hello,
after bug 27701 is fixed the demo still crashes.
--- snip --- ... 0024:Call opengl32.glClearColor(00000000,00000000,00000000,00000000) ret=004210c9 0024:Ret opengl32.glClearColor() retval=00000000 ret=004210c9 0024:Call opengl32.glClear(00004100) ret=004210d4 0024:Ret opengl32.glClear() retval=00000000 ret=004210d4 0024:Call opengl32.glMultMatrixd(00001701) ret=004210e1 0024:trace:seh:raise_exception code=c0000005 flags=0 addr=0x406a9157 ip=406a9157 tid=0024 0024:trace:seh:raise_exception info[0]=00000000 0024:trace:seh:raise_exception info[1]=00001701 0024:trace:seh:raise_exception eax=ffffffa8 ebx=7ec6c000 ecx=f772c6c0 edx=00001701 esi=080ffde4 edi=080ffd64 0024:trace:seh:raise_exception ebp=080ffd58 esp=080ffcc0 cs=0023 ds=002b es=002b fs=0063 gs=006b flags=00010206 0024:trace:seh:call_stack_handlers calling handler at 0x7bc919f5 code=c0000005 flags=0 ... wine: Unhandled page fault on read access to 0x00001701 at address 0x406a9157 (thread 0024), starting debugger... ... Backtrace: =>0 0x406a9157 in libnvidia-glcore.so.290.10 (+0xfe5157) (0x080ffd58) 1 0x7bc64866 call_entry_point+0x29() in ntdll (0x080ffd78) 2 0x7bc64a91 relay_call+0x1bb(descr=0x2037a628, idx=0x100af, stack=0x80ffddc) [/home/focht/projects/wine/wine-git/dlls/ntdll/relay.c:435] in ntdll (0x080ffdc8) 3 0x202cce39 in opengl32 (+0xce38) (0x080ffdfc) 4 0x004210e1 in flp-pr (+0x210e0) (0x080ffdfc) 5 0x004202a1 in flp-pr (+0x202a0) (0x080ffe40) 6 0x7b85e308 call_process_entry+0xb() in kernel32 (0x00000000) --- snip ---
Calling glMultMatrixd() with that 0x1701 address seemed rather strange.
Prototype:
http://www.opengl.org/sdk/docs/man/xhtml/glMultMatrix.xml
--- snip --- void glMultMatrixd(const GLdouble * m); --- snip ---
Application code:
--- snip --- ... 004210D4 8B35 7C034300 MOV ESI,DWORD PTR DS:[43037C] ; IAT of custom loader 004210DA 68 01170000 PUSH 1701 004210DF FFD6 CALL ESI ; opengl32.glMultMatrixd --- snip ---
This was the first call that was really failing. Debugging further other API imports were somehow suspicious but slipped through without harm. For instance opengl32.wglUseFontBitmapsW() is explicitly imported by ordinal but the app is clearly ANSI.
I found a pattern: the suspicious imports (ordinal) were off by one.
Instead of calling opengl32.glMultMatrixd(), the preceding function opengl32.glMatrixMode() with "GLenum mode" parameter made perfect sense with the constant pushed on stack. Also opengl32.wglUseFontBitmapsA() which precedes opengl32.wglUseFontBitmapsW().
Armed with that knowledge, I found the discrepancy in the list of opengl32 exports:
http://www.ccp14.ac.uk/ccp/ccp14/ftp-mirror/programming/mingw32/home/janjaap...
http://svn.dsource.org/projects/bindings/trunk/def/opengl32.def
There is an additional glDebugEntry() function listed in opengl32.dll which leads to ordinals for various exports shifted off by one.
This mailing list post also mentions the undocumented export:
http://tech.groups.yahoo.com/group/opengl-gamedev-l/message/15027
Prototype:
--- quote --- void APIENTRY glDebugEntry(DWORD dwArg1, DWORD dwArg2) --- quote ---
Wine source:
http://source.winehq.org/git/wine.git/blob/03c7dfbd4d5cb847af1f905c0414832c2...
--- snip --- ... 58 @ stdcall glCullFace( long ) wine_glCullFace 59 @ stdcall glDeleteLists( long long ) wine_glDeleteLists 60 @ stdcall glDeleteTextures( long ptr ) wine_glDeleteTextures ... --- snip ---
After adding glDebugEntry() stub the demo starts fine.
Regards
http://bugs.winehq.org/show_bug.cgi?id=29551
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download URL| |http://www.pouet.net/prod.p | |hp?which=56902
--- Comment #1 from Anastasius Focht focht@gmx.net 2012-01-06 19:08:34 CST --- Hello,
filling fields...
$ sha1sum FLP-PR.EXE f4f44a9df7774f2b24bec5a85c4fc367fbdd33f3 FLP-PR.EXE
$ wine --version wine-1.3.36-172-gb00e703
Regards
http://bugs.winehq.org/show_bug.cgi?id=29551
--- Comment #2 from Stefan Leichter Stefan.Leichter@camLine.com 2012-01-08 07:57:21 CST --- I have sent a patch (http://source.winehq.org/patches/data/82478)
http://bugs.winehq.org/show_bug.cgi?id=29551
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |97b9fc9e396c417b933c3710540 | |fe428f7ae57e2 Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #3 from Anastasius Focht focht@gmx.net 2012-01-09 14:49:33 CST --- Hello,
this is fixed by commit http://source.winehq.org/git/wine.git/commitdiff/97b9fc9e396c417b933c3710540...
The demo now runs as expected ;-)
Thanks Stefan.
Regards
http://bugs.winehq.org/show_bug.cgi?id=29551
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Alexandre Julliard julliard@winehq.org 2012-01-13 13:51:36 CST --- Closing bugs fixed in 1.3.37.
https://bugs.winehq.org/show_bug.cgi?id=29551
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- URL|http://www.pouet.net/prod.p |https://web.archive.org/web |hp?which=56902 |/20180812060905/http://arch | |ive.scene.org/pub/parties/2 | |011/revision11/intro_pc4k/f | |lp-pr.zip