1. odd error with read_bitmap()
- Posted by "John McAdam" <johnmcadam at clix.pt> May 02, 2004
- 426 views
This is really odd. In my program I call read_bitmap (s=read_bitmap("myfile.bmp") and check the length of the sequence. It is 2. That is correct. I then display the bitmap and it displays ok. The whole program runs fine. But when I return to the editor, I get a type check error that says s=1. (s is declared as a sequence) If I rerun the program I get this windows error: subsystem MS_DOS 16 bits in cmd.exe O cpu ntvdm found the following illegal instruction CS:d402 IP:0000 OP:ff 3f ff 1f ff select Quit or Ignore Then dos aborts back to windows. Odd, yes? Why does it run once but not twice? Taking the offending subroutine to a little test.ex file runs fine every time, so maybe it is some leaky memory thing? If that is the case, is there something I can do about it? Why does my program run but give me a type check error anyways? It doesn't make any difference if I have with or without type_check. John
2. Re: odd error with read_bitmap()
- Posted by CoJaBo <cojabo at suscom.net> May 02, 2004
- 404 views
Sounds like you are reading/writing outside the allocated memory, I did that once and got completly random results. Try using the trace feature in Eu, the last line in the file should be the one that caused the crash. John McAdam wrote: > > This is really odd. > In my program I call read_bitmap (s=read_bitmap("myfile.bmp") and check > the length of the sequence. It is 2. That is correct. I then display the > bitmap and it displays ok. The whole program runs fine. But when I > return to the editor, I get a type check error that says s=1. (s is > declared as a sequence) If I rerun the program I get this windows error: > > subsystem MS_DOS 16 bits > in cmd.exe > O cpu ntvdm found the following illegal instruction > CS:d402 IP:0000 OP:ff 3f ff 1f ff > select Quit or Ignore > > Then dos aborts back to windows. > > Odd, yes? > > Why does it run once but not twice? Taking the offending subroutine to a > little test.ex file runs fine every time, so maybe it is some leaky > memory thing? If that is the case, is there something I can do about it? > Why does my program run but give me a type check error anyways? It > doesn't make any difference if I have with or without type_check. > > John > >
3. Re: odd error with read_bitmap()
- Posted by Mario Steele <eumario at tuscanchat.com> May 04, 2004
- 386 views
John McAdam wrote: > > >>posted by: CoJaBo <cojabo at suscom.net> >> >>Sounds like you are reading/writing outside the allocated memory, >> I did that once and got completly random results. >>Try using the trace feature in Eu, >>the last line in the file should be the one that caused the crash. >> >> >I am just showing a bitmap on the screen. I think maybe the interpreter >is writing into the variable memory space. >It is quite consistant. My program runs fine, then gives me a type check >error when I return to the interpreter. >If I run my program again, windows aborts it. I have the public domain >version, so I can't trace. I test the >value of my sequence in the program and it is ok. After the program >runs, the interpreter says my sequence has the >value of 1, but I don't give it that value anywhere, so how does it get >that value, if not a bug in the interpreter? >My bitmap is a full screen picture in mode 261, 256 colors, so it is >quite big. It is my opening screen. Then I switch >to text mode and don't use it again. > > Well, in reply to your first email. without type_check will only turn off User declared type's. EG:
type a(object c) if a = 1 then return 1 else return 0 end if end type
without type_check will cause that type never to execute. Internal Euphoria Type Checks will continue to be processed like usual. As to the specific problem, try changing the sequence variable to a object variable, to prevent it from crashing with a type_check error. As to why this is happening, I have no clue, have to see some code first, before I can make any assesments. (Like Matt Lewis said) -- Enchanted Blade (Mario) Brain: Come Pinky, let's return to the cage, to plan for tommorrow night. Pinky: Why Brain, what are we gonna do tommorrow night? Brain: Same thing we do every night Pinky, try to take over the world!