Operating System - HP-UX
1822986 Members
3887 Online
109645 Solutions
New Discussion юеВ

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

 
subrata  Sur
Frequent Advisor

How to avoid SIGSEGV - segmentation violation(signal no 11)

Right now I have faced a typical problemm in Unix (HP-UX uacob004 B.10.20 A 9000/782 2016569613 two-user license)
When i have run my application it is just thrown out of the system giving the following error .....

terminated by signal number 11
(20040924 04:56:31): Signal description: SIGSEGV - segmentation violation


I have checked the sar command it is giving like that
13:51:30 %usr %sys %wio %idle
13:51:31 100 0 0 0
13:51:32 100 0 0 0

Space is no issue ....
I guess memory utilization is the issue .....

Can u tell me how can i avoid that ...

 

 

 

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

21 REPLIES 21
John Palmer
Honored Contributor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

SIGSEGV is an error within your application probably caused by an attempt to access a memory location that's not valid (usually an incorrect or corrupt pointer).

It's very unlikely to be caused by an operating system issue.

Are you able to consult with the application supplier?
Eric Antunes
Honored Contributor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

Hi,

Execute as root and post the results of these:

#swapinfo -tam
#kmtune -l -q dbc_max_pct
#kmtune -l -q shmmax

Eric
Each and every day is a good day to learn.
Muthukumar_5
Honored Contributor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

SIGSEGV problem will be occured when an application try to access unallocated memory area / invalid memory area / unaligned access to that particular application there. It is not related memory of system.

If you get that on during application run, you will get one core there. Try to analys with gdb as,

gdb application-binary core

or simply

file core
what core

SIGSEGV will be the application code written problem.
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

A good discussion on SIGSEV and debugging there.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=670597

User limit corefile informations can be known as,

ulimit -c

You can know about core file limitation on using,
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=674445
Easy to suggest when don't know about the problem!
subrata  Sur
Frequent Advisor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

In the mean time i m attaching the core file for ur further verification ... As right now i dont have gdb debugger So can u tell me at what point it is crashing my program


---------------------------------
wapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 1024 0 1024 0% 0 - 1 /dev/vg00/lvol2
reserve - 52 -52
total 1024 52 972 5% - 0 -

----------------------------------
dbc_max_pct = 50

----------------------------------
shmmax = 67108864

---------------------------------
dbc_max_pct is high, lowering it may free more memory.
------------------------------
Muthukumar_5
Honored Contributor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

SIGSEGV problem will not come when there is insufficieny in system memory. It is because of application's are trying to access invalid memory area there.

You don't need gdb debugger too to analyse core there.

Try as,

file core
what core

If you want to analyse that problem of application and where it occured then it will be good with gdb.

Attaching core file to us will not be helpful. It will be effect to have that application binary with debug mode too there.


Or you can try adb there too.

http://software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=NEWADB11i

It is for 11.00 version there.
Easy to suggest when don't know about the problem!
subrata  Sur
Frequent Advisor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

Hi
I m attaching the core in three parts and also attaching the split software for ur further necessary action ...
Pl read it As i dnt have gdb tools
subrata  Sur
Frequent Advisor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

Hi
Sorry for earlier mail

I m attaching the core in three zip parts and also attaching the split software(core3.zip) for ur further necessary action ...
Pl read it As i dnt have gdb tools
subrata  Sur
Frequent Advisor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

Hi
Sorry for earlier mail

I m attaching the core in three zip parts and also attaching the split software(core3.zip) for ur further necessary action ...
Pl read it As i dnt have gdb tools


---------------
core2.zip
Eric Antunes
Honored Contributor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

Hi subrata,

Your shmmax is set for systems with something like 128Mb of physical memory... How much memory do you have???

Eric
Each and every day is a good day to learn.
subrata  Sur
Frequent Advisor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

Hi
Sorry for earlier mail

I m attaching the core in three zip parts and also attaching the split software(core3.zip) for ur further necessary action ...
Pl read it As i dnt have gdb tools


---------------
core3.zip consists also split software
subrata  Sur
Frequent Advisor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

I get this result when reading core ...


uacob004 $ uacob004 $ file core
core: core file from 'schedulex7' - received SIGSEGV
uacob004 $ what core
core:
schedulex7 v7.30 (Beta) 2000/05/25 23:45:04 HP-UX B.10.20
Matrix.c 3.12 3/11/92
Clip.c 3.3 2/18/92
HP $revision: 66.1 $ 72.4 $
$Revision: 76.7 $
OSF/Motif Version 1.2.6
X Window System, Version 11 R5+ HP-UX B.10.10.00 March 2000 Patch Releas
e
(build date: Tue Feb 15 12:18:25 IST 2000)



