PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

error while loading shared libraries
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling
View previous topic :: View next topic  
Author Message
mkcolg



Joined: 30 Jun 2004
Posts: 6134
Location: The Portland Group Inc.

PostPosted: Fri Oct 10, 2008 10:25 am    Post subject: Reply with quote

Hi Emma,

Now that you've disabled SELinux, let's start back at the beginning.

While PGDBG has gotten a lot better with debugging shared libraries, it shill isn't perfect. It set a break point in a shared library, the library must first be loaded. So first set a breakpoint at the beginning of the program, select 'run', and then you should be able now set a breakpoint in the shared library provided it's compiled with "-g" (or "-gopt") and the debugger is able to find the library's source files.

Personally when I have access to all the source, I compile and link the library's source directly into my main program. Give it a try if you can.

Finally, try running your program using Valgrind (www.valgrind.org) to check for uninitialized memory references (UMR). UMRs are nasty bugs that can cause seemingly random problems and may explain why compiling the main program with gcc "passes".

Hope this helps,
Mat
Back to top
View user's profile
Emma



Joined: 30 Sep 2008
Posts: 16

PostPosted: Wed Oct 15, 2008 7:17 am    Post subject: Baby steps Reply with quote

All the UMRs I found originated in code I don't have access to.

The error was occurring around a construct of the form:

Code:
if ( !A | B !=0) {
    return C
}


I broke this up into

Code:
if ( !A )
{
    return C
}
else if ( B != 0 )
{
    return C
}


That moved me on a little further into the code before I met with another SIGSEGV. Is this going to be a case of changing my code style to one acceptable to PGI?
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6134
Location: The Portland Group Inc.

PostPosted: Wed Oct 15, 2008 11:57 am    Post subject: Reply with quote

Hi Emma,

Please clarify if you really meant to use a logical OR "||" instead of a bit-wise OR "|" in your first example? If it's bitwise then the two statements are not equivalent and your bug is that you're using a bit-wise operator instead of the intended logical operator.

Note that if you could post a snippet of the code or send an example to trs@pgroup.com and ask customer service to send it to me, it might be helpful in determining the problem

- Mat
Back to top
View user's profile
Emma



Joined: 30 Sep 2008
Posts: 16

PostPosted: Wed Oct 15, 2008 12:53 pm    Post subject: The light shines Reply with quote

Um, ya. That would be the problem. Thank-you again. Looks like this is going to be an exercise is tracking silly mistakes that haven't revealed themselves by shear luck.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling All times are GMT - 7 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group