how to increase the stack limit

Hello,
I am having an issue when running my C++ program in Ubuntu with 2 external libraries (quite big libraries). When I run the program using either one of those libraries, the program runs and finishes correctly. But when I use both libraries the program terminates unexpectedly with the following error message:

Segmentation fault (core dumped)
Process returned 139 (0x8B)

The program code seems to be correct. I read about the stack limit, that could be increased. Please let me know how and if it is done through the Terminal.
Thank you.
step wrote:
core dumped

Did you look at the core? Where did it crash?

step wrote:
Process returned 139

139 is SEGV, the program attempted to access data it had no access to. The core will tell you exactly what it was.

That said, stack size is ulimit -s
Thats a pretty vague question. can you give more detail, like what version of ubuntu, what your code looks like, what these libraries are, what version of the libraries? There could be many reasons why a program core dumps.
Thank you.

I am using Ubuntu 18.04.1 version 64-bit through a virtual machine in my Windows laptop.

My code is in C++, compiling in CodeBlocks 16.01. I think the program code is correct, as when I run it with either library works fine. The problem is when I make calls to both libraries. The program can stop at any point in the code, is not always at the same point.

The two libraries are one for grammatical evolution version of 2006, and the other a library for parsing and evaluating strings version of 2013.

I checked the ulimit -s through the terminal and it says: 8192.
I read this could be increased??

When I ran my program in Windows it happened the same unexpected termination, the error message was: Process returned -1073741819 (0xC0000005)

0xC0000005 is access violation (i.e. segmentation fault).

Nothing you've said so far definitely points to a stack overflow. All we know is that the program tried to access some memory it didn't own; this could happen for a number of reasons. Have you tried attaching a debugger to see what the program was doing when the crash happened? That should have been your first step.
Modern mid-sized OS's can grow application stacks. But there is a practical limit, it isn't like the heap that's limited by the process' visible virtual memory.

Have you reviewed the way your application uses the stack? Do you have large arrays? Usually, these can be replaced with an STL container, which tend to use the heap. It's a quick win to change them all.
Topic archived. No new replies allowed.