Operating System - HP-UX
1748065 Members
5467 Online
108758 Solutions
New Discussion юеВ

SEGV_ACCERR - Invalid Permissions for object.

 
Kercan
Occasional Contributor

SEGV_ACCERR - Invalid Permissions for object.

I have a DLL which is being loaded by another DLL.
In the constructor for one of the classes I use a std::string -

AClass::AClass() {
std::string tempStr;
tempStr = "foo";
}

It crashes at the point where I assign a value to tempStr with

Program received signal SIGSEGV, Segmentation fault
si_code: 2 - SEGV_ACCERR - Invalid Permissions for object.
0x9fffffffb9a54360:0 in std::basic_string,std::alloc
ator >::operator= (this=0x9fffffffffff8ed8, __s=void)
at /opt/aCC/include_std/string.cc:290
290 _C_pref()->__nchars_ = 0;


When I look at the tempStr object, the _C_data pointer does not look right.

(gdb) p tempStr
$1 = {_C_data = 0x1f "", static __nullref = }

tempStr is a local object which I just declared 1 line back before the initialization. No chance that it can be corrupted in between the declaration and assignment.

So not sure whats going on.
3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: SEGV_ACCERR - Invalid Permissions for object.

You might want to combine the two:
std::string tempStr("foo");

Is this application threaded?
Kercan
Occasional Contributor

Re: SEGV_ACCERR - Invalid Permissions for object.

well this is a simplification of the code. So the assignment is based on some other conditions. Yes the DLL does use threads.

thanks
Dennis Handly
Acclaimed Contributor

Re: SEGV_ACCERR - Invalid Permissions for object.

>Yes the DLL does use threads.

It could possibly be a thread stack overflow.
See my gdb commands in:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1345787