Program crashes when not using -exx

General FreeBASIC programming questions.
Post Reply
lassar
Posts: 306
Joined: Jan 17, 2006 1:35

Program crashes when not using -exx

Post by lassar »

Used libxbr in small test program, not using -exx OR -ex settings.

And the small test program ran ok.


Integrated it into a bigger program, and it would crash.

Tried -ex in FBide and the program used about 24% cpu.

Added -exx setting to FBide, and the bigger program would run ok.


Is there any visual studio compile setings, that I should of used in compiling libxbr?

What's the deal with -exx ?


Including error checking code in case there's some problem in it.

Code: Select all



ON ERROR GOTO Problem:
.
.
.
.
.
Problem:
ErrorNumber% = ERR
ErrorLine% = ERL
DIM ProgError$(17)

ProgError$(0) = "No error"
ProgError$(1) = "Illegal function call"
ProgError$(2) = "File not found signal"
ProgError$(3) = "File I/O error"
ProgError$(4) = "Out of memory"
ProgError$(5) = "Illegal resume"
ProgError$(6) = "Out of bounds array access"
ProgError$(7) = "Null Pointer Access"
ProgError$(8) = "No privileges"
ProgError$(9) = "interrupted signal"
ProgError$(10) = "illegal instruction signal"
ProgError$(11) = "floating point error signal "
ProgError$(12) = "segmentation violation signal"
ProgError$(13) = "Termination request signal"
ProgError$(14) = "abnormal termination signal"
ProgError$(15) = "quit request signal"
ProgError$(16) = "return without gosub"
ProgError$(17) = "end of file"


LogFile% = FREEFILE
OPEN "WinTutor-Error.log" FOR APPEND AS #LogFile%
PRINT #LogFile%,"ERROR = ";ProgError$(ErrorNumber%); " on line ";ErrorLine%
Print #LogFile%,"Error Function: "; *Erfn()
CLOSE #LogFile%
CLS

PRINT "ERROR = ";ProgError$(ErrorNumber%); " on line ";ErrorLine%
Print "Error Function: "; *Erfn()

SLEEP

Quitting:
IF FullScreen% = 0 THEN
    IF ChangeBack& = 0 THEN '%DISP_CHANGE_SUCCESSFUL = 0
        IF ResolutionOn& THEN ChangeDisplaySettings(BYVAL 0, BYVAL 0)
    END IF
    IF HideDeskTopFlag& THEN ShowDeskTop
    IF HideTaskBarFlag& THEN ShowTaskBar
END IF
timeEndPeriod(1)
END


Imortis
Moderator
Posts: 1924
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Re: Program crashes when not using -exx

Post by Imortis »

ON ERROR GOTO only works in -ex or -exx mode. Otherwise it will crash as you noted because the error is not being handled:
https://www.freebasic.net/wiki/wikka.ph ... orHandling
lassar
Posts: 306
Joined: Jan 17, 2006 1:35

Re: Program crashes when not using -exx

Post by lassar »

This huge program crashes when using -e,-ex, -exx.

When I use -e in my my huge program, I get segment violation in line -1.

My test program also includes the error checking code, and it
does not crash no matter what error checking compiler settings you use,
or don't use.

Just don't understand this.

Used win-merge ten ways from sunday, and I can't find anything that
would cause it to crash.

Checked it against the test program, checked it against my huge working scale2x program

And against my huge hq2x working program, that uses libhqx.

Am beginning to think it is something about the libxbr dll.

Maybe I missed some setting in Visual Studio 12 in compiling, that causes this.

I even tried adding large arrays to the test program, and it still works
with flying colors.
Post Reply