digitalmars.D.bugs - Object overwritten ??? This is crazy
- David Medlock (23/23) Apr 07 2005 This seems truly bizarre.
- David Medlock (35/67) Apr 07 2005 The plot thickens. I think I have it narrowed down to this function:
- Thomas Kuehne (14/36) Apr 07 2005 -----BEGIN PGP SIGNED MESSAGE-----
- David Medlock (7/53) Apr 07 2005 LOL. Thanks for chopping that down, Thomas. (You don't really have such
- Thomas Kuehne (14/20) Apr 07 2005 -----BEGIN PGP SIGNED MESSAGE-----
- Charlie (4/23) Apr 07 2005 Where'd you get this magical program :) ?
- Thomas Kuehne (10/27) Apr 07 2005 -----BEGIN PGP SIGNED MESSAGE-----
This seems truly bizarre.
Attached are the two files I am having issue with in DMD v120 on WinXP.
Compiling these with DMD 119 works just fine.
I have a generic Array template class, which I use as a stack class for
a Vector math class which implements vector math operations in a
forth-like manner(push/pop).
My test loop is cut down to the following:
/// Begin Code
void main( char[][] arg )
{
VecStack vm = new VecStack();
vm.push( 0, 0, radians(90) );
double[16] M;
vm.euler_to_matrix( M );
// *********** Here vm is now NULL !!!!!
writefln( "Euler(0,0,90 degrees) -> Matrix" );
Matrix!(double).Print( M );
assert( vm.count==0 ); // access violation
}
After calling vm.euler_to_matrix( M ) the vm variable is CLEARED??
Can anyone provide insight here? I will try to cut it down later, as I
am at work.
-David
Apr 07 2005
David Medlock wrote:
This seems truly bizarre.
Attached are the two files I am having issue with in DMD v120 on WinXP.
Compiling these with DMD 119 works just fine.
I have a generic Array template class, which I use as a stack class for
a Vector math class which implements vector math operations in a
forth-like manner(push/pop).
My test loop is cut down to the following:
/// Begin Code
void main( char[][] arg )
{
VecStack vm = new VecStack();
vm.push( 0, 0, radians(90) );
double[16] M;
vm.euler_to_matrix( M );
// *********** Here vm is now NULL !!!!!
writefln( "Euler(0,0,90 degrees) -> Matrix" );
Matrix!(double).Print( M );
assert( vm.count==0 ); // access violation
}
After calling vm.euler_to_matrix( M ) the vm variable is CLEARED??
Can anyone provide insight here? I will try to cut it down later, as I
am at work.
-David
The plot thickens. I think I have it narrowed down to this function:
final void quat_to_matrix( double[16] M ) // ( q -- )
{
normalize();
quat v = pop();
double xx = v.x*v.x;
double xz = v.x*v.z;
double xy = v.x*v.y;
double xw = v.x*v.w;
double yy = v.y*v.y;
double yz = v.y*v.z;
double yw = v.y*v.w;
double zz = v.z*v.z;
double zw = v.z*v.w;
M[] = 0;
M[15] = 1;
M[0] = 1 - 2 * (yy + zz) ;
M[1] = 2 * (xy + zw) ;
M[2] = 2 * (xz - yw) ;
M[4] = 2 * (xy - zw) ;
M[5] = 1 - 2 * (xx + zz) ;
M[6] = 2 * (yz + xw) ;
M[8] = 2 * (xz + yw) ;
M[9] = 2 * (yz - xw) ;
M[10] = 1 - 2 * (xx + yy) ;
}
The line which is the problem is:
M[] = 0;
Since M is passed on the stack it overwrites itself and part of the
calling stack frame, it appears. What is weird is that function is
called by euler_to_quat() , but if you call quat_to_matrix() directly
then no access violation.
Walter, is this a bug in the code generator?
-David
Apr 07 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
David Medlock schrieb am Thu, 07 Apr 2005 10:49:31 -0400:
This seems truly bizarre.
Attached are the two files I am having issue with in DMD v120 on WinXP.
Compiling these with DMD 119 works just fine.
I have a generic Array template class, which I use as a stack class for
a Vector math class which implements vector math operations in a
forth-like manner(push/pop).
My test loop is cut down to the following:
/// Begin Code
void main( char[][] arg )
{
VecStack vm = new VecStack();
vm.push( 0, 0, radians(90) );
double[16] M;
vm.euler_to_matrix( M );
// *********** Here vm is now NULL !!!!!
writefln( "Euler(0,0,90 degrees) -> Matrix" );
Matrix!(double).Print( M );
assert( vm.count==0 ); // access violation
}
After calling vm.euler_to_matrix( M ) the vm variable is CLEARED??
Can anyone provide insight here? I will try to cut it down later, as I
am at work.
Added to DStress as
http://dstress.kuehne.cn/run/bug_20050407_01.d
http://dstress.kuehne.cn/run/bug_20050407_02.d
http://dstress.kuehne.cn/run/bug_20050407_03.d
Thomas
PS: thanks heaven for automatic bug cutters *g*
-----BEGIN PGP SIGNATURE-----
iD8DBQFCVXwK3w+/yD4P9tIRApi9AJ0XOCpeBlz2R+RScZSq7P2MCLEFlgCeOh0s
vdIuX2uDPKQQA0NfKwDnhX8=
=6Pi3
-----END PGP SIGNATURE-----
Apr 07 2005
Thomas Kuehne wrote:-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 David Medlock schrieb am Thu, 07 Apr 2005 10:49:31 -0400:LOL. Thanks for chopping that down, Thomas. (You don't really have such a program do you ? ;) I am very interested how the stack frame is getting clobbered, though. Whatever quibbles we have over syntax and semantics, correctness is of paramount importance for confidence in DMD. -DavidMThis seems truly bizarre. Attached are the two files I am having issue with in DMD v120 on WinXP. Compiling these with DMD 119 works just fine. I have a generic Array template class, which I use as a stack class for a Vector math class which implements vector math operations in a forth-like manner(push/pop). My test loop is cut down to the following: /// Begin Code void main( char[][] arg ) { VecStack vm = new VecStack(); vm.push( 0, 0, radians(90) ); double[16] M; vm.euler_to_matrix( M ); // *********** Here vm is now NULL !!!!! writefln( "Euler(0,0,90 degrees) -> Matrix" ); Matrix!(double).Print( M ); assert( vm.count==0 ); // access violation } After calling vm.euler_to_matrix( M ) the vm variable is CLEARED?? Can anyone provide insight here? I will try to cut it down later, as I am at work.Added to DStress as http://dstress.kuehne.cn/run/bug_20050407_01.d http://dstress.kuehne.cn/run/bug_20050407_02.d http://dstress.kuehne.cn/run/bug_20050407_03.d Thomas PS: thanks heaven for automatic bug cutters *g*
Apr 07 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 David Medlock schrieb am Thu, 07 Apr 2005 16:24:31 -0400:Thomas Kuehne wrote:<snip>Sure I do. It did cut your posted code by factor 12. The remaining factor 0.11 was my intervention. Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCVZrd3w+/yD4P9tIRAvy0AJsFIaSHzsEYHterRLazK+HaNa6DFgCcCf5i VvNH3ZQRZnZsg3ajaR6O1jQ= =6QVE -----END PGP SIGNATURE-----PS: thanks heaven for automatic bug cutters *g*LOL. Thanks for chopping that down, Thomas. (You don't really have such a program do you ? ;)
Apr 07 2005
Where'd you get this magical program :) ? Charlie! "Thomas Kuehne" <thomas-dloop kuehne.thisisspam.cn> wrote in message news:tfigi2-6t3.ln1 lnews.kuehne.cn...-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 David Medlock schrieb am Thu, 07 Apr 2005 16:24:31 -0400:Thomas Kuehne wrote:<snip>Sure I do. It did cut your posted code by factor 12. The remaining factor 0.11 was my intervention. Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCVZrd3w+/yD4P9tIRAvy0AJsFIaSHzsEYHterRLazK+HaNa6DFgCcCf5i VvNH3ZQRZnZsg3ajaR6O1jQ= =6QVE -----END PGP SIGNATURE-----PS: thanks heaven for automatic bug cutters *g*LOL. Thanks for chopping that down, Thomas. (You don't really have such a program do you ? ;)
Apr 07 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charlie schrieb am Thu, 7 Apr 2005 15:47:22 -0500:Where'd you get this magical program :) ? Charlie!custom inhouse development Thomas"Thomas Kuehne" <thomas-dloop kuehne.thisisspam.cn> wrote in message news:tfigi2-6t3.ln1 lnews.kuehne.cn...-----BEGIN PGP SIGNATURE----- iD8DBQFCVhud3w+/yD4P9tIRAjsEAJ9hwMQ6DrbFHDRxR0wkgBZ9//2YuQCfV78j P/sX90hW9QIh6MUwMF2U6QI= =izG4 -----END PGP SIGNATURE-----David Medlock schrieb am Thu, 07 Apr 2005 16:24:31 -0400:Thomas Kuehne wrote:<snip>Sure I do. It did cut your posted code by factor 12. The remaining factor 0.11 was my intervention.PS: thanks heaven for automatic bug cutters *g*LOL. Thanks for chopping that down, Thomas. (You don't really have such a program do you ? ;)
Apr 07 2005









David Medlock <amedlock nospam.org> 