Google Groups Home
Help | Sign in
Segfault in caml_oldify_local_roots.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
David Brown  
View profile
 More options Aug 31 2006, 2:45 am
Newsgroups: fa.caml
From: David Brown <caml-li...@davidb.org>
Date: Thu, 31 Aug 2006 06:45:18 UTC
Local: Thurs, Aug 31 2006 2:45 am
Subject: [Caml-list] Segfault in caml_oldify_local_roots.
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.
  [Switching to Thread -1210538320 (LWP 24659)]
  0x08059c60 in caml_oldify_local_roots () at roots.c:52
  52              caml_oldify_one (*sp, sp);
  (gdb) p sp
  $1 = (value *) 0x1
  (gdb) bt
  #0  0x08059c60 in caml_oldify_local_roots () at roots.c:52
  #1  0x080729f9 in caml_empty_minor_heap () at minor_gc.c:189
  #2  0x08072b00 in caml_minor_collection () at minor_gc.c:222
  #3  0x08059890 in caml_alloc_string (len=10) at alloc.c:77
  #4  0x0805df53 in caml_create_string (len=21) at str.c:50
  #5  0x0806e802 in caml_interprete (prog=0x80aa520, prog_size=125072)
      at interp.c:863
  #6  0x0807064b in caml_main (argv=0xbfb95954) at startup.c:414
  #7  0x0805882f in main (argc=3, argv=0xbfb95954) at main.c:35

I don't see any obvious problems in either binding and was wondering if
anyone has seen anything like this?

Thanks,
David Brown

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Brown  
View profile
 More options Aug 31 2006, 4:39 am
Newsgroups: fa.caml
From: David Brown <caml-li...@davidb.org>
Date: Thu, 31 Aug 2006 08:39:35 UTC
Local: Thurs, Aug 31 2006 4:39 am
Subject: Re: [Caml-list] Segfault in caml_oldify_local_roots.

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

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Markus Mottl  
View profile
 More options Aug 31 2006, 4:17 pm
Newsgroups: fa.caml
From: "Markus Mottl" <markus.mo...@gmail.com>
Date: Thu, 31 Aug 2006 20:17:18 UTC
Local: Thurs, Aug 31 2006 4:17 pm
Subject: Re: [Caml-list] Segfault in caml_oldify_local_roots.
On 8/31/06, David Brown <caml-li...@davidb.org> wrote:

> 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.

This is a known bug which is fixed in the current CVS-release:

  http://caml.inria.fr/mantis/view.php?id=4039

Normally, closing an already closed channel a second time should not
cause any problems.

Regards,
Markus

--
Markus Mottl        http://www.ocaml.info        markus.mo...@gmail.com

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google