caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Brown <caml-list2@davidb.org>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Segfault in caml_oldify_local_roots.
Date: Thu, 31 Aug 2006 01:33:53 -0700	[thread overview]
Message-ID: <44F69EF1.5000702@davidb.org> (raw)
In-Reply-To: <44F68278.5060903@davidb.org>

David Brown wrote:

 > Just wondering if anyone has any ideas on how I might debug this.  The
 > problem happens with ocaml-3.09.2, and doesn't with 3.08.3.  The program
 > uses camlzip as well as the sha1 binding pulled out of Xavier's 
cryptokit.
 >
 >  Program received signal SIGSEGV, Segmentation fault.
 >  52              caml_oldify_one (*sp, sp);

I found the problem, in how I was using the Gzip module.  I was doing
something like:

  let fd = open_out_bin ... in
  let zfd = Gzip.open_out_chan fd in
  ...
  Gzip.close_out zfd;
  close_out fd

Turns out that if I'd read it more carefully, I should have realized that
Gzip.close_out will also close the underlying handle.  Apparently calling
close_out twice on the same handle messes things up enough to segfault the
garbage collector.

Dave Brown


  reply	other threads:[~2006-08-31  8:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-31  6:32 David Brown
2006-08-31  8:33 ` David Brown [this message]
2006-08-31 20:11   ` [Caml-list] " Markus Mottl

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=44F69EF1.5000702@davidb.org \
    --to=caml-list2@davidb.org \
    --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).