| View previous topic :: View next topic |
| Author |
Message |
Nebojsa
Joined: 03 Mar 2009 Posts: 20
|
Posted: Sun Dec 06, 2009 2:39 am Post subject: script execution time limit and segmentation fault |
|
|
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 |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Mon Dec 07, 2009 5:12 pm Post subject: |
|
|
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 |
|
 |
Nebojsa
Joined: 03 Mar 2009 Posts: 20
|
Posted: Fri Dec 11, 2009 12:18 am Post subject: |
|
|
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 |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Fri Dec 11, 2009 11:41 am Post subject: |
|
|
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 |
|
 |
Nebojsa
Joined: 03 Mar 2009 Posts: 20
|
Posted: Sat Dec 12, 2009 6:00 am Post subject: |
|
|
Thanks Mat, I'll try what you suggested and inform you about the results.
Best regards!
Nebojsa |
|
| Back to top |
|
 |
|