Operating System - HP-UX
1745786 Members
3630 Online
108722 Solutions
New Discussion

signal 11, Segmentation fault. SEGV_ACCERR - Invalid Permissions for object

 
happySachin
Occasional Visitor

signal 11, Segmentation fault. SEGV_ACCERR - Invalid Permissions for object

I am writing a C application and sometime back I added pthread_detach to my code, and moved some functionality to a thread.

though my thread run in sequence i.e if the previous thread is alive no new thread will be created and once the old thread had died then only new thread will be created, hence do not see any issue with sync.

but since then my code crash on HPUX. Please help me resolve it. (attachd GDB output)

1 REPLY 1
Dennis Handly
Acclaimed Contributor

Re: signal 11, Segmentation fault. SEGV_ACCERR - Invalid Permissions for object

>since then my code crashes on HP-UX. Please help me resolve it.

 

Your gdb output has:

   warning: Some of the libraries in the core file are different from the libraries on this computer.

As it says, you need to use the packcore command to collect ALL of the load modules used by your application.

 

If we can trust the disassembly output then:

gr14: 0x28

gr15: 0x87ffffff5ff40370

gr35: 0x87ffffff5ff40fb0

0x40000000000bf910:0 <MapResourceGroups+0x1300>: adds r15=0xfffffffffffff3c0,r35;

0x40000000000bf910:1 <MapResourceGroups+0x1301>: ld8 r14=[r15]

0x40000000000bf920:0 <MapResourceGroups+0x1310>: adds r14=40,r14;;

0x40000000000bf920:1 <MapResourceGroups+0x1311>: ld8 r15=[r14]  << aborts here

 0x40000000000bf920:2 <MapResourceGroups+0x1312>: addl r14=0x7980,gp;;

 

This likely says you are indexing negative off of the value in r35 and putting it into r15.

Then you fetch from that address and get 0. Then add 40.  When you load off of the null pointer you abort.

 

What does this show?

x /8gx $r15-8*2