Hi Thomas,
Is your system multithreaded? If not, perhaps the object, when
a clone of a expanded object, is not correctly protected against
garbage collection. That's what comes to my mind to explain the
randomness of this problem.
I remember giving it a try on my computer last year (using your
application directly), but never managed to reproduce it.
If I remember correctly you were using mingw as back-end C compiler
whereas I was using microsoft C compiler.
> Thomas Beale <
wolan...@gmail.com <javascript:>>:
>
>
> I've asked this question various times over the years, but what
> the compiler and runtime do changes, so I'll ask it again...
>
> The following code executes in the debugger:
>
>
> create prim_obj.make(eif_fld_val)
>
> --definition of the relevant call
> classPRIMITIVE_OBJECT
> make(a_val:like value)
> do
> value :=a_val
> end
>
> value:ANY
> end
>
>
>
> At runtime, the 'a_val' is a BOOLEAN in one case, and it shows
> like this in the object tool.
>
> <
https://lh3.googleusercontent.com/-K8SAwCBOKTs/WjEp7Sq_o_I/AAAAAAAAA4E/Ii4dHbcv6vgKz0QljY8H-hkmswHmS5ybgCLcBGAs/s1600/ES-bool-objects.png>
>
>
>
> Which is odd for a BOOLEAN, but not for a BOOLEAN_REF
> (presumably that's how a BOOLEAN_REF displays).
>
> Anyway, this value / object is passed to the make routine above.
> It doesn't complain, but it doesn't set the value field - not to
> a BOOLEAN, nor a BOOLEAN_REF.
>
> The execution dies on the following call:
>
> check attached prim_obj.value end
>
> Which is expected, given the assignment failed. However, it
> normally works, which makes me think its either
> non-deterministic, or it depends on the version of the compiler
> or some library detail.
>
> There seems to be a problem in the compiling and runtime
> handling here, since there was no complaint in the call to
> make(), but the value did not get attached. I think all expanded
> value objects (BOOLEAN, INTEGER etc) should silently convert
> back and forth to their XX_REF form, as appears to be the case
> according to the debugger above. But it seems not to have worked
> properly - the debugger is probably showing 'BOOLEAN' in the
> 'eif_fld_val' row due to the dynamic type being set to the value
> for BOOLEAN, not BOOLEAN_REF< but in fact the object appears to
> be a BOOLEAN_REF.
>
> The following two statements both generate a type id of 2250 for
> this BOOLEAN object and the field in its parent object (but I
> think from memory, these values are build-dependent, not universal).
>
> fld_att_dyn_tid :=attached_type (dynamic_type (eif_fld_val))
> fld_static_tid :=field_static_type_of_type (i,dynamic_type (an_obj))
>
>
> Any thoughts on what is going on here?
>
> - thomas
>
>