| View previous topic :: View next topic |
| Author |
Message |
khea_actua1
Joined: 06 Nov 2008 Posts: 42 Location: Carleton University
|
Posted: Mon Sep 20, 2010 12:52 pm Post subject: Bus Error |
|
|
This is likely not the right place to post this question, but without getting anywhere I figured I'd try.
Is there a good way to use the debugger to try to solve memory errors?
I'm getting a "Bus Error", or "Signalled SIGSERV at 0x1001081F9..." and I have no idea why. It seems to happen the first time my program writes to a variable defined as:
REAL :: HDELT
COMMON /TIMES/HDELT
The line causing the error is simple
HDELT = 300.0;
I narrowed it down to this using print statements all around it (I come from a PHP background and have never had to rely on debuggers.)
I know the code I pasted is right and clearly can't be solely responsible for the error, but I don't know where else to look. Does any one have any idea?
This is running on a MacPro 10.6.1 (Snow Leopard), dual processor x86_64 (Quad-Core Intel Xeon). it is compiled to run with OpenMP, but I've limited it to one thread to avoid concurrency issues (even though this code isn't in a parallel block.)
Anyone see this before? Or have any suggestions on how to find the cause?
Thanks. |
|
| Back to top |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 5001 Location: The Portland Group Inc.
|
Posted: Mon Sep 20, 2010 4:21 pm Post subject: |
|
|
Hi khea_actua1,
A Bus error means that the program is accessing non-aligned data or the data'saddress doesn't exist. Why this is occurring on this common block, I unfortunately don't know.
What flags are you compiling with? Is the common block used in an OpenMP threadprivate clause? Does the program run if you don't compile with OpenMP (i.e. remove -mp)? How is the "TIMES" common block used/delcared elsewhere in the program?
- Mat |
|
| Back to top |
|
 |
khea_actua1
Joined: 06 Nov 2008 Posts: 42 Location: Carleton University
|
Posted: Tue Sep 21, 2010 9:48 am Post subject: |
|
|
Thanks for the reply!
The same problem occured with and without OpenMP.
I did however manage to solve it, after 8 hours of frustration, all it took was initializing HDELT with a value, ie:
| Code: | REAL :: HDELT[b] = 0.0[/b]
COMMON /TIMES/HDELT |
I'm not sure why this works, as I was able to print out the non-initialized HDELT value (usually was equal to 3006.6 or something..) |
|
| Back to top |
|
 |
|