Solaris 8: Error "access exceeded protections" - SEGV

Hello:

I getting this error " access exceeded protections" - SEGV, when I am doing a memset. The structure which is being memset is of 2M size.

Code Snipets:

abc_tabc;

memset((char*)&abc, '\0', sizeof(abc_t));

The abc_t struct consists of many variable of type int, char and more structures. Its max size is 2M.

Now, here are things which I have already tried:

Increasing the stack size to unlimited, or using the setrlimit from the running process. But still it fails.

Help is appritiated at this front, as I am unable to get it fixed in prod. Currenlty i have a work-around to put everything on the HEAP.

-K_P

[679 byte] By [k_p] at [2007-11-26 7:48:50]
# 1

There are 2 types of stacks.

The first is the process stack size, which you can set with the "limit" command. (You

have already done this)

The second is the individual thread stacks. This is what you may be overflowing.

If you are creating your own threads, like thr_create(), try giving more memory

to the stack size parameter. See "man -s 3C thr_create" for more info.

If you are letting OpenMP create your threads with a compiler, the environment variable

${STACKSIZE} controls the thread stack size. Try increasing this, it's units are in MB.

To set the thread stack size to 8MB, for example, do :

% setenv STACKSIZE 8000

jeremyweek3 at 2007-7-6 20:04:49 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2
Thanks for reply. I am going to try in few mins and post the results.Thanks-K_P
k_p at 2007-7-6 20:04:49 > top of Java-index,Development Tools,Solaris and Linux Development Tools...