Page 1 of 1

Worst bugs you had

Posted: Tue Aug 14, 2012 10:10 am
by REDDemon
Things that went wrong because of stupid errors that compiler was not able to warn about. Or just very strange bugs. Put them here if you had one.

I recently had one.

Code: Select all

 
A = stack*C*(78*+3*D);
 
that should be

Code: Select all

 
A = stack*C*(78+3*D);
 
the compiler didn't warned about " *+ " (wich can be correct or not from sintax point of view, but I don't think is a very often used combination of characters.)

Does Visual studio throws warnings or it silently compile like gcc?

Re: Worst bugs you had

Posted: Tue Aug 14, 2012 12:33 pm
by mongoose7
Looks like A = stack*C*(78*(+3)*D);

which is correct code. No compiler would generate an error. I guess, knowing GCC (not very well :P), that it could suggest that the construction may not be what you intended, but it is difficult to warn about correct code, particularly if the expression already has brackets.

Re: Worst bugs you had

Posted: Tue Aug 14, 2012 8:35 pm
by kazymjir
Hundreds pointers related problems.

I had many problems like yours REDDemon, it's damn hard to find and debug such things. It's like asking yourself all the time "WTF" and having no idea what is going on :)

Re: Worst bugs you had

Posted: Mon Sep 17, 2012 7:57 am
by stefbuet
GLSL :
clamp(x,0.00000001, 0.9999999) did not work (no effect).
But no shader compilation fail.
clamp(x,0.0001, 0.9999) did work.
I had this problem for 6 months :D

Re: Worst bugs you had

Posted: Mon Sep 17, 2012 8:26 am
by Mel
shaders use very limited precision, anything beyond 5 decimals will give trouble for sure.

Re: Worst bugs you had

Posted: Mon Sep 17, 2012 9:43 am
by CuteAlien
One of the hardest to find bugs which I've seen several times already is someone (could really be anyone ... like me for example) using references to elements in dynamic arrays (vectors). And then adding some element to the array and forgetting that there are references used. What makes this bug so evil is that it will work up to the moment the array is resized - which might not even happen in simple tests.

Re: Worst bugs you had

Posted: Tue Sep 18, 2012 7:01 am
by Cube_
the worst one I had was when (For a lovely little test program I made) I tried making a anti-cheat and anti-piracy system... somehow it didn't really work... and I can't quite describe what happened either (Complicated, ridicioulosly glitchy things happened, then it kind of exploded and CTD'd)