Operating System - HP-UX
1753768 Members
5236 Online
108799 Solutions
New Discussion юеВ

SIGSEGV error after HP UX 11.11 upgrade

 
Shishir K
Occasional Advisor

SIGSEGV error after HP UX 11.11 upgrade

Hello All,
We had an OS upgrade for HP itanium from HP UX 11.00 to HP UX 11.11 and aCC compiler upgrade from A.03.33 to A.03.45. I have a pro*C code which was compiled and running using old configuration. After upgrade the code errors out with SIGSEGV error for insufficent stack size or maxdsize and coredumps.
I am using -o -s -Wl,-archive,+vnocompatwarnings switches while compiling and also tried using +DA2.0 along with the above switches. But all of them fail.
I am specifying -lclntst9 -lclient9 -ln9 -lnl9 -lnro9 -lntcp9 -ltrace9 -lvsn9 -lcommon9 -lgeneric9 -lpls9 -lplp9 -lmm -lnls9 -lcore9 -l:libcl.sl -l:librt.sl -lpthread -l:libnss_dns.1 -l:libdld.sl -lm while linking.
Are there any specific patches I need to apply or am I missing out any switches while compiling.
Thanks
Shishir
12 REPLIES 12
James R. Ferguson
Acclaimed Contributor

Re: SIGSEGV error after HP UX 11.11 upgrade

HI:

> We had an OS upgrade for HP itanium from HP UX 11.00 to HP UX 11.11 and aCC compiler upgrade from A.03.33 to A.03.45.

First, Itanium servers require something later than 11.11 --- either 11.23 or 11.31.

Version A.03.45 is very old (ca. 2003).

That said, you need to examine your 'maxdsiz' and 'maxssiz' kernel parameters with 'kmtune'. increase those values appropriately, and try again.

Regards!

...JRF...
Shishir K
Occasional Advisor

Re: SIGSEGV error after HP UX 11.11 upgrade

Hi James,
I apologize for incorrect information. We had an upgrade for HP PA-RISC system from HP UX 11.00 to HP UX 11.11. I executed the ulimit -a command and here are the results
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 1048576
stack(kbytes) 131072
memory(kbytes) unlimited
coredump(blocks) 4194303
James R. Ferguson
Acclaimed Contributor

Re: SIGSEGV error after HP UX 11.11 upgrade

Hi (again) Shirhir:

The data and stack sizes shown in your 'ulimit' output far above the default values.

You could also be out of sufficient swap space. Do:

# swapinfo -tam

Regards!

...JRF...
Shishir K
Occasional Advisor

Re: SIGSEGV error after HP UX 11.11 upgrade

Hi James,
Below is the output of swapinfo -tam

Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 2048 0 2048 0% 0 - 1 /dev/vg00/lvol2
dev 3752 0 3752 0% 0 - 1 /dev/vg00/swap2
reserve - 926 -926
memory 11879 4839 7040 41%
total 17679 5765 11914 33% - 0 -
James R. Ferguson
Acclaimed Contributor

Re: SIGSEGV error after HP UX 11.11 upgrade

Hi (again):

If you have 'glance' you could start running that and watch what happens to swap utilization during an abortive code run. Otherwise, you could do something like:

#!/usr/bin/sh
while true
do
swapinfo -tam > /tmp/swapinfo
sleep 5
done

...and launch that into the background to collect swap utiliztation data.

What you have posted is undoubtedly not when your code fails, or if it is, then swap isn't our problem.

Regards!

...JRF...
Shishir K
Occasional Advisor

Re: SIGSEGV error after HP UX 11.11 upgrade

Hi James,
Am attaching the output of the swapinfo script when the exe failed with SIGSEGV. I took a snapshot every 10 seconds.

Thanks
Shishir
Michael Steele_2
Honored Contributor

Re: SIGSEGV error after HP UX 11.11 upgrade

Hi Shishir:

You swap is fine.

Can you post the values of maxssiz, maxssiz_64, maxdsiz, maxdsiz_64.

Are you 32 or 64 bit?

Your application manufacturer should have recommendations for the size of these kernel parameters. Like with Oracle or SAP. If home grown then check the previous values.
Support Fatherhood - Stop Family Law
Dennis Handly
Acclaimed Contributor

Re: SIGSEGV error after HP UX 11.11 upgrade

>After upgrade the code errors out with SIGSEGV error for insufficient stack size or maxdsiz and coredumps.

Did you recompile or just try running existing executables? The latest aC++ is A.03.80.
Have you gotten a stack trace to see why?
This could just be a simple recursive stack overflow.
Shishir K
Occasional Advisor

Re: SIGSEGV error after HP UX 11.11 upgrade

Hi,
Thanks to all for your help. Actually debugged the code step by step and was able to fix SIGSEGV error which was coming. Still not able to understand how memcpy worked for -ve values(end - start +1) when input was empty character sequence in old compiler and not in latest one.

GetString ( const char * input, unsigned short size ) const{
char tmp[31];
memset(tmp,'\0',31);
int start=0, end=size-1;
const char * ptr = input;
while ( *ptr == ' ' )
{ start++; ptr++; }
ptr = input + size - 1;
while ( *ptr == ' ' )
{ end--; ptr--; }
if( end > start + 1 )// not there earlier and added now to fix SIGSEGV
memcpy(tmp,input+start,end-start+1);
return string(tmp);
}

Can anybody shed any light on this.

Thanks
Shishir