program crashes after many ide's in development :(

General FreeBASIC programming questions.
ron77
Posts: 77
Joined: Feb 21, 2019 19:24
Location: Israel

program crashes after many ide's in development :(

Postby ron77 » Jun 22, 2020 15:08

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: 3605
Joined: Jun 02, 2013 9:27
Location: Switzerland

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

Postby MrSwiss » Jun 22, 2020 15:44

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
Posts: 9934
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

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

Postby fxm » Jun 22, 2020 16:24

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: 333
Joined: Dec 02, 2011 22:51
Location: France

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

Postby Lost Zergling » Jun 22, 2020 16:45

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: 1692
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

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

Postby jj2007 » Jun 22, 2020 16:49

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: 333
Joined: Dec 02, 2011 22:51
Location: France

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

Postby Lost Zergling » Jun 22, 2020 17:56

@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: 2148
Joined: May 24, 2007 22:10
Location: The Netherlands

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

Postby badidea » Jun 22, 2020 17:58

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: 6687
Joined: Jan 10, 2006 20:30
Location: Scotland

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

Postby dodicat » Jun 22, 2020 18:34

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: 2922
Joined: Jun 02, 2015 16:24

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

Postby Tourist Trap » Jun 22, 2020 19:26

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: 3010
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

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

Postby marcov » Jun 22, 2020 19:40

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: 77
Joined: Feb 21, 2019 19:24
Location: Israel

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

Postby ron77 » Jun 23, 2020 6:53

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: 3605
Joined: Jun 02, 2013 9:27
Location: Switzerland

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

Postby MrSwiss » Jun 23, 2020 12:24

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 ...

Return to “General”

Who is online

Users browsing this forum: No registered users and 6 guests