Crashing on x64 execution

General FreeBASIC programming questions.
Post Reply
UEZ
Posts: 972
Joined: May 05, 2017 19:59
Location: Germany

Crashing on x64 execution

Post by UEZ »

Can somebody tell me why this code crashes when compiling and executing it as x64?

Code: Select all

Dim Shared As Boolean bSound = True

#Ifdef __FB_WIN32__ 
	If bSound Then
		Dim As String aSoundFiles(0 To ...) = {"Test1", "Test2", "Test3"}
		? "Test"
	End If
#Endif

? "End"
Sleep
With x86 it works properly.

Edit:
Using

Code: Select all

FreeBASIC Compiler - Version 1.08.0 (2020-04-30), built for win64 (64bit)
Copyright (C) 2004-2019 The FreeBASIC development team.
standalone
target:       win64, x86-64, 64bit
backend:      gcc
which seems to be buggy...

Code: Select all

FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for win64 (64bit)
Copyright (C) 2004-2019 The FreeBASIC development team.
standalone
target:       win64, x86-64, 64bit
works properly.
dodicat
Posts: 7976
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Crashing on x64 execution

Post by dodicat »

OK here 64 and 32 bit compiler
compiling . . .
Success ( 0.8300442999461666 seconds)

FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for win64 (64bit)
Copyright (C) 2004-2019 The FreeBASIC development team.
standalone
-gen gcc -Wc -O3


compiling . . .
Success ( 0.5713402000255883 seconds)

FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for win32 (32bit)
Copyright (C) 2004-2019 The FreeBASIC development team.
standalone
-gen gcc -Wc -O3

I don't know anything about
Version 1.08.0 (2020-04-30), built for win64 (64bit)

Is it a tester for the next official download?
Where did you get it?
srvaldez
Posts: 3373
Joined: Sep 25, 2005 21:54

Re: Crashing on x64 execution

Post by srvaldez »

try: Dim As String aSoundFiles(0 To 2)
UEZ
Posts: 972
Joined: May 05, 2017 19:59
Location: Germany

Re: Crashing on x64 execution

Post by UEZ »

dodicat wrote:Is it a tester for the next official download?
Where did you get it?
I cannot remember where I got this version. In the last weeks I did so many changes to the folder. ^^ Probably from srvaldez or St_W.
srvaldez wrote:try: Dim As String aSoundFiles(0 To 2)
Same result - crashing.
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Crashing on x64 execution

Post by MrSwiss »

FreeBASIC Compiler - Version 1.08.0 (2020-04-30), built for win64 (64bit)
Where does that originate from?

The last build from St_W is: Version 1.08.0 (2020-01-12), built for win64 (64bit)
This works without any problems ...
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Crashing on x64 execution

Post by fxm »

Do you use some gcc options when compiling?
(what is the gcc version of your fbc build?)
UEZ
Posts: 972
Joined: May 05, 2017 19:59
Location: Germany

Re: Crashing on x64 execution

Post by UEZ »

MrSwiss wrote:
FreeBASIC Compiler - Version 1.08.0 (2020-04-30), built for win64 (64bit)
Where does that originate from?

The last build from St_W is: Version 1.08.0 (2020-01-12), built for win64 (64bit)
This works without any problems ...
As already written above, I cannot remember.

Anyhow, I replaced the fbc.exe with the latest St_W build and it still crashed. I copied the whole content from the zip archive to my Freebasic folder then it worked properly. I assume that also some files within the folders didn't work properly.
UEZ
Posts: 972
Joined: May 05, 2017 19:59
Location: Germany

Re: Crashing on x64 execution

Post by UEZ »

fxm wrote:Do you use some gcc options when compiling?
(what is the gcc version of your fbc build?)
No gcc, just default compiler options.

Problem was probably playing around with different FB tool chains version and mixing up things...
TeeEmCee
Posts: 375
Joined: Jul 22, 2006 0:54
Location: Auckland

Re: Crashing on x64 execution

Post by TeeEmCee »

Yes, the recent change to array descriptors will cause crashes like this if you mix fbc.exe and libfb.a from different compiler versions, although usually ABI changes to the runtime are rare and you get away with doing it.
Post Reply