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

On Fri, Feb 24, 2017 at 08:43:38AM -0500, Arlen Cox wrote:
> > ?  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.

OK I see - I knew this but didn't know if it applied to
NULL pointers too.

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

Thanks (and also to Gerd's response).

Rich.

-- 
Richard Jones

  reply	other threads:[~2017-02-24 13:59 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
2017-02-24 13:58   ` Richard W.M. Jones [this message]
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=20170224135852.GJ28111@annexia.org \
    --to=rich@annexia.org \
    --cc=arlencox@gmail.com \
    --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).