[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#28211: Grafting code triggers GC/thread-safety issue on Guile 2.2.2
From: |
Mark H Weaver |
Subject: |
bug#28211: Grafting code triggers GC/thread-safety issue on Guile 2.2.2 |
Date: |
Thu, 10 May 2018 02:50:32 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Hi Andy,
Andy Wingo <address@hidden> writes:
> On Wed 09 May 2018 02:32, Mark H Weaver <address@hidden> writes:
>
>> However, I think it's _far_ more likely that the NULL argument on the
>> stack was copied from memory shared by multiple threads without proper
>> thread synchronization.
>
> I think this is unlikely on x86 given its total-store-ordering memory
> model. I agree with you about the value of barriers, but I don't think
> they are part of this bug that Ludo is seeing.
I think you're forgetting about the C compiler. It's true that x86
machine code has a TSO memory model, but C does not. In the absence of
barriers, the C compiler may freely reorder stores to non-volatile,
non-atomic objects. In particular, it is free to reorder the
initialization of an object with the write of that object's address.
I admit that I haven't checked whether GCC 5.5.0 does this in practice.
Do you have reason to believe that it never does so?
Thanks,
Mark