Author Topic: What might cause a program to SIGSEV in terminal but not in C::B?  (Read 2486 times)

Offline msuaeronautics13

  • Single posting newcomer
  • *
  • Posts: 3
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?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: What might cause a program to SIGSEV in terminal but not in C::B?
« Reply #1 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: What might cause a program to SIGSEV in terminal but not in C::B?
« Reply #2 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 ?

Offline msuaeronautics13

  • Single posting newcomer
  • *
  • Posts: 3
Re: What might cause a program to SIGSEV in terminal but not in C::B?
« Reply #3 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)?