1. weird bug?
- Posted by Talvitie <smtoa at SAUNALAHTI.FI> Oct 09, 1999
- 474 views
- Last edited Oct 10, 1999
Here's a really weird bug: in my engine this causes it to crash: if ZBuffer[CamZB][pl+2]>z then TileBuffer[CamTile][pl+2]=3Drgb --pixel(col,{x,y}) ZBuffer[CamZB][pl+2]=3Dz end if but this works just fine: if ZBuffer[CamZB][pl+2]>z then TileBuffer[CamTile][pl+2]=3Drgb --pixel(col,{x,y}) if pl<1 or pl>2+640*480 then=20 end if ZBuffer[CamZB][pl+2]=3Dz end if WHY IN EARTH???? This line, if pl<1 or pl>2+640*480 then end if shouldn't affect in any way to my program. Have I found a bug in Euphoria or what? Has anyone else noticed something similar to this? --Talvitie
2. Re: weird bug?
- Posted by "Brian K. Broker" <bkb at CNW.COM> Oct 09, 1999
- 458 views
On Sat, 9 Oct 1999, Talvitie wrote: > Here's a really weird bug: > > in my engine this causes it to crash: > It would help if you could provide us with some details regarding the nature of the 'crash'... I realize that an empty if statement should have no impact on your program but some debug output might help to track down what is going on. -- Brian
3. Re: weird bug?
- Posted by Talvitie <smtoa at SAUNALAHTI.FI> Oct 09, 1999
- 445 views
- Last edited Oct 10, 1999
>It would help if you could provide us with some details regarding the >nature of the 'crash'... I realize that an empty if statement should = have >no impact on your program but some debug output might help to track = down >what is going on. > >-- Brian In Neil it just stops and shows an empty blank screen. I agree that an = empty if statement shouldn't impact in any way. I think that this bug or = whatever is in euphoria itself. Rob, any ideas?
4. Re: weird bug?
- Posted by Robert Craig <rds at ATTCANADA.NET> Oct 09, 1999
- 555 views
Talvitie writes: > In Neil it just stops and shows an empty blank screen. > I agree that an empty if statement shouldn't impact in any way. > I think that this bug or whatever is in euphoria itself. > Rob, any ideas? Weird bugs like this are almost always due to your program writing into areas of memory that don't belong to it. Whether you add a dummy statement or a whole extra include file is largely irrelevant. The point is that you are changing the memory addresses and contents, so the bug might just go away by luck. To debug this, you should copy euphoria\include\safe.e into your working directory, then rename safe.e as machine.e. safe.e provides safer versions of the routines in machine.e such as poke() and mem_copy(). Run the program again. It will say "Using Debug Version of machine.e". The routines in safe.e will often catch the bug. If they don't, it's still probably a memory-related bug in your program (or in Neil) - interpreter bugs are very rare compared to application bugs. Of course, if you can clearly demonstrate that it's the interpreter at fault, I'll be glad to look at it. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com
5. Re: weird bug?
- Posted by Talvitie <smtoa at SAUNALAHTI.FI> Oct 10, 1999
- 484 views
>Weird bugs like this are almost always due to >your program writing into areas of memory that >don't belong to it. Whether you add a dummy statement or >a whole extra include file is largely irrelevant. The point is >that you are changing the memory addresses and contents, >so the bug might just go away by luck. > >To debug this, you should copy euphoria\include\safe.e into >your working directory, then rename safe.e as machine.e. >safe.e provides safer versions of the routines in >machine.e such as poke() and mem_copy(). >Run the program again. It will say >"Using Debug Version of machine.e". The routines >in safe.e will often catch the bug. If they don't, it's still probably >a memory-related bug in your program (or in Neil) - >interpreter bugs are very rare compared to application bugs. >Of course, if you can clearly demonstrate that it's the >interpreter at fault, I'll be glad to look at it. > >Regards, > Rob Craig Bad news: I removed Neil from my engine so it won't use machine.e or = display graphics anymore. The bug stays! I have two almost identical = subroutines in my engine: Gouraud and Flat. Gouraud does it well, but = Flat crashes. Also if I remove this line: " ZBuffer[CamZB][pl+2]=3Dz = " from Flat's command lines it doesn't do anything weird. But, cause = Flat and Gouraud are identical in this point, it means that I'm not = writing to a bad place (ie. ZBuffer[-1][-5]) either. I'm not using any = machine language, so this just migth be a interpreter bug. From Flat: if ZBuffer[CamZB][pl+2]>z then TileBuffer[CamTile][pl+2]=3Drgb --!!!!!!!!!! HERE'S THE BUG !!!!!!!!!!!!! comment the next line and = the program will crash! if pl<1 or pl>2+640*480 then end if -- if you comment the next line then the program will run just = nice, and you don't need the=20 --previous one either to prevent crash ZBuffer[CamZB][pl+2]=3Dz end if From Gouraud: if ZBuffer[CamZB][pl+2]>z then TileBuffer[CamTile][pl+2]=3Dfloor(rgbIn*(x-x1)+rgb1) --This works just fine! ZBuffer[CamZB][pl+2]=3Dz end if If you like Rob, I can send you the source so that you may check it. --Talvitie
6. Re: weird bug?
- Posted by Robert Craig <rds at ATTCANADA.NET> Oct 11, 1999
- 433 views
Talvitie writes: > If you like Rob, I can send you the source so that you > may check it. OK, send it along. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com
7. Re: weird bug?
- Posted by Talvitie <smtoa at SAUNALAHTI.FI> Oct 11, 1999
- 436 views
- Last edited Oct 12, 1999
>Talvitie writes: >> If you like Rob, I can send you the source so that you >> may check it. > >OK, send it along. > >Regards, > Rob Craig > Rapid Deployment Software > http://www.RapidEuphoria.com Oops. I got the include file but lost the one that read it. Now I have to 1. write a new file 2. check if the bug still exists in my current engine version In both cases I hope you can wait a couple of days sincerely, --Talvitie
8. Re: weird bug?
- Posted by Talvitie <smtoa at SAUNALAHTI.FI> Oct 19, 1999
- 468 views
- Last edited Oct 20, 1999
Pete wrote: >Talvitie- >I look at safe.e and it appears that get_pixel was called with y=3D201 = on a >201x201 virtual screen (in LoadImage). The only valid ranges for y = should >be from 0 to 200. I fixed that one. thanks :)=20 The bug is gone(won't crash anymore) but now there's another: my engine = speed is only half of the original if I uncomment the "unneccessary" = line in it. But hey, don't you guys worry about that now.=20 I'll write again if I can't remove it while being in optimization phase. = And I got a lot to do before I get there. ;) --Talvitie