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

mika at async.caltech.edu mika at async.caltech.edu
Sat Feb 2 07:16:18 CET 2013


"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