all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: Christopher Lemmer Webber <cwebber@dustycloud.org>
Cc: 30603@debbugs.gnu.org
Subject: [bug#30603] Upgrade Racket to 6.12
Date: Tue, 6 Mar 2018 10:07:55 +0100	[thread overview]
Message-ID: <20180306100755.632cadc0@scratchpost.org> (raw)
In-Reply-To: <87h8puquih.fsf@dustycloud.org>

[-- Attachment #1: Type: text/plain, Size: 1657 bytes --]

Hi Christopher,

I don't know how Racket does it but I wrote my own interpreters with GC and there,
you have to know where references to objects can be found.

In this case the references can be on the stack of the C functions as long as
they are running.

It turns out that in the version of gcc we use to compile racket, the sign checker
for 128 bit floats (__signbitf128) is not a builtin (it's not emitting just an immediate
assembly instruction) but rather is a C function - but the caller in Racket is marked
as "don't bother looking for object references in there".  As Racket supports
arbitrary-precision numbers, a number might be an object and a part of that object
might have been passed to __signbitf128.  If the GC runs, it might be killing
that object while it's still used inside __signbitf128 (in a loop or something).

So the possible fixes are:

(1) Do not use __signbitf128 (that is, "signbit") - there's a fallback which uses
primitive operations that are guaranteed to be builtin (/).  That's the non-invasive
very safe change (s|MZ_IS_NEG_ZERO|MZ_IS_NEG_ZERO_DONOTUSE| at one place) - since
from the outside the function would look exactly the same as if it used
__signbitf128 - it's a leaf.

(2) Remove the nogcing marker.  That's the more invasive change which slightly
changes how the GC root set looks - it should be safe enough anyway (if there
are no bugs in the GC root set lookup :) )

(3) Use gcc-7.  Given that Racket users probably use FFI to load other C libraries
which aren't compiled with gcc-7, let's not do that.

Please note that I didn't write Racket so take it with a grain of salt.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2018-03-06  9:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-25  5:42 [bug#30603] Upgrade Racket to 6.12 Christopher Lemmer Webber
2018-02-26  1:19 ` Marius Bakke
2018-02-26  4:16   ` Danny Milosavljevic
2018-02-26 16:33     ` Christopher Lemmer Webber
2018-03-05 17:54       ` Christopher Lemmer Webber
2018-03-06  9:07         ` Danny Milosavljevic [this message]
2018-04-01 13:42 ` Christopher Lemmer Webber
2018-04-01 21:11   ` Danny Milosavljevic

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=20180306100755.632cadc0@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=30603@debbugs.gnu.org \
    --cc=cwebber@dustycloud.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.