[M3devel] awful race condition in libm3/FilePosix.m3?

Darko darko at darko.org
Sat Feb 2 09:19:44 CET 2013


I agree with Mika's use of style, but it isn't really affected by the proposed change. I've always thought the notion that the compiler would ever initialize a reference to a value other than Nil unconvincing. The exception would be TEXT references. Then there might be others in the future. The argument for keeping the definition as it is is that it's simple.

On Feb 1, 2013, at 10:16 PM, mika at async.caltech.edu wrote:

> "Rodney M. Bates" writes:
> ...
>> I would expect this to crash because m would be default initialized to NIL,
>> which when dereferenced, would show up as a segfault, in any M3 implementation
>> I have experience with.
>> 
>> Actually, the language only says it has to be initialized to a bit
>> pattern that represents some member of the type.  But for or any reference
>> type, the only sensible choice for a compiler to make would be NIL.
>> 
>> Perhaps we should change the language to say this explicitly?  I am
>> very confident it wouldn't undermine either any existing code or compiler,
>> and might save some grief in the future.
> ...
> 
> The only problem with this proposal is that to me, as a human,
> 
> VAR m : MUTEX := NIL;
> 
> ...
> 
> today means something different from
> 
> VAR m : MUTEX;
> 
> notwithstanding the fact that the compiler may implement them the same way.
> 
>     Mika
> 




More information about the M3devel mailing list