[M3devel] open array allocation problem?

Rodney M. Bates rodney_bates at lcwb.coop
Fri Aug 19 00:49:17 CEST 2011



On 08/18/2011 02:48 AM, Dragiša Durić wrote:
> It happens with same code on three platforms and two versions... I can
> send you my source to try to debug it - m3gdb frustrates me a lot these
> days...
>
> Is it working at all? Or maybe on some of my platforms it is worth a
> try? (m3gdb)

It works to a considerable extent for me when compiling using the release
compiler, on LINUXLIBC6 and AMD64_LINUX.  The head compiler just about
completely breaks m3gdb.  Someone took all the types out of the generated
debug information and it cripples m3gdb.  I have been planning to put it
back in "real soon" for some time.

With the head compiler, there are still entirely too many bugs and things
not implemented, but a lot works.  Especially, method and procedure calls
typed in m3gdb commands mostly work, which opens up a lot of possibilities,
e.g., calling a no-side-effects procedure again that you stopped just after
and want to know what happened inside it.

Also, you call type calls on lots of procedures in the RTS.  You could, for
example, call OpenArraySize, which looks like a pure function, lots of times,
with varying parameters.  Sort of a limited Modula-3 interpreter.

Of course, you need to have compiled the RTS with debug info to do very much
meaningful breaking/stepping, etc. inside the procedure you call.  Even without,
you can see if it crashes or what value it returns.

>
> TIA,
> dd
>
> On Wed, 2011-08-17 at 15:04 -0400, Tony Hosking wrote:
>> That suggests a corrupted heap of some kind.
>> How could an open array ever have negative size?
>>
>>
>> On Aug 17, 2011, at 1:05 PM, Dragiša Durić wrote:
>>
>>> This one keeps happening, on 5.8.6-REL and 5.9.0 both, on LINUXLIBC6, AMD64_DARWIN and AMD64_LINUX. Not at same pint, but same place in RTCollector.
>>>
>>> ***
>>> *** runtime error:
>>> ***    An enumeration or subrange value was out of range.
>>> ***    file "../src/runtime/common/RTCollector.m3", line 330
>>> ***
>>> VAR
>>>    res: INTEGER;
>>>    sizes: UNTRACED REF INTEGER := h + ADRSIZE(Header) + ADRSIZE(ADDRESS);
>>>                                                         (* ^ elt pointer*)
>>> BEGIN
>>>    res := 1;
>>>    FOR i := 0 TO adef.nDimensions - 1 DO
>>>      res := res * sizes^;
>>>      INC(sizes, ADRSIZE(sizes^));
>>>    END;
>>>    res := res * adef.elementSize;
>>>    res := RTMisc.Upper(res + adef.common.dataSize, BYTESIZE(Header));
>>>    RETURN res; (* line 330 *)
>>> END OpenArraySize;
>>>
>>> OpenArraySize procedure type is CARDINAL, if it is important in any way.
>>>
>>> TIA,
>>> dd
>>>
>>
>



More information about the M3devel mailing list