program crashes after many ide's in development :(

General FreeBASIC programming questions.
Post Reply
ron77
Posts: 212
Joined: Feb 21, 2019 19:24

program crashes after many ide's in development :(

Post by ron77 »

hi all...

i've been working on a game in FB called "hikikomori" it's a simple console text only no graphics with sound and music game much like my first game project "hacker" however i've been too messy with it's development istarted to develop it on windows on WINFBE ide then moved to linux and continued developing it with geany and poseidonFB then i switched back to windows and continued development with notepad++ and FBedit...

with each ide / text editor came a new sets of cons and pros most ide did not have proper support for format and indenting so as the file started to grow it became more and more a mess finally i had to use fbide format option to re-format the whole bas file to FB format conventions...

however still the executable although does compile it is unstable meaning it can crash at any moment although there are no bugs that i know of - the project contains many wav files of royalty free music and text files and the main bas file has over 500 or 600 lines of code in it :(

and the lesson of all this gentlemen is DON'T SWITCH SO MANY OS AND IDE/TEXT EDITORS WHILE WORKING ON PROJECTS!...

ron77
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: program crashes after many ide's in development :(

Post by MrSwiss »

This seems to me, to be one of those "blame the tools" rants.

If a application crashes it's always a "blame the programmer" issue.
(The tools are NOT EVER responsible, for the code the programmer writes!)

The formatting issues caused by the use of different IDE's are only relevant
to code readabiliy, but NEVER to code QUALITY.

Therefore, your conclusion seems to be based on erroneous assumptions.
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: program crashes after many ide's in development :(

Post by fxm »

When using other IDE (for example, if it changes the compilation context) or other OS, some previously dormant coding bugs may then appear at run-time by crashing your program.

If you use FBIde, see this post to set your FBIde with the following capacities:
- Compiling with -exx (adding checking for array bounds and null-pointer)
- Leaving the command line window open when the program finishes (to see an eventual run-time error message).
Lost Zergling
Posts: 534
Joined: Dec 02, 2011 22:51
Location: France

Re: program crashes after many ide's in development :(

Post by Lost Zergling »

I suggest also (with FbIde) :
- Delete previous executable, use "Compile", then try closing FbIde, manually run with dbl clic instead "Compile and run".
- Check OS version (32 or 64) and that you are not running out of memory.
- Compare and test with previous unformatted release (whenever possible)
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: program crashes after many ide's in development :(

Post by jj2007 »

Lost Zergling wrote:- Delete previous executable, use "Compile", then try closing FbIde, manually run with dbl clic instead "Compile and run".
If all that is necessary, I would urgently change IDE.
Lost Zergling
Posts: 534
Joined: Dec 02, 2011 22:51
Location: France

Re: program crashes after many ide's in development :(

Post by Lost Zergling »

@jj2007. Sometimes Ides consumes mem also (or not enough time for system to free enough memory in time just after compiling ?). Sometimes others programs can interfer (antivir and so on). Or any other thing like a flow of run and compile or distant admin, or windows task conflict, or anything else, I don t know. I mentionned it because I had the trouble and already tested not to criticize FbIde(wich I m still using it). I do not know exactly where it came from. Do not put the blame on it.
Last edited by Lost Zergling on Jun 22, 2020 18:41, edited 2 times in total.
badidea
Posts: 2586
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: program crashes after many ide's in development :(

Post by badidea »

Switching OS for tests is actually useful to find bugs.
But I do try to stay away form fancy IDEs with 'projects' and stuff. Those always end up in a corrupted way for me.
dodicat
Posts: 7976
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: program crashes after many ide's in development :(

Post by dodicat »

In fbide the run command
i.e. in
view
settings
freebasic

the run command must be
cmd /c "<$file>" <$param> & pause
to keep the console open for de bugging with the -exx switch.

To debug, the Quick run is the one to use.
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: program crashes after many ide's in development :(

Post by Tourist Trap »

Hi ron77,

Yes when you reach the critical mass, the code starts being hard to manage, and will require more than just coding locally right things. I mean you'll have to think about more structural things at a more global scale. The choice of an IDE can sometimes definitely matter. One of the thing that may disturb for instance is the unicode support at the IDE level, and various peculiar things that are best to know before you engage on a long run with this or this other IDE. My advice, on the windows plateform is still the same throught the years. Use FBIDE for writing functions and algorithms fast and making them full proof easily. And use FBEDIT for compilation of mutltiple files and modules. The reason for this being that FBEDIT can autocomplete your user defined types throught many modules, and list your functions as well etc.. So it's a better choice for larger programs. At least for me this couple of IDEs were always a solid combination. I can't say anything about linux however. I guess that there I would prefer using text files and the command line which seems very popular there.
Good luck in your refactoring. Because I guess, it's time for refactoring in the case you have here depicted :)
marcov
Posts: 3455
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: program crashes after many ide's in development :(

Post by marcov »

To cleanup up an organically grown codebase, a first step would be to compile it for valgrind (via C backend?) and run it with as much as possible enabled.

Valgrind often halts on all signs of something wrong, and helps distinguishing original causes from later effects of e.g. memory corruption.
ron77
Posts: 212
Joined: Feb 21, 2019 19:24

Re: program crashes after many ide's in development :(

Post by ron77 »

thank you all for your advice and suggestions...

the thing i've notice is the program crashes only in console mode and not in debug mode and only when it tries to play wav file with fbsound-1.1 could be it runs out of memory somewhere :-/

ron77
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: program crashes after many ide's in development :(

Post by MrSwiss »

You have written, that you're using multiple .wav files ...

Maybe it's just a matter of releasing the already used one propperly,
while loading the second one (thereby releasing the used memory).
And so on, and so forth ...
Post Reply