1752666 Members
5784 Online
108788 Solutions
New Discussion юеВ

Re: SIGSEGV Error

 
Parthasarathy_1
New Member

SIGSEGV Error

Hi,

I am trying to run an ProC program on HP-UNIX 11i box, and have been getting the following error.

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

The program quits after creating the core file.

I pasting the output of the "what core" command.

/home/barts/scripts $ what core
core:
$ PATCH_11.11/PHCO_25568 Dec 19 2001 06:21:26 $
pigrid.cxx 1.20 1.20 07/03/96]
pigrid.cxx 1.20 1.20 07/03/96]
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pievent.hxx 1.28 04/26/96
ptevent.hxx 1.5]
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pievent.hxx 1.28 04/26/96
ptevent.hxx 1.5]
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pievent.hxx 1.28 04/26/96
ptevent.hxx 1.5]
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pievent.hxx 1.28 04/26/96
ptevent.hxx 1.5]
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pievent.hxx 1.28 04/26/96
ptevent.hxx 1.5]
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitime.cxx 1.87 09/26/96]
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pivalue.cxx 1.143 01/21/97]
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pievent.hxx 1.28 04/26/96
ptevent.hxx 1.5]
pievent.cxx 1.14 09/11/96
pievent.cxx 1.14 09/11/96
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pitmplar.hxx 1.54 07/18/96]:
pisecobj.cxx 1.27 09/30/96]:
pitmplar.hxx 1.54 07/18/96]:
pisecobj.cxx 1.27 09/30/96]:
pitmplar.hxx 1.54 07/18/96]:
$ B.11.11_LR Oct 26 2000 23:10:23 $
Pthread Interfaces
$Revision: libpthread.1: @(#) depot-32pa R11.11_BL2003_1209_2 PATCH_11.11 PHCO_29960 Tue Dec 9 01:51:37 PST 2003 $
HP-UX libm shared PA1.1 C Math Library 20000331 (201031) UX11.01
HP-UX libisamstub.sl 19991217 (135120) B3907DB/B3909DB B.11.01.11
fs_amod.s $Revision: 1.9.1.1 $
libcl.sl version B.11.01.18 - Jan 3 2003
$ PATCH_11.11/PHCO_29495 Sep 15 2003 04:29:46 $
SMART_BIND
92453-07 dld dld dld.sl B.11.32 020411

If I do "file core" command it shows the Proc program which I tried to run.

/home/barts/scripts $ file core
core: core file from 'sy_ocstobarts' - received SIGSEGV

Is there is a way to find out which statement or command in the ProC causing the issue ?.

Any suggestion is welcome.

Rgds
Partha

 

 

 

 

Moved from HP-UX Technical Documentation to HP-UX > languages

9 REPLIES 9
Patrick Wallek
Honored Contributor

Re: SIGSEGV Error

I think the key actually is the initial error.

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

How much memory are you trying allocate with the program? You may need to take a look at your max*siz kernel parameters. What are their current values?
Devender Khatana
Honored Contributor

Re: SIGSEGV Error

Partha,

It seems as if your maxssiz tunable parameter is not set properly. Just post what is the value of this parameter in the output of 'kmtune -l'

Alongwith brief system Config.

Regards,
Devender
Impossible itself mentions "I m possible"
Parthasarathy_1
New Member

Re: SIGSEGV Error

How much memory are you trying allocate with the program?
Ans: Can you let me know how to find it ?.

You may need to take a look at your max*siz kernel parameters. What are their current values?

Ans: Is there is some command using which I can query the kernel parameters ?. As, I am not the UNIX administrator, I don't have the above details. Please help.
Biswajit Tripathy
Honored Contributor

Re: SIGSEGV Error

SIGSEGV is a defect in your program. You typically
get segmenation violation if you are trying to access
outside the boundary of your memory. For example,
accessing memory outside the bounds of an array,
trying to write into read-only memory or de-referencing
a NULL pointer. Check for possible presence of these
problems in your code.

- Biswajit
:-)
Parthasarathy_1
New Member

Re: SIGSEGV Error

Hi All,

Below are the requested details.

System Configuration :
HP9000/RP7400 with 2 550MHz CPU's, 4GB of memory and 8GB of swap space.

Kernel Parameters:
The parameters are:
maxdsiz 2063835136
maxdsiz_64bit 0x80000000
maxssiz 0x8000000
maxssiz_64bit 0x40000000
maxtsiz 0x4000000
maxtsiz_64bit 0x40000000

The output of kmtune is attached:
Biswajit Tripathy
Honored Contributor

Re: SIGSEGV Error

SIGSEGV is a programm issue and not kernel tunable
issue.

- Biswajit
:-)
A. Clay Stephenson
Acclaimed Contributor

Re: SIGSEGV Error

Actually a segmentation violation could be either a programming error or the result of hitting a kernel limit. In order to nail down what is actually happening you need to examine the core file with a debugger (e.g. gdb) and get a stack trace. If you compile with the -g option and let that executable die and then examine the resulting the core with a debugger there is a rather good change that the stak trace will point you to the exact source code line. Until you examine the stack trace (or possibly put probes in your code), all other approaches are simply using "The Force".
If it ain't broke, I can fix that.
Biswajit Tripathy
Honored Contributor

Re: SIGSEGV Error

I think, if you see a SIGSEGV because of hitting a
kernel limit, you should contact HP representative
and file a defect.

- Biswajit
:-)
Biswajit Tripathy
Honored Contributor

Re: SIGSEGV Error

Partha,

In my last post, I said:
> I think, if you see a SIGSEGV because of hitting a
> kernel limit, you should contact HP representative
> and file a defect.

I think it came out a little different than I intended
it to. So let me clarify that. There are only few
conditions, like a program overflowing the stack,
when SIGSEGV can happen because of inadequate
value of kernel parameter. This is because the
program needs a stack larger than 'maxssiz'. You
might have hit that in your case if there is no
problem with your code (can be confirmed by following A. Clay Stephenson's suggestion of
compiling with -g option). If the problem is in your
code, you will hit SIGSEGV even if you increase
'maxssiz'. In general, SIGSEGV can happen because
of 2 conditions, 1) illegal address being referenced
and 2) invalid permission for the address.

Hope this is clear now.

- Biswajit
:-)