PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

script execution time limit and segmentation fault
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
Nebojsa



Joined: 03 Mar 2009
Posts: 20

PostPosted: Sun Dec 06, 2009 2:39 am    Post subject: script execution time limit and segmentation fault Reply with quote

I'm using pgilinux.904 on OpenSuse 11.1 and performing pgf90 on one script. After fortran stops in the middle of the script I get response Segmentation fault. Script is tested on other linux versions and pgi workstations and works correct. Could my problem be caused by some execution time limit?

Thanks

Nebojsa
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Dec 07, 2009 5:12 pm    Post subject: Reply with quote

Hi Nebojsa,

What signal are you getting?

If it's a signal 9 (kill), then yes you could have a execution time limit set on your system that would cause a time out. Though, a signal 9 could also mean that OS killed your process due to other reasons such as running the system running out of memory.

If it is a seg fault (signal 11), then the signal would be coming from process you're running, and not a time out.

- Mat
Back to top
View user's profile
Nebojsa



Joined: 03 Mar 2009
Posts: 20

PostPosted: Fri Dec 11, 2009 12:18 am    Post subject: Reply with quote

Hi Mat,

Here's the output when this script stops to work:

./new_prep.sh: line 92: 7514 Segmentation fault ../exe/initbc.exe > initbc.out
value of err is 139
BAILING OUT BECAUSE SOMETHING FAILED!!!!!!!!!
Back to top
View user's profile
mkcolg



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

PostPosted: Fri Dec 11, 2009 11:41 am    Post subject: Reply with quote

Hi Nebojsa,

A segmentation violation generally occurs when your program attempts to access memory it does not have permission to access. Common causes are de-referencing a null pointer, writing past the end of an array (out-of-bounds errors), or using un-initialized pointer variables.

As to the specific reason why your program is seg faulting, the only way to tell is to use a debugger like PGDBG or gdb. (See: http://www.pgroup.com/doc/pgitools.pdf for more information about PGDBG).

While learning how to debugging can take time (but well worth the time!), the simplest thing to do is run:
Code:
pgdbg -text  ../exe/initbc.exe
Next type 'run'. Once the program seg faults, type 'where' to get a stack trace. Though, debugging optimized can be very difficult so you may want to recompile with "-g" (debug) only.

Another useful tool that I highly recommend is Valgrind (see: http://www.valgrind.org). It's very good at finding un-initialized memory.

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



Joined: 03 Mar 2009
Posts: 20

PostPosted: Sat Dec 12, 2009 6:00 am    Post subject: Reply with quote

Thanks Mat, I'll try what you suggested and inform you about the results.

Best regards!

Nebojsa
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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