Operating System - HP-UX
1753637 Members
5516 Online
108798 Solutions
New Discussion юеВ

Stack Overflow error in HPUX11iv2

 
sujeet joshi
Frequent Advisor

Stack Overflow error in HPUX11iv2

Hi All,

Getting following error in Application while doing the EOD Operation.
failure in writing the signal contec-possible stack overflow.
sendsig: useracc failed.

Can anybody help me in this issue? and how to increase the stack?

Thanks & regards,
Sujeet Joshi
2 REPLIES 2
Taifur
Respected Contributor

Re: Stack Overflow error in HPUX11iv2

Hi Jishi,

you either have a main stack or a thread stack overflow.
You need to get a stack trace (use gdb) to determine which.

On the WDB page you can find this document:
Debugging core files using HP WDB
http://www.hp.com/go/wdb

Basically on the same system that caused the core dump:
$ file core
(Gives you the signal and up to 14 bytes of the basename of the executable.

$ gdb path-to/executable core
(gdb) bt
(gdb) q

If it is a main thread, you should see main at the bottom. If it is a thread, you should see some pthread on the bottom.

By taking the difference in the $sp register from the top and bottom frames, you can compute your current stack size.

There are two possibilities:
1) The user's shell (or a parent of that shell) has lowered the hard limit
using ulimit -h - at which point you have to find this and modify it.
Note, this is very rare -- you are much more likely to have to:

2) The system-wide hard limit is determined by the kernel tunable "maxssiz" and/or "maxssiz_64bit". maxssiz is the limit for 32-bit processes, maxssiz_64bit for 64-bit.
Note that maxssiz_64bit trumps maxssiz_32bit (i.e. a lower 64-bit limit will be used instead of the 32-bit limit.. this is a consequence of the parent bitness as the system comes up), so you'll want to consider both.

On 11.23, maxssiz / maxssiz_64bit are dynamic - changes to them take effect immediately for any new processes. So "kctune -u -s maxssiz=" and that should do it.

As a side note - if the user believes they need a very large stack, make sure that they understand why. Fortran and Java are both legitimate use cases -- for normal C programming, large stacks are usually a sign of poor recursion. Not saying there's a problem, but just worth a mention.


Cheers,
taifur
Dennis Handly
Acclaimed Contributor

Re: Stack Overflow error in HPUX11iv2

>Taifur: you either have a main stack or a thread stack overflow. You need to get a stack trace (use gdb) to determine which.

Exactly.

>So "kctune -u -s maxssiz=

-u and -s are obsolete kmtune(1m) options. You should leave both off.