Author Topic: Compiler error "error: 3" - what the hell is it?  (Read 5385 times)

Offline S.O.P.M.

  • Prof. Inline
  • *****
  • Posts: 529
    • View Profile
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.
Notebook PC Samsung E372 Core i5 @ 2,6 GHz; 4 GB RAM; Win 7 Home Premium

Offline Marmor

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 925
  • 96A285CC
    • View Profile
    • my youtube channel
looks like a file isnt exist

Offline S.O.P.M.

  • Prof. Inline
  • *****
  • Posts: 529
    • View Profile
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.
« Last Edit: 2015-Jan-29 by S.O.P.M. »
Notebook PC Samsung E372 Core i5 @ 2,6 GHz; 4 GB RAM; Win 7 Home Premium

Offline Marmor

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 925
  • 96A285CC
    • View Profile
    • my youtube channel
nP. my all day error  :enc:

Offline kanonet

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1142
    • View Profile
    • My GLBasic code archiv
Yeah "error:3" is quite famous and annoying.

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 :(
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.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3929
    • View Profile
    • Space Fractal
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.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline S.O.P.M.

  • Prof. Inline
  • *****
  • Posts: 529
    • View Profile
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.-
« Last Edit: 2015-Jan-30 by S.O.P.M. »
Notebook PC Samsung E372 Core i5 @ 2,6 GHz; 4 GB RAM; Win 7 Home Premium

Offline spicypixel

  • Prof. Inline
  • *****
  • Posts: 646
  • Pixel Artist
    • View Profile
    • SpicyPixel.net
Error 3 is indeed a file doesn't exist, but it doesn't even point to a code line, which is poor.
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3929
    • View Profile
    • Space Fractal
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.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline kanonet

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1142
    • View Profile
    • My GLBasic code archiv
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.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3929
    • View Profile
    • Space Fractal
Do a function to do that rather load the file direct.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline kanonet

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1142
    • View Profile
    • My GLBasic code archiv
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.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Offline spicypixel

  • Prof. Inline
  • *****
  • Posts: 646
  • Pixel Artist
    • View Profile
    • SpicyPixel.net
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.
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

Offline S.O.P.M.

  • Prof. Inline
  • *****
  • Posts: 529
    • View Profile
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.
Notebook PC Samsung E372 Core i5 @ 2,6 GHz; 4 GB RAM; Win 7 Home Premium

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3929
    • View Profile
    • Space Fractal
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.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.