[Bug 29551] New: Panta Rhei demoscene demo crashes on startup due to missing opengl32.dll glDebugEntry export/stub

wine-bugs at winehq.org wine-bugs at winehq.org
Fri Jan 6 19:06:55 CST 2012


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 at winehq.org
        ReportedBy: focht at 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/mingw32/platform-SDK/def/opengl32.def

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/03c7dfbd4d5cb847af1f905c0414832c2f61e4e3:/dlls/opengl32/opengl32.spec#l58

--- 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

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list