Re: 2.4 Official Release - machine level exception
- Posted by Robert Craig <rds at RapidEuphoria.com> Jul 09, 2003
- 537 views
Pete Lomax wrote: > I get a machine-level exception during the statement > pos[P_yto]-=rely > where > pos = {24646,7901,32476,9990} > rely = -3543 > and P_yto is the constant 4 > > If I just insert eg 'if integer(rely) then end if' before that > statement it works fine. > > Worrying. > > If making such a tiny alteration makes the problem go away, it will > probably work fine on most other machines (or any with a slightly > different kernel32.dll etc)... > > Any ideas? Your little code fragment above works fine for me. I assume it's part of a much bigger program that has pokes, calls to C routines etc. Chances are, you have gone out of bounds with a poke, passed a bad value to a C routine, etc. The program could work fine on one run, but fail mysteriously on another, after any kind of trivial and seemingly irrelevant change. In this particular case you may be clobbering a Euphoria variable, stored in memory near one of your allocated blocks. Perhaps this is showing up now with 2.4, since the memory is organized differently. When using Win32Lib, I think you are now more likely to trash a Euphoria variable when you go out of bounds, rather than trashing another memory block that you allocated. I would at least try safe.e (see instructions at top of safe.e). Since Win32Lib has gone back to using Euphoria's allocate(), safe.e is now more effective. By default, in 2.4 Official, safe.e will only check the edges of blocks allocated by allocate(), so you shouldn't get any false alarms, but a lot of memory accesses will not be checked. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com