Operating System - HP-UX
1830956 Members
1779 Online
110017 Solutions
New Discussion

Stack exceeds maximum size

 
SOLVED
Go to solution
rajanandhini
Advisor

Stack exceeds maximum size

Hi,

I get the "Memory Fault" error when running an executable. I dont see any core dump but the program aborts. When explored using GDB, we get the following error.

Pid 18574 received a SIGSEGV for stack growth failure.
Possible causes: insufficient memory or swap space,
or stack size exceeded maxssiz.

Please help me.

Thanks,
nan
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: Stack exceeds maximum size

Shalom,

Increase the parameters in the kernel maxssiz maxdsiz

If the program is 64 bit then maxssiz_64 and maxdsiz_64

Can be done with sam or kmtune/kctune depending on your actual OS, which you do not reveal to us.

Requires root access.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Dennis Handly
Acclaimed Contributor

Re: Stack exceeds maximum size

Before you go as far as increasing maxssiz, you should make sure you are not in an infinite recursive loop. I.e. in gdb look at a stack trace, bt.
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Stack exceeds maximum size

If your maxssiz is set to the default (8MiB) then it may need to be increased; however, only in extremely rare cases does it ever need to exceed 32MiB --- even in 64-bit land. The only time I have ever seen a legitimate need to increase maxssiz beyond 32 MIB was in some code that linked in some FORTRAN libraries but otherwise only extremely poorly written code needs a large stack. The suggestion to examine the stack trace is a good one because you may be entering extremely deep recursion as a result of some data condition. If not then if large stacks are needed the answer is to fix the code rather than increasing maxssiz to ludicrous levels.
If it ain't broke, I can fix that.