Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* Segmentation fault (core dumped)
@ 2001-09-11  6:31 Rolf Wester
  2001-09-11  7:10 ` Markus Pesti
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Rolf Wester @ 2001-09-11  6:31 UTC (permalink / raw)


Hi,

I have a question concerning core dumps. I have a program written in c++
(compiler is cxx) that makes a segmentation fault with subsequent core
dump. This happens some time after program start, so debugging would be
quite tedious. Is it possible to get information about the source line
where the segmentation fault happens from the core dump?

Rolf




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Segmentation fault (core dumped)
  2001-09-11  6:31 Segmentation fault (core dumped) Rolf Wester
@ 2001-09-11  7:10 ` Markus Pesti
  2001-09-11  8:30   ` Rolf Wester
  2001-09-11  9:40 ` Joerg Bruehe
  2001-09-12 22:31 ` Tim Mooney
  2 siblings, 1 reply; 5+ messages in thread
From: Markus Pesti @ 2001-09-11  7:10 UTC (permalink / raw)


Rolf Wester wrote:

> Hi,
> 
> I have a question concerning core dumps. I have a program written in c++
> (compiler is cxx) that makes a segmentation fault with subsequent core
> dump. This happens some time after program start, so debugging would be
> quite tedious. Is it possible to get information about the source line
> where the segmentation fault happens from the core dump?
> 
> Rolf
> 
> 
> 

I think it is an unhandled exception.

Markus



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Segmentation fault (core dumped)
  2001-09-11  7:10 ` Markus Pesti
@ 2001-09-11  8:30   ` Rolf Wester
  0 siblings, 0 replies; 5+ messages in thread
From: Rolf Wester @ 2001-09-11  8:30 UTC (permalink / raw)




Markus Pesti schrieb:

> Rolf Wester wrote:
>
> > Hi,
> >
> > I have a question concerning core dumps. I have a program written in c++
> > (compiler is cxx) that makes a segmentation fault with subsequent core
> > dump. This happens some time after program start, so debugging would be
> > quite tedious. Is it possible to get information about the source line
> > where the segmentation fault happens from the core dump?
> >
> > Rolf
> >
> >
> >
>
> I think it is an unhandled exception.
>
> Markus

I guess this means that there is no chance to get information about the
location
of the error?

Rolf




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Segmentation fault (core dumped)
  2001-09-11  6:31 Segmentation fault (core dumped) Rolf Wester
  2001-09-11  7:10 ` Markus Pesti
@ 2001-09-11  9:40 ` Joerg Bruehe
  2001-09-12 22:31 ` Tim Mooney
  2 siblings, 0 replies; 5+ messages in thread
From: Joerg Bruehe @ 2001-09-11  9:40 UTC (permalink / raw)


Hi Rolf,

Rolf Wester wrote:
> 
> Hi,
> 
> I have a question concerning core dumps. I have a program written in c++
> (compiler is cxx) that makes a segmentation fault with subsequent core
> dump. This happens some time after program start, so debugging would be
> quite tedious. Is it possible to get information about the source line
> where the segmentation fault happens from the core dump?

typically: Yes. 
"Debugging" does not necessarily mean "tracing" or "single-stepping". 

You should start by getting a stack backtrace from the core dump, 
the command is specific to the debugger you use: 
"adb" -> '$c',   "dbx"/"gdb" -> 'where',   "sdb" -> 't'. 
This should give you a function name, where the segmentation fault 
(= use of an invalid address via a pointer) occurred.

If that info is insufficient, add a "debug" option ('-g' ?) 
and recompile the program. When degugging the new core, 
you should also see line numbers.

Regards, 
Joerg Bruehe

-- 
Joerg Bruehe, SQL Datenbanksysteme GmbH, Berlin, Germany
     (speaking only for himself)
mailto: joerg@sql.de


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Segmentation fault (core dumped)
  2001-09-11  6:31 Segmentation fault (core dumped) Rolf Wester
  2001-09-11  7:10 ` Markus Pesti
  2001-09-11  9:40 ` Joerg Bruehe
@ 2001-09-12 22:31 ` Tim Mooney
  2 siblings, 0 replies; 5+ messages in thread
From: Tim Mooney @ 2001-09-12 22:31 UTC (permalink / raw)


In article <3B9DAFD3.714AC82C@ilt.fhg.de>,
Rolf Wester  <wester@ilt.fhg.de> wrote:
> Hi,
> 
> I have a question concerning core dumps. I have a program written in c++
> (compiler is cxx) that makes a segmentation fault with subsequent core
> dump. This happens some time after program start, so debugging would be
> quite tedious.

I think you're confusing "debugging" with single-stepping through a program.

Try this:

	ladebug your-program-name

and then within ladebug type

	run any arguments you would normally supply on the command line go here

i.e. if you normally would run you program and give it the name of a file
to read data from, you just

	run filename

Then just use your program as you normally do.  When your program gets
a fatal signal, ladebug will catch it before the program cores and before
it exits.  From there you can use commands like `where' to get a stack back
trace and `print' to get information on variables.

If your program wasn't compiled with debugging symbols, you'll have an easier
time getting more and better information if you recompile it with debugging
symbols (i.e. -g option to compiler and/or linker, and don't strip the
binary -- running `file' on the program should indicate `not stripped' in
the output).

> Is it possible to get information about the source line
> where the segmentation fault happens from the core dump?

Yup.  It's generally easier to do more if you catch the fatal signal while
running under a debugger, but you can even get some postmortem just by
doing

	ladebug programname core

and then typing

	where

Be sure you're using a recent version of ladebug.  It's improved a lot.
I would recommend the GNU debugger gdb, but it frankly doesn't work all that
well on Tru64.

Tim
-- 
Tim Mooney                              mooney@dogbert.cc.ndsu.NoDak.edu
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J6, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-09-12 22:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-11  6:31 Segmentation fault (core dumped) Rolf Wester
2001-09-11  7:10 ` Markus Pesti
2001-09-11  8:30   ` Rolf Wester
2001-09-11  9:40 ` Joerg Bruehe
2001-09-12 22:31 ` Tim Mooney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox