Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Languages and Scripting
cancel
Showing results for 
Search instead for 
Did you mean: 

SIGSEGV, SEGV_ACCERR - Invalid Permissions for object in OCIEnvCreate

SOLVED
Go to solution
Pinkerik
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.

 

8 REPLIES
Dennis Handly
Acclaimed Contributor

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

>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

Pinkerik
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

Dennis Handly
Acclaimed Contributor
Solution

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

Pinkerik
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

Highlighted
Dennis Handly
Acclaimed Contributor

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

>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.

Pinkerik
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

Sandeep_HCL
Occasional Visitor

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

Hi,

I am facing same issue and try to implement your solution. But, couldn't understand it. Could your please explain your solution in more elaborate manner and it could be greate if you explain it with some example? Quick response is highly appriociated and thanks in advance.

 

Regards,

Sandeep

Dennis Handly
Acclaimed Contributor

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

>I am facing same issue and try to implement your solution.

 

Do you have debug output to prove this?

I.e. what is your thread stack size and what is your usage when it aborts?