GLBasic forum

Main forum => GLBasic - en => Topic started by: S.O.P.M. on 2015-Jan-29

Title: Compiler error "error: 3" - what the hell is it?
Post by: S.O.P.M. on 2015-Jan-29
Hi guys,

since a few days I suddenly got the compiler error "error: 3" for win compiling. My code seems to run fine though. I've absolutely no clue what this error mean so I ask you, did you ever discover them too? "Injection started" and then 6 lines of "error: 3" without any hint what's going wrong. I made some changes before, yes, but I was not able to find out what changes caused this. I do many backups but to restore an old version could kill my progress.

Any ideas?

S.O.P.M.
Title: Re: Compiler error "error: 3" - what the hell is it?
Post by: Marmor on 2015-Jan-29
looks like a file isnt exist
Title: Re: Compiler error "error: 3" - what the hell is it?
Post by: S.O.P.M. on 2015-Jan-29
Do you mean a file the compiler needs for proper operation or a media file my app does access to?
I ask because I've a save routine for file checking (DOESFILEEXIST and IF OPENFILE()) so I wonder about it.
But thanks, I'll check the media files first!

Another error puzzles me currently: if an specific 3 dimensional array where the third dimension is always 2 exceeds the boundary of 6 elements in the first or second dimension, I got a "*** Unhandled exception *** EXCEPTION_ACCESS_VIOLATION" and my app crashes completely. Windows tells me that the application doesn't work anymore and I have to close it :(


[EDIT]
Thank you Marmor, indeed my app wanted to load 3 media files with the AE CheckAsset function that doesn't exist anymore. Now the "error: 3" is gone.
Title: Re: Compiler error "error: 3" - what the hell is it?
Post by: Marmor on 2015-Jan-29
nP. my all day error  :enc:
Title: Re: Compiler error "error: 3" - what the hell is it?
Post by: kanonet on 2015-Jan-30
Yeah "error:3" is quite famous and annoying.

Quote from: S.O.P.M. on 2015-Jan-29Another error puzzles me currently: if an specific 3 dimensional array where the third dimension is always 2 exceeds the boundary of 6 elements in the first or second dimension, I got a "*** Unhandled exception *** EXCEPTION_ACCESS_VIOLATION" and my app crashes completely. Windows tells me that the application doesn't work anymore and I have to close it :(
I tried to reproduce this:
Code (glbasic) Select
LOCAL a%[]

DIM a[6][6][2]

a[11][5][1] = 4

It does not crash, but reports the error almost as it should:
Code (glbasic) Select
Injection started

bounds: [   6][   6][   2]
access: [  11][   5][   0]
bounds: [   6][   6][   2]
access: [  11][   5][   1]
error: 9
"C:\Eigene Programme\GLBasic\Test2\Test2.gbas"(5) error : Ausserhalb des DIM Bereichs

Note, if you got an 3-Dim array anywhere in your project, you get 2 reports (like I posted above), if you got a 4-Dim array anywhere in your project, you get 3 reports at same time. This then happens for every array, no matter how many dimensions it got. If you look inside glb.h its pretty obvious why it happens, but its not a big deal IMHO.
So I got the report, no MAV. Tested on V12.312 on Windows debug+release mode.
Title: Re: Compiler error "error: 3" - what the hell is it?
Post by: spacefractal on 2015-Jan-30
Can been a different error. Dim can been annoying sometimes. Also static DIM in a function might crash. So global it instead.

AE CheckAsset was replaced with DOESFILEEXITS and now it's handled automatic. So they should not been needed anymore.

Error 3 is file not exist.
Title: Re: Compiler error "error: 3" - what the hell is it?
Post by: S.O.P.M. on 2015-Jan-30
Thanks again you all, I was able to handle the issues. I overlooked that some procedure still worked with two dimensions while I already introduced 3. Finally there was a situation where some access to the third dimension happened but only 2 were present at this time. Because internally GLBasic always works with one dimension as I heared, within some boundaries the fault could not be detected, I guess. I dim for example [3][3][2] but can access [6][0] due to the third dimension. Something like this, I think. Fortunately everything is working fine again so I can continue.

Have a nice day, guys :)

-S.O.P.M.-
Title: Re: Compiler error "error: 3" - what the hell is it?
Post by: spicypixel on 2015-Jan-30
Error 3 is indeed a file doesn't exist, but it doesn't even point to a code line, which is poor.
Title: Re: Compiler error "error: 3" - what the hell is it?
Post by: spacefractal on 2015-Jan-31
all glbasic does is send a error 3 to a function when something happens. Its does not known which line its happens.

For Android this come to happens a lots, so im removed that really. This due that happens a lots of assests checking now and does no longer copy all assests in the startup.
Title: Re: Compiler error "error: 3" - what the hell is it?
Post by: kanonet on 2015-Feb-01
I think it would easily be possible to tell which file it cant load, this should be easy to add. IMHO this would be way more useful then jumping to the code line where it tried to load it.
Title: Re: Compiler error "error: 3" - what the hell is it?
Post by: spacefractal on 2015-Feb-01
Do a function to do that rather load the file direct.
Title: Re: Compiler error "error: 3" - what the hell is it?
Post by: kanonet on 2015-Feb-02
Thats exactly what I do, thats why I said it would be pointless if the debugger would tell me at what codeline the loading failed - there is only one loading function in whole project. I think the debugger should simply tell the name+path of the file that he failed to load.
Title: Re: Compiler error "error: 3" - what the hell is it?
Post by: spicypixel on 2015-Feb-02
Quote from: kanonet on 2015-Feb-02
Thats exactly what I do, thats why I said it would be pointless if the debugger would tell me at what codeline the loading failed - there is only one loading function in whole project. I think the debugger should simply tell the name+path of the file that he failed to load.

This is pretty much what I was referring to. I generalised by saying the code line, but as it's a file error, I did mean referencing the file that failed.
Title: Re: Compiler error "error: 3" - what the hell is it?
Post by: S.O.P.M. on 2015-Feb-03
Do you refer to the latest version of AE? I still doesn't use it but plan to install it in the hope I can get everything to work again soon after.
Title: Re: Compiler error "error: 3" - what the hell is it?
Post by: spacefractal on 2015-Feb-03
DOESFILEEXISTS can do that. so you can allways STDOUT the file, when the file is not found. Its a issue that property not will do fixed or such. its not a real bug. Instead its better uses STDOUT. When you known the filename, then you should known where the code was anyway that tries to load the file.
Title: Re: Compiler error "error: 3" - what the hell is it?
Post by: Kitty Hello on 2015-Feb-03
The debug mode gives more details. No?

Gesendet von meinem GT-N7100 mit Tapatalk

Title: Re: Compiler error "error: 3" - what the hell is it?
Post by: kanonet on 2015-Feb-04
No, "error: 3" is all that gets output. But should be pretty easy to add more informations.
Title: Re: Compiler error "error: 3" - what the hell is it?
Post by: MrTAToad on 2015-Feb-08
Error 3 is usually due to keeping a file open when the program ends/crashes.
Title: Re: Compiler error "error: 3" - what the hell is it?
Post by: spicypixel on 2015-Feb-09
Quote from: TheMapChap on 2015-Feb-08
Error 3 is usually due to keeping a file open when the program ends/crashes.

Again, nice to know which file. Error 3 is about as useful as "Error: Lentils"  =D