Languages and Scripting
Showing results for 
Search instead for 
Do you mean 

SIGSEGV, SEGV_ACCERR - Invalid Permissions for object in OCIEnvCreate

SOLVED
Go to Solution
Advisor

SIGSEGV, SEGV_ACCERR - Invalid Permissions for object in OCIEnvCreate

When running application, it crashes inside oracle library when calling OCIEnvCreate

But, when I tryed to simulate it, by just calling it alone, it works fine, even tryed to run it inside thread (still ok)

I have literally spent half a day just googling and trying every suggestion I found on forums, but I don't know what to try next..

 

Just to mention, it works completely fine on other platforms

 

Problem is reproducible every time, and every time it fails at same point

 

at call to:

OCIEnvCreate(reinterpret_cast<OCIEnv**>(&oci_env_hndl_), OCI_THREADED, NULL, NULL, NULL, NULL, 0, NULL);

where oci_env_hndl_ is NULL at time being called (checked through gdb)

 

I'm desperate here, and open to any suggestions

 

Thx.

 

1 ACCEPTED SOLUTIONS
Highlighted
Acclaimed Contributor Acclaimed Contributor

Re: SIGSEGV, SEGV_ACCERR - Invalid Permissions for object in OCIEnvCreate (thread stack overflow)

>(gdb) p $sp - $sp_save $1 = 335024

 

Yes,  you have a thread stack overflow.  You need something about twice the above value.

 

0x9fffffffbbf03c10:0 <skgfqio+0x00>: alloc r36=ar.pfs,0,42,8,0

0x9fffffffbbf03c10:1 <skgfqio+0x01>: mov r9=0x45730  << large frame!

0x9fffffffbbf03c30:0 <skgfqio+0x20>: sub r12=r12,r9

0x9fffffffbbf03c60:1 <skgfqio+0x51>: adds r39=16,r12

0x9fffffffbbf03c70:1 <skgfqio+0x61>: st4 [r39]=r0,8  <<< Storing into a local shouldn't give signal

6 REPLIES
Acclaimed Contributor Acclaimed Contributor

Re: SIGSEGV, SEGV_ACCERR - Invalid Permissions for object in OCIEnvCreate (thread stack overflow)

[ Edited ]

>even tried to run it inside thread

 

You could have a thread stack overflow.

What does this show?

(gdb) disas $pc-16*12 $pc+16*4

(gdb) set $sp_save = $sp

(gdb) frame 42

(gdb) p $sp - $sp_save

Advisor

Re: SIGSEGV, SEGV_ACCERR - Invalid Permissions for object in OCIEnvCreate

Had to rerun the program, because firewall cut of my ssh connection,

but same crash at the same place,

just posting new backtrace again

Highlighted
Acclaimed Contributor Acclaimed Contributor

Re: SIGSEGV, SEGV_ACCERR - Invalid Permissions for object in OCIEnvCreate (thread stack overflow)

>(gdb) p $sp - $sp_save $1 = 335024

 

Yes,  you have a thread stack overflow.  You need something about twice the above value.

 

0x9fffffffbbf03c10:0 <skgfqio+0x00>: alloc r36=ar.pfs,0,42,8,0

0x9fffffffbbf03c10:1 <skgfqio+0x01>: mov r9=0x45730  << large frame!

0x9fffffffbbf03c30:0 <skgfqio+0x20>: sub r12=r12,r9

0x9fffffffbbf03c60:1 <skgfqio+0x51>: adds r39=16,r12

0x9fffffffbbf03c70:1 <skgfqio+0x61>: st4 [r39]=r0,8  <<< Storing into a local shouldn't give signal

Advisor

Re: SIGSEGV, SEGV_ACCERR - Invalid Permissions for object in OCIEnvCreate

I even tryed to increase thread stack trace through 

pthread_attr_setstacksize

 

Old thread stack size: 262144
New thread stack size: 8388608

 

But that still didn't help

Acclaimed Contributor Acclaimed Contributor

Re: SIGSEGV, SEGV_ACCERR - Invalid Permissions for object in OCIEnvCreate (thread stack overflow)

[ Edited ]

>I even tried to increase thread stack trace through pthread_attr_setstacksize

 

(Should I assume you know how to use that function and pass the attributes to pthread_create?)

 

>(gdb) p $sp - $sp_save $1 = 335024

 

If this calculation didn't change, then you didn't change the stacksize.

Advisor

Re: SIGSEGV, SEGV_ACCERR - Invalid Permissions for object in OCIEnvCreate

I'm so sorry about my last post,

I have a realy bad habit of not reading documentation till the end...

 

But it works great now

Thank you so much for your help