fbc crash in lang deprecated

General FreeBASIC programming questions.
Post Reply
St_W
Posts: 1619
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

fbc crash in lang deprecated

Post by St_W »

The FreeBasic Compiler unfortunately crashes when trying to compile the following (old) piece of code:
http://users.freebasic-portal.de/stw/fi ... Master.zip

The archive includes a "compile.bat" containing the used command line arguments. The code requires compilation in the "deprected" language dialect.

I also tried compiling using a debug-build of fbc.exe (built with -g -exx) but got no error messages before the crash.

//edit: stacktrace looks like a stack overflow in astTypeIniUsesLocals (ast-node-typeini.bas)
Image
srvaldez
Posts: 3373
Joined: Sep 25, 2005 21:54

Re: fbc crash in lang deprecated

Post by srvaldez »

it looks like it's the same problem discussed here viewtopic.php?f=2&t=26576
see https://sourceforge.net/p/fbc/bugs/798/
St_W
Posts: 1619
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: fbc crash in lang deprecated

Post by St_W »

Thank you, that sounds reasonable as the code uses such large initializers.

Interestingly the code compiled using very old versions of FreeBasic so the AST storage or traversal implementation of such initializers must have been able to deal with such situtations once ago.

btw, @devs (like counting_pine, dkl):
I see quite a lot of open issues on SourceForge, maybe it could help to label a few easier ones as "good first issue" (as GitHub recommends) to attract new contributors?
grindstone
Posts: 862
Joined: May 05, 2015 5:35
Location: Germany

Re: fbc crash in lang deprecated

Post by grindstone »

Obviously the compiler can't handle lines (concatenated with underscores) longer than abt. 1.000.000 characters and terminates compilation without an error message.

The CopperMaster package contains several of those lines.
counting_pine
Site Admin
Posts: 6323
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Re: fbc crash in lang deprecated

Post by counting_pine »

Does SourceForge have a "good first issue" tag?
I had a look at the first couple of pages on https://sourceforge.net/p/fbc/bugs, there wasn't much that particularly jumped out at me.

This one has a fairly simple fix, I think:
https://sourceforge.net/p/fbc/bugs/826/

This one also would give someone a good introduction to FB code. The fix should be easy to find and make, and whoever does it would get a very basic overview of the structure of FB's code, and also ensure they can modify, make, and test the compiler.
https://sourceforge.net/p/fbc/bugs/820/
fxm
Moderator
Posts: 12083
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: fbc crash in lang deprecated

Post by fxm »

counting_pine wrote:This one also would give someone a good introduction to FB code. The fix should be easy to find and make, and whoever does it would get a very basic overview of the structure of FB's code, and also ensure they can modify, make, and test the compiler.
https://sourceforge.net/p/fbc/bugs/820/
I added an example to check the fix.
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Re: fbc crash in lang deprecated

Post by dkl »

Looks like SourceForge bugs can have "labels", which could be used for this. Then it would also make sense to enable the "labels" column in the list view. Also new fields can be added (currently we have the "Component" one).
Post Reply