Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: msuaeronautics13 on April 06, 2016, 03:50:42 am

Title: What might cause a program to SIGSEV in terminal but not in C::B?
Post by: msuaeronautics13 on April 06, 2016, 03:50:42 am
I have a fairly large program developed using C::B on a Centos 6 distro.

When I compile and run the program in C::B, the program runs through to a normal end.

When I compile the program in C::B and run the binary in the terminal, the program will run but gives a segfault somewhere during execution.

My C::B environment is similar to the environment in the terminal. What else might be at play here?
Title: Re: What might cause a program to SIGSEV in terminal but not in C::B?
Post by: stahta01 on April 06, 2016, 04:17:27 am
I have a fairly large program developed using C::B on a Centos 6 distro.

When I compile and run the program in C::B, the program runs through to a normal end.

When I compile the program in C::B and run the binary in the terminal, the program will run but gives a segfault somewhere during execution.

My C::B environment is similar to the environment in the terminal. What else might be at play here?

No idea about Linux; but, on windows the lib folders are added to the windows env. path. This helps the DLLs to be found.
So, I would check for missing libraries.
And, the working directory can be very different when ran inside Code::Blocks.

Tim S.
Title: Re: What might cause a program to SIGSEV in terminal but not in C::B?
Post by: Jenna on April 06, 2016, 09:30:19 pm
Do you work with files, if yes how are the paths build, and do you verify they are correctly opened before using them ?
Title: Re: What might cause a program to SIGSEV in terminal but not in C::B?
Post by: msuaeronautics13 on April 07, 2016, 06:37:36 pm
Do you work with files, if yes how are the paths build, and do you verify they are correctly opened before using them ?

I do work with files, which are selected by arguments.

I have since found that my program runs out of memory. But why is this managed much better within C::B (such that I don't get a segfault)?