Jump to page: 1 2
Thread overview
Error: Access Violation
Nov 14, 2004
Ant
Nov 14, 2004
Ant
Nov 14, 2004
h3r3tic
Nov 14, 2004
h3r3tic
Nov 14, 2004
John Reimer
Nov 14, 2004
h3r3tic
Nov 14, 2004
John Reimer
Nov 14, 2004
Ant
Nov 15, 2004
Ant
Nov 15, 2004
h3r3tic
Nov 15, 2004
Ant
November 14, 2004
I have this program that runs on linux but crashs on windows:

class A
{
	bit mA()
	{
		prinf("entry A\n");
		// calls to external C libs
		printf("exit A\n");
		return true
	}
}
class B : A
{
	bit mB()
	{
		prinf("entry B\n");
		mA();
		printf("exit B\n");
		return true
	}
}

and this prints:
entry B
entry A
exit A

and crashes. It never reaches the printf just after the return from mA

how can that be?
Am I messing with the stack?
The pure C examples that use my external calls run perfectly.

There are no other threads running, wait,
let me suspend the GC...no luck: same result.

Ant

PS
this it OpenGL support for DUI on windows,
seems only the simplest OpenGL progams will run on DUI windows :(

November 14, 2004
On Sun, 14 Nov 2004 17:52:02 -0500, Ant wrote:

> I have this program that runs on linux but crashs on windows:
> 

ok only crashs on glFrustum(),
so never mind is the gl thing that is to blaim, some how.

Ant

November 14, 2004
Ant wrote:

> I have this program that runs on linux but crashs on windows:
> 
> class A
> {
> 	bit mA()
> 	{
> 		prinf("entry A\n");
> 		// calls to external C libs
> 		printf("exit A\n");
> 		return true
> 	}
> }
> class B : A
> {
> 	bit mB()
> 	{
> 		prinf("entry B\n");
> 		mA();
> 		printf("exit B\n");
> 		return true
> 	}
> }
> 
> and this prints:
> entry B
> entry A
> exit A
> 
> and crashes. It never reaches the printf just after the return from mA
> 
> how can that be?
> Am I messing with the stack?
> The pure C examples that use my external calls run perfectly.
> 
> There are no other threads running, wait,
> let me suspend the GC...no luck: same result.
> 
> Ant
> 
> PS
> this it OpenGL support for DUI on windows,
> seems only the simplest OpenGL progams will run on DUI windows :(
> 

How about posting some more source ? e.g. the complete program that crashes if that's possible. Or a minimal crashing program similar to this one of yours. I have a few opengl apps in D and they run fine...
November 14, 2004
Ant wrote:

> On Sun, 14 Nov 2004 17:52:02 -0500, Ant wrote:
> 
> 
>>I have this program that runs on linux but crashs on windows:
>>
> 
> 
> ok only crashs on glFrustum(),
> so never mind is the gl thing that is to blaim, some how.
> 
> Ant
> 

Now that is weird. glFrustum should be able to eat all kinds of params given to it. if the function is loaded dynamically maybe the address or params are wrong... no more clues :/
November 14, 2004
In article <pan.2004.11.14.22.52.02.426422@yahoo.ca>, Ant says...
>
>I have this program that runs on linux but crashs on windows:
>
>class A
>{
>	bit mA()
>	{
>		prinf("entry A\n");
>		// calls to external C libs
>		printf("exit A\n");
>		return true
>	}
>}

No semicolon after "return true"?

>class B : A
>{
>	bit mB()
>	{
>		prinf("entry B\n");
>		mA();
>		printf("exit B\n");
>		return true
>	}
>}

No semicolon here either?

>and this prints:
>entry B
>entry A
>exit A
>
>and crashes. It never reaches the printf just after the return from mA
>
>how can that be?
>Am I messing with the stack?
>The pure C examples that use my external calls run perfectly.
>
>There are no other threads running, wait,
>let me suspend the GC...no luck: same result.
>
>Ant
>
>PS
>this it OpenGL support for DUI on windows,
>seems only the simplest OpenGL progams will run on DUI windows :(
>


I don't know if the missing semicolons would cause the problem (or maybe it was just typed into the newsgroup post wrong).  I would think that the D compiler would catch that...

Later,

John


November 14, 2004
John Reimer wrote:
> I don't know if the missing semicolons would cause the problem (or maybe it was
> just typed into the newsgroup post wrong).  I would think that the D compiler
> would catch that...
> 
> Later,
> 
> John

Nope, that can't be the problem... also there's prinf instead of printf so he didn't paste his code...
November 14, 2004
In article <cn8p69$396$1@digitaldaemon.com>, h3r3tic says...
>
>
>Nope, that can't be the problem... also there's prinf instead of printf so he didn't paste his code...

Good point.

- John


November 14, 2004
On Sun, 14 Nov 2004 23:27:16 +0000, John Reimer wrote:

> In article <cn8p69$396$1@digitaldaemon.com>, h3r3tic says...
>>
>>
>>Nope, that can't be the problem... also there's prinf instead of printf so he didn't paste his code...
> 
> Good point.
> 
> - John

Sorry, guys, I did not copy/past it.

I thought it would be easier to read D than my
excuse for english.

glFrustum() does not exist, it require parameters...


Ant




November 15, 2004
here it is a copy past version, you gonna like it ;)
funny thing is that "version=glFloat" fails
but the "else" version is OK!
OpenGL on DUI for windows might be just around the corner
I'm blaiming DMD on this one also interesting to know
that DUI OpenGL extensions never worked for windows and
that's since version 0.70 or close.

(BTW this D code is from converted the GtkGlExt examples
and is GPL not LGPL.)

have fun! (I should probably post this on the bugs group)

##########################
  bit resizeGL(EventConfigure event = null)
  {

    writefln("resizeGL 1");
    GLfloat w = getWidth();
    GLfloat h = getHeight();

    double aspect;

    glViewport (0, 0, cast(int)w, cast(int)h);

    glMatrixMode (GL_PROJECTION);
    glLoadIdentity ();
    writefln("w=%s h=%s",w,h);
    version(glFloat)
    {
      if (w <h)
      {
        aspect = w / h;
        glFrustum (-aspect, aspect, -1.0, 1.0, 5.0, 60.0);
      }
      else
      {
        aspect = h / w;
        glFrustum (-1.0, 1.0, -aspect, aspect, 5.0, 60.0);
      }
    }
    else
    {
      double a = h / w;
      glFrustum(-1.0,1.0, -a, a, 5.0, 60.0);
    }

    glMatrixMode (GL_MODELVIEW);

    writefln("resizeGL exit");
    return true;
  }
#########################
output for the good version with the non relevante lines tabed right:
#########################
		initGL 1
		initGL exit
		configureFrame 1
		configureFrame 2
resizeGL 1
w=300 h=300
resizeGL exit
		here
		configureFrame 3
		configureFrame 4
		configureFrame 5
		configureFrame 8
		configureFrame 9
		initGL 1
		initGL exit
		drawGL 1
		drawGL exit
##########################

Ant
November 15, 2004
Ant wrote:
> 
> here it is a copy past version, you gonna like it ;)
> funny thing is that "version=glFloat" fails
> but the "else" version is OK!
> OpenGL on DUI for windows might be just around the corner
> I'm blaiming DMD on this one also interesting to know
> that DUI OpenGL extensions never worked for windows and
> that's since version 0.70 or close.
> (...)

Well, IMO this code is fine... my only guess of code that could crash the whole thing is that you define glFrustum as taking 6 floats (instead of doubles) when version(glFloat) is set... With this code I can't guess more... maybe if you posted your sources somewhere so that more people could compile and fight them, it could be solved...
As for the moment, ensure that your glFrustum is defined as taking 6 doubles...
No more ideas :(

</h3>
« First   ‹ Prev
1 2