X Window System, Version 11 R5+ HP-UX B.10.10.00 Oct 1999 Patch Release
(build date: Wed Sep 29 09:52:18 MDT 1999)



Built for: 10.10 on HP-UX Daily, -O +Onolimit
X Window System, Version 11 R5
(build date: Thu Jan 14 17:24:08 MST 1999)
HP-UX libisamsstub.sl 960417 (183833) B3906AA/B3908AA B.10.20.01
fs_amod.s $Revision: 1.9.1.1 $
libcl.sl 10.20 version B.10.29.10 02/20/1999
PATCH-PHCO_20441 for 10.20; for 10.30, 11.x compatibility libc.1_ID@@/m
ain/r10dav/libc_dav/libc_dav_cpe/9
/ux/core/libs/libc/shared_pa1/libc.1_ID
Nov 10 1999 10:53:12
SMART_BIND
92453-07 dld dld dld.sl B.10.32 990202
uacob004 $
subrata  Sur
Frequent Advisor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

Physical: 1048576 Kbytes


uacob004 $ /opt/sudo/bin/sudo /usr/sbin/dmesg

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these two things:

#1) Respect the privacy of others.
#2) Think before you type.

Password:

Sep 24 09:47
vuseg=51c1000
nfs_init3 added vfs type nfs3 at slot 4
NOTICE: cachefs_link(): File system was registered at index 5.
NOTICE: autofs_link(): File system was registered at index 6.
inet_clts:ok inet_cots:ok 8 ccio
8/0 GSCtoPCI
8/0/19/0 c720
8/0/19/0.6 tgt
8/0/19/0.6.0 sdisk
8/0/19/0.7 tgt
8/0/19/0.7.0 sctl
8/0/20/0 btlan3
8/0/63 asio0
8/4 c720
8/4.7 tgt
8/4.7.0 sctl
8/4.8 tgt
8/4.8.0 sdisk
8/8 c720
8/8.7 tgt
8/8.7.0 sctl
8/8.12 tgt
8/8.12.0 sdisk
8/8.13 tgt
8/8.13.0 sdisk
8/8.14 tgt
8/8.14.0 sdisk
8/8.15 tgt
8/8.15.0 sdisk
8/16 bus_adapter
8/16/4 asio0
8/16/5 c720
8/16/5.3 tgt
8/16/5.3.0 stape
8/16/5.7 tgt
8/16/5.7.0 sctl
8/16/0 CentIf
8/16/1 audio
8/16/7 ps2
10 ccio
10/0 GSCtoPCI
10/8 graph3
32 processor
49 memory
Memory Base address is f2fff000
btlan3: Initializing 10/100BASE-TX card at 8/0/20/0....
btlan3: Hardware Reset Started on 8/0/20/0....This will take approximately 8 sec
onds

System Console is on the ITE
Networking memory for fragment reassembly is restricted to 93442048 bytes
Logical volume 64, 0x3 configured as ROOT
Logical volume 64, 0x2 configured as SWAP
Logical volume 64, 0x2 configured as DUMP
Swap device table: (start & size given in 512-byte blocks)
entry 0 - major is 64, minor is 0x2; start = 0, size = 2097152
WARNING: Insufficient space on dump device to save full crashdump.
Only 1073741824 of 1073742848 bytes will be saved.
Dump device table: (start & size given in 1-Kbyte blocks)
entry 0 - major is 31, minor is 0x6000; start = 52064, size = 1048576
Starting the STREAMS daemons.
B2352B HP-UX (B.10.20) #1: Sun Jun 9 08:03:38 PDT 1996

Memory Information:
physical page size = 4096 bytes, logical page size = 4096 bytes
Physical: 1048576 Kbytes, lockable: 865988 Kbytes, available: 900448 Kbytes

btlan3: NOTE: 100Base-TX Full Duplex started at 8/0/20/0....
WARNING: netbios: FAILED to bind to RFC-NetBIOS SESSION SERVICE port 139
WARNING: Critical ERROR has occured. Terminating NetBIOS
WARNING: netbios: got I_UNLINK on NAME SERVICE link
WARNING: netbios: got I_UNLINK on DATAGRAM SERVICE link
WARNING: netbios: got I_UNLINK on SESSION SERVICE link

Eric Antunes
Honored Contributor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

Muthukumar,

He has no memory paging enabled and shmmax tuned for a 128Mb server. Do you think he is gonna make it with this kind of kernel parameters??

Best Regards,

Eric Antunes
Each and every day is a good day to learn.
Muthukumar_5
Honored Contributor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

Physical: 1048576 Kbytes, lockable: 865988 Kbytes, available: 900448 Kbytes
says your system memory are okie.

