caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Damien Doligez <damien.doligez@inria.fr>
To: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Caml source line numbers in custom executable
Date: Wed, 12 Jan 2005 17:57:15 +0100	[thread overview]
Message-ID: <02D1F0C8-64BB-11D9-B72B-000D9345235C@inria.fr> (raw)
In-Reply-To: <20050110164053.L50586@bowser.eecs.harvard.edu>

> 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


      reply	other threads:[~2005-01-12 16:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-10 21:41 Christopher Alexander Stein
2005-01-12 16:57 ` Damien Doligez [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=02D1F0C8-64BB-11D9-B72B-000D9345235C@inria.fr \
    --to=damien.doligez@inria.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).