line numbers on segfault

P

Paul

Situation:
Running a MPI program that segfaults.
Cannot open program up in debugger due to nature of MPI system.
Using g++ 3.2.3.

Goal:
Find out which line it segfaults on; ideally which variable name causes
the error. Some kind of error message akin to VC7's "stack corrupted
around varname" message would be very nice.

Less ideally:
I'm told that core dumps aid in finding out what went wrong where.

a)Is a "stack corrupted around" message possible with gcc?
b)How can I force my program to core dump on exceptional exit?


Thanks,
Paul
 
V

Victor Bazarov

Paul said:
Situation:
Running a MPI program that segfaults.
Cannot open program up in debugger due to nature of MPI system.
Using g++ 3.2.3.

Goal:
Find out which line it segfaults on; ideally which variable name causes
the error. Some kind of error message akin to VC7's "stack corrupted
around varname" message would be very nice.

Less ideally:
I'm told that core dumps aid in finding out what went wrong where.

a)Is a "stack corrupted around" message possible with gcc?
b)How can I force my program to core dump on exceptional exit?

The only relevant term I've found is "variable". MPI, segfault, core
dump, debugger, while are well known, unfortunately mean very little
in a language newsgroup. Unless your problem is proven of a language
kind, you'll be better off in a newsgroup dedicated to your platform
or to your compiler. Since you didn't say what platform it was, I
can't recommend anything in particular, only 'comp.os.<your_platform>',
but for g++ there is 'gnu.g++.help'.

If you think your problem _is_ of a language kind, please post the code
you think is responsible. Without code there is no real way to help
you.

Victor
 
E

E. Robert Tisdale

Paul said:
Situation:
Running a MPI program that segfaults.
Cannot open program up in debugger due to nature of MPI system.

I used Google

http://www.google.com/

to search for

+"Parallel DeBugger" +"MPI"

and I found lots of stuff.
We use TotalView

http://www.etnus.com/

You can download it and try it for free.
Using g++ 3.2.3.

Goal:
Find out which line it segfaults on; ideally which variable name causes
the error. Some kind of error message akin to VC7's "stack corrupted
around varname" message would be very nice.

Less ideally:
I'm told that core dumps aid in finding out what went wrong where.

a)Is a "stack corrupted around" message possible with gcc?
b)How can I force my program to core dump on exceptional exit?

If you can run on one node (the head node),
you might be able to use The GNU Debugger (gdb).

If you are intimately familiar with the source code (if you wrote it),
you can seed the source with printf statements
to help you locate the segfault.
You can quickly locate it using a binary search.
It can be a lot quicker than the debugger
unless you didn't write and don't understand the code very well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top