Changeset 10808


Ignore:
Timestamp:
Sep 19, 2008, 7:48:02 AM (11 years ago)
Author:
gb
Message:

Can we start a c-haters mailing list ? Probably not a good idea:
our mail server may not be able to keep up with the traffic it
would generate.

When computing the mask used to clear extra bits on entry to
mark_memoized_area(), use the constant NATURAL1, not 1L. 1L
is a 'long', which isn't the same as a 'natural' on Win64,
and the use of 'long' (32-bit) constants here causes the
compiler to do 32-bit arithmetic and sign-extend the result.
That can either fail to clear bits or cause bits to be
erroneously cleared in the last word of the refbits vector,
and either behavior can be very, very bad.

This may not be the last such bug, but this seems to be a major
source of the "weird C behavior affecting GC on Win64" for the
last several months.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/x86-gc.c

    r10565 r10808  
    11101110
    11111111    if (bits_in_last_word != 0) {
    1112       natural mask = ~((1L<<(nbits_in_word-bits_in_last_word))-1L);
     1112      natural mask = ~((NATURAL1<<(nbits_in_word-bits_in_last_word))- NATURAL1);
    11131113      refbits[index_of_last_word] &= mask;
    11141114    }
Note: See TracChangeset for help on using the changeset viewer.