exception: access violation >Exit code: 1

Questions and discussion about the ZBasic IDE.
Post Reply
tomhilton
Posts: 26
Joined: 03 July 2009, 8:24 AM
Location: Peoria AZ
Contact:

exception: access violation >Exit code: 1

Post by tomhilton »

>"C:\Program Files\ZBasic\zbasic.exe" --target-device=ZX24p --directory="C:\Users\tom Hilton\Desktop\Observatory\Focuser/" "Focus_Zbasic.bas"
Internal error: exception: access violation
>Exit code: 1

What doe the above error message mean.

I get it where using a ZX-24p or ZX-24n device. It just started this
afternoon. The program was working last night.
Thomas Hilton
www.arizonaskys.com
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: exception: access violation >Exit code: 1

Post by dkinzer »

tomhilton wrote:What doe the above error message mean.
It means that there is a coding error in the compiler where an unexpected set of circumstances is not being handled properly. We would need the code that you're compiling when the error occurs to track down the problem.
- Don Kinzer
tomhilton
Posts: 26
Joined: 03 July 2009, 8:24 AM
Location: Peoria AZ
Contact:

Post by tomhilton »

I found it thanks. Had calltask inside the do loop inside the main routine.

Funny it showed up when the file was being compiled as a project but not
when it was being compiled a just a bas file.
Thomas Hilton
www.arizonaskys.com
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

tomhilton wrote:I found it thanks. Had calltask inside the do loop inside the main routine.
The point is that a well-behaved application should never generate unhandled exceptions like this no matter what the user input is.

If you can give me a simple test case that generates the exception that would be great. If you'd rather not spend the time to produce a whittled down test case I'd be happy to get the full source code of your application that manifests the issue. I do want to correct the problem.
- Don Kinzer
deadmm
Posts: 3
Joined: 17 March 2006, 6:37 AM
Location: Cambridge, UK

Post by deadmm »

OK Don, you asked for it ! - here's a complex bit of erroneous code I've just managed to write. It gives an exception for me with the latest compiler, IDE etc

Code: Select all

dim  Taskstack(1 to 100) as byte

sub Main()
calltask MyTask, Taskstack  
end sub
Yes, I know there's no actual task to call. Guess how I found the problem.

Mal
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

deadmm wrote:[Here is code that] gives an exception for me with the latest compiler, IDE etc
Thanks. We'll take care of that.
- Don Kinzer
Post Reply