caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Caml source line numbers in custom executable
@ 2005-01-10 21:41 Christopher Alexander Stein
  2005-01-12 16:57 ` [Caml-list] " Damien Doligez
  0 siblings, 1 reply; 2+ messages in thread
From: Christopher Alexander Stein @ 2005-01-10 21:41 UTC (permalink / raw)
  To: caml-list


Hi,

I am building a custom unstripped ELF executable that contains
the Caml runtime. The executable is segfaulting in runtime GC
routines. Can someone suggest how to cross reference these
routines with the corresponding file and line numbers of the Caml
source code so that gcc can tell me where the executable is
segfaulting?

Thank you

Lex

ps: Damien, I have tried using ocamldebug. It looks like an
excellent tool. In particular, it's time travel features are
powerful. However, in this case, it's use is limited by its
disconnected socket-based implementation; the executable
segfaults and the debugger loses contact.


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

* Re: [Caml-list] Caml source line numbers in custom executable
  2005-01-10 21:41 Caml source line numbers in custom executable Christopher Alexander Stein
@ 2005-01-12 16:57 ` Damien Doligez
  0 siblings, 0 replies; 2+ messages in thread
From: Damien Doligez @ 2005-01-12 16:57 UTC (permalink / raw)
  To: caml users

> I am building a custom unstripped ELF executable that contains
> the Caml runtime. The executable is segfaulting in runtime GC
> routines. Can someone suggest how to cross reference these
> routines with the corresponding file and line numbers of the Caml
> source code so that gcc can tell me where the executable is
> segfaulting?

The GC routines are not in your Caml source code.  And most of the
time, a crash in the GC is caused by a bug somewhere else that
destroys some pointer.

If you really want to know where the crash occurs in your program,
you should get a stack backtrace from the core dump, using normal
Unix tools.  If you want debug information (symbols) in a
ocamlopt-compiled program, you can build libasmrund.a (in the
asmrun directory of the Ocaml sources) and use it instead of
libasmrun.a.

Unfortunately, these techniques are usually not very useful in
finding the bug.


> ps: Damien, I have tried using ocamldebug. It looks like an
> excellent tool. In particular, it's time travel features are
> powerful. However, in this case, it's use is limited by its
> disconnected socket-based implementation; the executable
> segfaults and the debugger loses contact.

Usually, that doesn't prevent the debugger from working: you can
step back from a segfault.  And then you can attach a gcc to the
right process, and use it to debug at the C/assembly level.

-- Damien


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

end of thread, other threads:[~2005-01-12 16:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-10 21:41 Caml source line numbers in custom executable Christopher Alexander Stein
2005-01-12 16:57 ` [Caml-list] " Damien Doligez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).