FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Derelict2 r624 bug

 
Post new topic   Reply to topic     Forum Index -> Derelict
View previous topic :: View next topic  
Author Message
romain337



Joined: 30 Jan 2012
Posts: 5

PostPosted: Wed Feb 08, 2012 4:00 pm    Post subject: Derelict2 r624 bug Reply with quote

trying to compile my opengl framework using Derelict2 r624 give me this error:

TheSecretDisk.exe
core.exception.RangeError@derelict.opengl.extloader(150): Range violation
----------------
src\extern\derelict\opengl\extl
oader.d(150): derelictopenglextloaderextIsSupportedverify
src\extern\derelict\opengl\extl
oader.d(157): derelictopenglextloaderextIsSupported
src\extern\derelict\opengl\extl
oader.d(743): derelictopenglextloaderload_GL_ARB_multitexture
src\extern\derelict\opengl\extl
oader.d(183): derelictopenglextloaderextLoadCommon
src\extern\derelict\opengl\extl
oader.d(107): derelictopenglextloaderextLoadAll
src\extern\derelict\opengl\gl.d
(148): derelictopenglglDerelictGLLoaderloadExtensions
src\framework\window.d(101): dm
oframeworkwindowGLWindowrun
src\main.d(181): D main
----------------
core.exception.InvalidMemoryOperationError


Hope i have not created an already posted bug Smile thx

* Using the file Derelict2/DerelictGL/derelict/opengl/extloader.d from the r622 resolve the issue. Sorry, i was too tired to write a patch for you -_-

night
_________________
romain337
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Wed Feb 08, 2012 11:24 pm    Post subject: Reply with quote

Ah, thanks. That was a silly mistake from when I updated the extension loader. I've just committed a fix for it.
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
romain337



Joined: 30 Jan 2012
Posts: 5

PostPosted: Thu Feb 09, 2012 3:54 am    Post subject: Reply with quote

aldacron wrote:
Ah, thanks. That was a silly mistake from when I updated the extension loader. I've just committed a fix for it.


The error is still here Very Happy Rollback again to r622.
_________________
romain337
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Thu Feb 09, 2012 4:33 am    Post subject: Reply with quote

Damn. I see what I did wrong. OK. If you update to the latest revision it should really, really be fixed this time!
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
romain337



Joined: 30 Jan 2012
Posts: 5

PostPosted: Thu Feb 09, 2012 5:03 pm    Post subject: Reply with quote

This is a FAIL Smile Rolling back again :p
I'm trying to see what is going wrong. The range exception come from line 150.


bool verify(string s)
{
auto idx = index + extName.length;
if(s[idx] == ' ' || s[idx] == '\0') // Line 150 here!
return true;
return false;
}

replace with:

bool verify(string s)
{
auto idx = index + extName.length;
if(idx >= s.length) return false;
if(s[idx] == ' ' || s[idx] == '\0')
return true;
return false;
}

My string s is 4523 char length. When the exception is throw, idx look at s[4523] wich cause the bug.

Before the exception is thrown, s equals WGL_*, then, it switch again to GL_*, and look for idx 4523. I have no more time to investigate now, maybe tomorrow.

night
_________________
romain337
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Fri Feb 10, 2012 10:44 am    Post subject: Reply with quote

romain337 wrote:

My string s is 4523 char length. When the exception is throw, idx look at s[4523] wich cause the bug.


So I guess what's happening is the conversion of the extension string from a C style char* to a D string eliminates the terminating null character. I assumed it would be kept. On my system, this doesn't show up because my driver adds a space to the end of the extension string. I assume that your driver does not.

Anyway, that's the theory. I'm going to read up on to!string, but for now I'm going to make one more attempt to fix this. This should do it, if I'm right:

Code:

bool verify(string s)
{
auto idx = index + extName.length;
// Should never be greater, but never say never
if(idx >= s.length || s[idx] == ' ')
return true;
return false;


_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
romain337



Joined: 30 Jan 2012
Posts: 5

PostPosted: Fri Feb 10, 2012 3:56 pm    Post subject: Reply with quote

that work. thanx
_________________
romain337
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Derelict All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group