uacob004 $ uacob004 $ file core
core: core file from 'schedulex7' - received SIGSEGV
uacob004 $ what core
core:
schedulex7 v7.30 (Beta) 2000/05/25 23:45:04 HP-UX B.10.20
Matrix.c 3.12 3/11/92
Clip.c 3.3 2/18/92

core informations are specifying that the problem is because of schedulex7 application / service there. And your hp-ux version is too old. (B.10.20) there.

schedulex7 -> is it system application or your own one??
IF you are having source code for that application we can further proceed there. Else Application upgradation change / support from that application vendor will be possible.

If you are having code and adb ( check whereis adb ) try to debug with that too.
Easy to suggest when don't know about the problem!
Eric Antunes
Honored Contributor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

Subrata,

Set your shmmax to 939524096 and dbc_max_pct to 15.

Let us know the results!

Eric
Each and every day is a good day to learn.
Muthukumar_5
Honored Contributor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

Eric Autunes,

We are having a production / testing server which is having settings of shmmax and dbc_max_pct as like subrata one.. as 0x4000000 and 50 there.

But subra try with eric change, it might give some special changes there too.
Easy to suggest when don't know about the problem!
Eric Antunes
Honored Contributor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

Muthukumar,

Don't you think it's strange that swapinfo doesn't show the memory paging area?

...
memory 1130 433 697 38%
...

Eric
Each and every day is a good day to learn.
subrata  Sur
Frequent Advisor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

can u tell me how to use how to use the adb debugger As i m confusing with so many options ......
iit is stored in /usr/bin/adb
and my core file directory is /users/glenh/core
subrata  Sur
Frequent Advisor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

Right now i getting also signal no 10 a BUS error ....


20040924 11:00:22): sche[strt] 20040924 11:00:22
(20040924 11:00:22): Evaluating: sche[strt] 20040924 11:00:22
(20040924 11:00:22): -> Updating Schedule Start Date
(20040924 11:00:22): -> SIM
(20040924 11:00:22): sim
(20040924 11:00:22): Evaluating: sim
(20040924 11:00:26): Production Scheduling terminated by signal number 10

(20040924 11:00:26): Signal description: SIGBUS - bus error

(20040924 11:00:26): Production Scheduling is saving backup case: /db_cob/sx/cas
es//CASE.CBG_BASE.BAK

(20040924 11:00:26): -> Saving BINARY casefile /db_cob/sx/cases/CASE.CBG_BASE.BA
K
(20040924 11:00:27): Production Scheduling terminated by signal number 11

(20040924 11:00:27): Signal description: SIGSEGV - segmentation violation

Plz suggest ....
subrata  Sur
Frequent Advisor

Re: How to avoid SIGSEGV - segmentation violation(signal no 11)

The segmentation violation is caused by this program ....

proc cob_update_model {} {

sx updategui off


sxputs "Starting COB_UPDATE_MODEL_CRON"

#Get the paths and such
set inpath_index [sxList find pth inpath]
set inpath [sxTable get path cell $inpath_index 1]
set inpath [string tolower $inpath]
set tclpath_index [sxList find pth tclpath]
set tclpath [sxTable get path cell $tclpath_index 1]
set tclpath [string tolower $tclpath]


##Status off the schedule. I want to run this step
##first because there will be less junk to deal with later.
if { [lindex [exec "wc $inpath/inv_delete"] 0] > 0} {
source $tclpath/cob_schedule_update.tcl
cob_schedule_update
}

set date [exec date]
set now_in_sec [dateToSec $date]
set today_date [secToDate $now_in_sec]
set year [string range $today_date 0 3]
set month [string range $today_date 5 6]
set day [string range $today_date 8 9]
set hour [lindex $today_date 1]
set space " "
set now $year$month$day$space$hour
sx sche\[strt\] $now
sx sim

sx clear dab
sx copy sli dab
sx sim


#Let's determine what is the next 30 day horizon
#First prepare the import file
source $tclpath/cob_prepare_sdeimport.tcl
cob_prepare_sdeimport


# Update the INV,ACT

set act_end_loc [sxList find act act_end]
sxList del act $act_end_loc

sximport $inpath/invlist inv append
sximport $inpath/invlist act append
sximport $inpath/inv_delete act delete
sximport $inpath/inv_delete inv delete
sximport $inpath/nonhorizonact act delete
sximport $inpath/nonhorizonact inv delete
sxList add act act_end

sx save


# Plz remove the comments when move into production
#Update SDEs
# Import SDE file

sx inve\[\;1\]=0
sx clear sde
sx sdeload $inpath/sde_today
sx sim

sx bsiz\[\;\] = 1
set start [sxSchedule start]
sxTable set aref 1 1 $start
sx updategui on
sxputs "Finished COB_UPDATE_MODEL_CRON"
}