11-17-2014
The most common reasons for an application to die with a segmentation fault (assuming no one explicitly sent it a SIGSEGV signal) are:
- using an uninitiaized pointer,
- buffer overflow (allocating a buffer of size x and writing into buffer[n] where n >= x or n < 0 [in C, valid array offsets are 0 to n-1]), or
- searching for the end of a string in a character array that does not include a terminating null byte.
10 More Discussions You Might Find Interesting
1. Programming
Hi Everybody,
I have gone through man of sigwait and new to UNIX signals. Could anyone explain me about the following lines mentioned in sigwait man help ?
"The selection of a signal in set is independent of the signal
mask of the calling thread or LWP. This means a thread or
LWP can ... (1 Reply)
Discussion started by: md7ahuja
1 Replies
2. Programming
Hi All,
When I ran a multithreaded program in c++, it was core dumped
when its core was analysed
it indicated that the program was terminated with signal 9.
Signal 9 cannot be caught or interrupted.
When i analyzed the core further, it showed SING error
what could be the reason for... (6 Replies)
Discussion started by: matrixmadhan
6 Replies
3. AIX
I have some questions :
1) We can system backup manual by remotely? (Ex: we peform backup a AIX system in Japan from US)How we can do?
2) We can build a script to system backup automatically? How we can do?
3) We can use which third party to do that? Which tool?
Thanks (1 Reply)
Discussion started by: guest
1 Replies
4. HP-UX
Hi all,
I am getting coredump in one of our programs. The last few lines of the tucs output are as below :
read(8, "\adb\0\006\0\0\0\0\0060 0 9 2 6 ".., 2064) ...... = 2011
read(8, "\adb\0\006\0\0\0\0\07 4 1 4 5 03".., 2064) ...... = 2011
read(8, "\adb\0\006\0\0\0\0\00 2 6 030 0 ".., 2064)... (0 Replies)
Discussion started by: santosh.mane
0 Replies
5. Shell Programming and Scripting
I honestly tried searching for this in this forum and in google. Maybe I found the answer but didn't even realized it.
I would like to run shell script thats on my machine that collects the hostname and IP address from the remote system and sends the output to my machine.
I'm not sure if need... (2 Replies)
Discussion started by: elbombillo
2 Replies
6. UNIX for Advanced & Expert Users
Hi,
When i run the code in solaris unix machine, the file from remote server is getting downloaded. but when i use the same code in IBM AIX remote machine, it is not running. It is saying "Erro during scp transfer." Below is the code.
Please give some resolution.
SCPClient client = new... (1 Reply)
Discussion started by: gravi2020
1 Replies
7. Solaris
how to login with ssh to remote system with out applying the remote root/user password
with rlogin we can ujse .rhosts file
but with ssh howits possible
plz guide (2 Replies)
Discussion started by: tv.praveenkumar
2 Replies
8. Shell Programming and Scripting
Hi Friends,
I am new to this , I am working on AIX system and my scenario is to retrive the files from remote system and remove the files from the remote system after retreving files. I can able to retrieve the files but Can't remove files in remote system. Please check my code and help me out... (3 Replies)
Discussion started by: vinayparakala
3 Replies
9. Shell Programming and Scripting
Hi,
I have an shell script program in a remote linux machine which will do some specific monitoring functionality. Also, have some C executables in that machine.
From a windows machine, I want to run the shell script program (If possible using java).
I tried with SSH for this. but, in... (1 Reply)
Discussion started by: ram.sj
1 Replies
10. Shell Programming and Scripting
Hello Every one!!
I am trying to write a shell script which will connect to a remote server and execute scripts which are at a certain path in the remote server.
Before this I am using a sudo command to change the user.
The place where I am stuck is, I am able to connect to the... (6 Replies)
Discussion started by: masubram
6 Replies
LEARN ABOUT SUNOS
pthread_attr_setguardsize
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)