News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

What might cause a program to SIGSEV in terminal but not in C::B?

Started by msuaeronautics13, April 06, 2016, 03:50:42 AM

Previous topic - Next topic

msuaeronautics13

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?

stahta01

Quote from: 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?

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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Jenna

Do you work with files, if yes how are the paths build, and do you verify they are correctly opened before using them ?

msuaeronautics13

Quote from: jens 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 ?

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)?