DWT+OpenGL crashing on Vista

Sergey Gromov snake.scaly at gmail.com
Mon Jan 19 06:26:15 PST 2009


Mon, 19 Jan 2009 10:20:51 +0900, Bill Baxter wrote:

> On Mon, Jan 19, 2009 at 8:53 AM, Sergey Gromov <snake.scaly at gmail.com> wrote:
>> Mon, 19 Jan 2009 07:17:16 +0900, Bill Baxter wrote:
>>
>>> Here's a modified version of one of the DWT opengl snippets that
>>> reproduces the crash for me.
>>> About 1 in 10-15 runs this will crash (seems to be inside the GL
>>> driver) soon after startup with the error:
>>>
>>> """
>>> dwt.DWTException.DWTException: Failed to execute runnable
>>>
>>> object.Exception: Access Violation
>>> """
>>>
>>> Can anyone else reproduce this (particularly Vista users)?
>>> I'd be happy to send the exe to anyone who would like to try it off
>>> list.  But it's a 3MB exe  (compresses to about .7 MB).
>>
>> Yes I can.  From the first try.
>>
>> I've got an XP Home laptop, core 2 duo at 1.83GHz, 1GB RAM, GeForce Go
>> 7600.  DWT is trunk r119.  Derelict is trunk r308.
>>
>> The executable is 2MB, built in about 6.5s.
>>
>> It's almost 100% reproducible.  I mean it worked only once out of ~30
>> tries.
> 
> Ok, so it did work once?  You saw some blue dots rotating around one time?

Yes.  I see them every time before they crash, but once they kept
rotating until I closed the app.

> Anyway, very encouraging to me.  Sounds like my code is not to blame
> after all... but which code is to blame.

Cannot see how you came to this conclusion.  ;D

> Also interesting that the common factor seems to be the core 2 duo.
> Do you have new-ish GeForce drivers?  I haven't updated the drivers on
> this machine where it works for a good long while.  And it sounds like
> your card is similar era.

I've got 177.66 drivers downloaded from NVidia and hacked to work with
my Samsung laptop.  These are pretty recent.

> Another question for you Sergey, do you have VSync turned off by any chance?
> If this is some kind of multi-threading race situation, then not
> having VSync on could maybe be increasing the frequency with which the
> threads stomp on each other.

Yes I had it turned off.  I tried to play with this setting and noticed
that, although with VSync ON the dots rotate much slower, they always
rotate approx. to the same *degree* before the crash.

> Also note that to get the crash to happen it seemed to be necessary to
> add both the menu and the CTabFolder to that example.
> Additionally I just noticed that if I click and hold on the tab's
> text, the gl updates pause for about a second but then resume.  This
> is coincidentally about as long as the program seems to run before it
> crashes for me (when it does crash).  So maybe there's some kind of
> background thread being used by that CTabItem.

I've removed both menu and tab like this:

| public static void main() 
| {
|     Display display = new Display();
|     Shell shell = new Shell(display);
| //    auto menubar = new Menu (shell, DWT.BAR);
| //    shell.setMenuBar(menubar);
| //    shell.setText("OpenGL in DWT");
| //    shell.setLayout(new FillLayout());
| 
| //    auto tabs = new CTabFolder(shell, DWT.BORDER);
| //    auto titem = new CTabItem(tabs, DWT.CLOSE);
| 
|     GLData data = new GLData();
|     data.doubleBuffer = true;
|     data.alphaSize = 8; // want an alpha channel for readback of framebuffer w/ mask.
|     final GLCanvas canvas = new GLCanvas(shell, DWT.NO_BACKGROUND, data);
| 
| //    titem.setText("Canvas");
| //    titem.setControl(canvas);
| 
|     canvas.addControlListener(new class ControlAdapter {

The crash happens nevertheless, although now I cannot see the dots.



More information about the Digitalmars-d mailing list