Problem with stack overflow


 
Thread Tools Search this Thread
Operating Systems HP-UX Problem with stack overflow
# 1  
Old 03-26-2008
Data Problem with stack overflow

Hi,
I get a problem with stack overflow on HP-UX, when running a C program.

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


The possible cause i found, was that the definition of a structure had changed.
One object was recompiled with the new definition, but 1, maybe not.
This caused a memory error and the program received 'SIGSEGV' (segmentation error).

But what i feel is that the variable in question, being a local variable, and hence allocated on stack, caused the above message to occur.
It referenced an address beyond stack bounds.
I beleive that maxssiz dint really exceed.

The HP manual says that if such an error occurs, then the only option is to wait and the OS will try to resolve it by itself.

Would this error occur again, if another stack variable too exceeds stack bounds?

Please advice/correct me.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Hardware

Stack Overflow Questions Tags Users Badges Unanswered Ask Question Ask for the explanation of types

I have read a document which tells me the following 4 things are done by the RAM embedded on disk driver controller. But I don't know what's difference between buffer and cache. Thanks! RAM on disk drive controllers 1 firmware 2 speed matching buffer 3 prefetching buffer 4 cache (1 Reply)
Discussion started by: 915086731
1 Replies

2. UNIX for Dummies Questions & Answers

perform stack overflow

Help! I have an AIX system that has a power outage. When I logged in as root and got the system up and running it all looked ok. But.....when a user tries to log in they receive the error: The perform stack has overflowed OP=2117 PC=2124 E=46 in emmcshflif icrun is finished How can I fix... (1 Reply)
Discussion started by: dlegnar
1 Replies

3. Ubuntu

Stack overflow i guess while insmod

I have built kernel 2.6.35 on my Ubuntu system with some specific requirement. I also built some app defined module with the same kernel. I booted up the built version and I find it did not work properly as there is some gui and other modules missing problem. But the system booted up and I did... (0 Replies)
Discussion started by: sunilsukumar4u
0 Replies

4. Programming

c++ overflow problem

I have come accross a rather strange problem with two buffers that seem to be overriding each other. bool killSession(const Session &session){ //Get user FILE* fp = fopen("conf/sessions.current", "rt"); char line; char user; int x = 0; int leaseTime; printf("key: %s \n" ,... (2 Replies)
Discussion started by: mshindo
2 Replies

5. AIX

IBM xlf "parser stack overflow" error

Hello, Does anybody know how to increase IBM xlf parser stack to get rid of the "parser stack overflow" error? Thanks Ping (1 Reply)
Discussion started by: luop0812
1 Replies

6. BSD

stack overflow in function psync_status Abort (core dumped)

I am running Open BSD 3.8 (3.5 upgrade) on a Pent Pro. 200, 64 Megs Ram, Nvedia Vanta TNT 16 Megs, Realtech 8139 Nic. When running ifconfig -a I get this error back. I've run searches on google no deal. I can get Stack overflow or psync, but not both. So I would really like to know how to fix it. ... (0 Replies)
Discussion started by: jmcpreach
0 Replies

7. Programming

memory stack problem

Hi, I am writing a C program under SCO Unix. I have a memory stack problem but do not know how to go about fixing it. I have tried running INSURE but that does not detect any problems. Essentially the problem is that the memory address shifts on return from a routine. I pass a pointer to... (3 Replies)
Discussion started by: jkeagy
3 Replies

8. UNIX for Dummies Questions & Answers

stack problem

Hi, I'm a complete beginner at all this business so any help is appreciated. I have a script (not written by me) which I need to modify. My problems is.... tail -1c $file .... I understand this will return the final character of the $file variable. I need to make it return the first... (4 Replies)
Discussion started by: mastaCow
4 Replies
Login or Register to Ask a Question
PTHREAD_ATTR_GETGUARDSIZE(3)				   BSD Library Functions Manual 			      PTHREAD_ATTR_GETGUARDSIZE(3)

NAME
pthread_attr_getguardsize -- get and set thread guard size LIBRARY
POSIX Threads Library (libpthread, -lpthread) SYNOPSIS
#include <pthread.h> int pthread_attr_getguardsize(const pthread_attr_t * restrict attr, size_t * restrict guardsize); int pthread_attr_setguardsize(pthread_attr_t *attr, size_t guardsize); DESCRIPTION
The pthread_attr_getguardsize() and pthread_attr_setguardsize() functions get and set guardsize in the attr object. If guardsize is larger than 0, the system reserves an additional region of guarded memory of at least guardsize bytes at the end of the thread's stack for each new thread created by using attr. The guarded area is understood to be pages of memory that are protected from read and write access. While the guarded area should be rounded by the system page size, the actual default size is implementation-defined. In NetBSD the default guardsize is _SC_PAGESIZE, the system page size. The rationale behind guardsize is two-fold: 1. On the one hand, it provides protection against overflow of the stack pointer. If there is a guard area and a thread overflows its stack pointer into this extra memory area, it should receive a SIGSEGV signal or experience other comparable fatal error condition. Note that if a thread allocates large data structures on stack, it may be necessary to raise the default guardsize in order to detect stack overflows. 2. On the other hand, the overflow protection may waste system resources if an application that creates a large number of threads knows that it will never overflow the stack. In this case it is possible to set guardsize to 0. If pthread_attr_setstack(3) or pthread_attr_setstackaddr(3) is used to set the stack address attribute in attr, the guard size attribute is ignored and no guard area will be allocated; it is the responsibility of the application to handle the overflow conditions. RETURN VALUES
If successful, both functions return 0. Otherwise, an error number is returned to indicate the error. ERRORS
No errors are defined for pthread_attr_getguardsize(). The pthread_attr_setguardsize() may fail if: [ENOMEM] There was insufficient memory. SEE ALSO
pthread_attr(3), pthread_attr_setstack(3), sysconf(3) STANDARDS
Both functions conform to IEEE Std 1003.1-2008 (``POSIX.1''). BSD
July 7, 2010 BSD