View previous topic :: View next topic |
Author |
Message |
romain337
Joined: 30 Jan 2012 Posts: 5
|
Posted: Wed Feb 08, 2012 4:00 pm Post subject: Derelict2 r624 bug |
|
|
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 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 |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Wed Feb 08, 2012 11:24 pm Post subject: |
|
|
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 |
|
|
romain337
Joined: 30 Jan 2012 Posts: 5
|
Posted: Thu Feb 09, 2012 3:54 am Post subject: |
|
|
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 Rollback again to r622. _________________ romain337 |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Thu Feb 09, 2012 4:33 am Post subject: |
|
|
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 |
|
|
romain337
Joined: 30 Jan 2012 Posts: 5
|
Posted: Thu Feb 09, 2012 5:03 pm Post subject: |
|
|
This is a FAIL 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 |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Fri Feb 10, 2012 10:44 am Post subject: |
|
|
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 |
|
|
romain337
Joined: 30 Jan 2012 Posts: 5
|
Posted: Fri Feb 10, 2012 3:56 pm Post subject: |
|
|
that work. thanx _________________ romain337 |
|
Back to top |
|
|
|