caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Arlen Cox <arlencox@gmail.com>
To: "Richard W.M. Jones" <rich@annexia.org>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Initializing CAMLlocalX values to Val_unit
Date: Fri, 24 Feb 2017 08:43:38 -0500	[thread overview]
Message-ID: <CAHEcMuHT4y0v57pU+3LRv8JuHG3nbMifNxU2j+k2AZkxR4KxOA@mail.gmail.com> (raw)
In-Reply-To: <20170224103818.GI28111@annexia.org>

> ?  Interestingly none of this code has actually crashed in production
> as far as I'm aware.

I'm fairly certain this is because the OCaml runtime checks pointers
to ensure that they're in the OCaml heap before tracing them.  I don't
know how this holds up historically, but last time I looked (4.03)
when tracing, OCaml runs Classify_addr(a) on addresses to determine if
they should be traced into.  Because of this, NULL pointers will not
be followed (and thus not crash) and perhaps more interestingly raw
(naked) pointers that don't point to anything in an OCaml-registered
page will also not be traced.

There is a define related to NAKED_POINTERS that if defined will
improve performance by disabling the check for Is_in_heap(a) (macro
for Classify_addr).  Naked pointer support can be disabled during
configure (--no-naked-pointers) and that may make code that does not
initialize things correctly crash.  Naked pointers are checked in the
default configuration.

Cheers,
Arlen

>
> Rich.
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

  reply	other threads:[~2017-02-24 13:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-24 10:38 Richard W.M. Jones
2017-02-24 13:43 ` Arlen Cox [this message]
2017-02-24 13:58   ` Richard W.M. Jones
2017-02-24 13:50 ` Gerd Stolpmann

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=CAHEcMuHT4y0v57pU+3LRv8JuHG3nbMifNxU2j+k2AZkxR4KxOA@mail.gmail.com \
    --to=arlencox@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=rich@annexia.org \
    /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).