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?
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)
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)
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)
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)
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)
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)
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)
pthread_attr_getguardsize(3C)pthread_attr_getguardsize(3C)NAME
pthread_attr_getguardsize, pthread_attr_setguardsize - get or set thread guardsize attribute
SYNOPSIS
cc -mt [ flag... ] file... -lpthread [ library... ]
#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);
The guardsize attribute controls the size of the guard area for the created thread's stack. The guardsize attribute provides protection
against overflow of the stack pointer. If a thread's stack is created with guard protection, the implementation allocates extra memory at
the overflow end of the stack as a buffer against stack overflow of the stack pointer. If an application overflows into this buffer an
error results (possibly in a SIGSEGV signal being delivered to the thread).
The guardsize attribute is provided to the application for two reasons:
1. Overflow protection can potentially result in wasted system resources. An application that creates a large number of threads, and which
knows its threads will never overflow their stack, can save system resources by turning off guard areas.
2. When threads allocate large data structures on the stack, large guard areas may be needed to detect stack overflow.
The pthread_attr_getguardsize() function gets the guardsize attribute in the attr object. This attribute is returned in the guardsize
parameter.
The pthread_attr_setguardsize() function sets the guardsize attribute in the attr object. The new value of this attribute is obtained from
the guardsize parameter. If guardsize is 0, a guard area will not be provided for threads created with attr. If guardsize is greater than
0, a guard area of at least size guardsize bytes is provided for each thread created with attr.
A conforming implementation is permitted to round up the value contained in guardsize to a multiple of the configurable system variable
PAGESIZE. If an implementation rounds up the value of guardsize to a multiple of PAGESIZE, a call to pthread_attr_getguardsize() specify-
ing attr will store in the guardsize parameter the guard size specified by the previous pthread_attr_setguardsize() function call.
The default value of the guardsize attribute is PAGESIZE bytes. The actual value of PAGESIZE is implementation-dependent and may not be
the same on all implementations.
If the stackaddr attribute has been set (that is, the caller is allocating and managing its own thread stacks), the guardsize attribute is
ignored and no protection will be provided by the implementation. It is the responsibility of the application to manage stack overflow
along with stack allocation and management in this case.
If successful, the pthread_attr_getguardsize() and pthread_attr_setguardsize() functions return 0. Otherwise, an error number is returned
to indicate the error.
The pthread_attr_getguardsize() and pthread_attr_setguardsize() functions will fail if:
EINVAL The attribute attr is invalid.
EINVAL The parameter guardsize is invalid.
EINVAL The parameter guardsize contains an invalid value.
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
sysconf(3C), pthread_attr_init(3C), attributes(5), standards(5)
23 mar 2005 pthread_attr_getguardsize(3C)