| View previous topic :: View next topic |
| Author |
Message |
mkcolg
Joined: 30 Jun 2004 Posts: 5001 Location: The Portland Group Inc.
|
Posted: Fri Oct 10, 2008 10:25 am Post subject: |
|
|
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 |
|
 |
Emma
Joined: 30 Sep 2008 Posts: 16
|
Posted: Wed Oct 15, 2008 7:17 am Post subject: Baby steps |
|
|
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 |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 5001 Location: The Portland Group Inc.
|
Posted: Wed Oct 15, 2008 11:57 am Post subject: |
|
|
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 |
|
 |
Emma
Joined: 30 Sep 2008 Posts: 16
|
Posted: Wed Oct 15, 2008 12:53 pm Post subject: The light shines |
|
|
| 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 |
|
 |
|