PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Bus Error

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling
View previous topic :: View next topic  
Author Message
khea_actua1



Joined: 06 Nov 2008
Posts: 42
Location: Carleton University

PostPosted: Mon Sep 20, 2010 12:52 pm    Post subject: Bus Error Reply with quote

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
View user's profile
mkcolg



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

PostPosted: Mon Sep 20, 2010 4:21 pm    Post subject: Reply with quote

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
View user's profile
khea_actua1



Joined: 06 Nov 2008
Posts: 42
Location: Carleton University

PostPosted: Tue Sep 21, 2010 9:48 am    Post subject: Reply with quote

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
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
Page 1 of 1

 
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