Home | Info | Community | Development | myReactOS

  1. Home
  2. Info
  3. Community
  4. Development
  5. myReactOS

  1. Main Page
  2. New
  3. Search
  4. Reports
  5. Requests

  1. Login
  2. Register

ReactOS bug tracking and reporting - Bug 4385 – PATCH: NtCurrentTeb()->glTable pointer is corrupted when using vboxogl.dll

First Last Prev Next    No search results available
Details
: PATCH: NtCurrentTeb()->glTable pointer is corrupted when ...
Bug#: 4385
:
: ReactOS
: Win32
Status: RESOLVED
Resolution: INVALID
: VirtualBox
: Microsoft Windows XP
: TRUNK
: P3
: normal
: ---

:
:
:
  Show dependency tree - Show dependency graph
People
Reporter: rmh <rmh.reactos@aybabtu.com>
Assigned To: preston <kamil.hornicek@reactos.org>
: Bug Zilla <ros-bugs@reactos.org>
:

Attachments
patch (694 bytes, patch)
2009-04-15 21:10 CET, rmh
Details


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2009-04-15 21:10 CET
Created an attachment (id=3837) [details]
patch

When using VirtualBox OpenGL ICD (vboxogl.dll), NtCurrentTeb()->glTable ends up
corrupted.  Events happen as follows:

- opengl32.dll is loaded
- OPENGL32_ThreadAttach() is run, allocating and initializing
NtCurrentTeb()->glTable
- rosglCreateLayerContext() is called by user (in my test, wined3d)
- icd->DrvCreateLayerContext() from vboxogl.dll is called.  After return,
NtCurrentTeb()->glTable points somewhere else, resulting in segfault or memory
corruption.

This problem doesn't happen with MS opengl32.dll.  I suspect the ICD is
starting new threads, and the allocation/initialization that is done in
OPENGL32_ThreadAttach should happen when a context is created instead.  I
managed to work around the problem with the attached patch.

Another oddity factor is that wined3d creates a context more than once during
initialization, which is unusual AFAIK.

Note1: My tests are with latest wined3d (1.1.19).  See
http://www.nongnu.org/wined3d/ for win32 builds.
Note2: see also bug 4384
------- Comment #1 From preston 2009-04-15 21:51:15 CET -------
Hi,
wined3d creates one fake opengl context which is released later.

And it would be ultra-nice from you to use our version of wined3d so we all
work with the same code.
------- Comment #2 From rmh 2009-04-15 22:12:31 CET -------
(In reply to comment #1)
> Hi,
> wined3d creates one fake opengl context which is released later.

Yeah, do you think this could be related to the problem?

> And it would be ultra-nice from you to use our version of wined3d so we all
> work with the same code.

Well, I'm doing the tests on XP, and using wined3d 1.1.19 which includes recent
fixes related to VBox.  I'm not sure which version of wined3d is in your tree,
but I strongly advice to upgrade if it's older than 1.1.19.  This was the first
release that worked on a MS-opengl32.dll/VBoxOGL.dll/XP stack without patching
(my current interest in ReactOS is replacing MS opengl32.dll).
------- Comment #3 From Lone_Rifle 2009-04-16 08:20:30 CET -------
(In reply to comment #2)
> 
> Well, I'm doing the tests on XP, and using wined3d 1.1.19 which includes recent
> fixes related to VBox.  I'm not sure which version of wined3d is in your tree,
> but I strongly advice to upgrade if it's older than 1.1.19.  
>

Sync was done recently on r40534. Are you planning to submit a patch to Wine as
well btw? 
------- Comment #4 From rmh 2009-04-16 09:26:01 CET -------
(In reply to comment #3)
> Are you planning to submit a patch to Wine as
> well btw? 

My patch is for opengl32.dll, not Wine!  And it's a workaround anyway, it's not
meant to be merged anywhere...
------- Comment #5 From Lone_Rifle 2009-04-16 09:50:44 CET -------
(In reply to comment #4)
> My patch is for opengl32.dll, not Wine!  And it's a workaround anyway, it's not
> meant to be merged anywhere...
> 

okay, disregard my earlier comment, i'm not clear as to what's going on..
------- Comment #6 From rmh 2009-04-22 21:19:49 CET -------
This might (or might not) be related to this problem:

http://www.virtualbox.org/ticket/3762
http://www.virtualbox.org/changeset/19099

Note that the problem was found using the 2.1 version of VirtualBox Guest
Additions
------- Comment #7 From basisbit 2009-08-08 01:01:03 CET -------
please reconfirm this. it seems to be fixed in virtualbox now.
------- Comment #8 From gabrielilardi 2009-11-17 14:25:29 CET -------
Consulted myself with Kamil, closing as the bug was in vbox ogl driver, and the
patch is a hack.

First Last Prev Next    No search results available