[Oberon] PO: Illegal memory access in GC

Andreas Pirklbauer andreas_pirklbauer at yahoo.com
Fri May 15 12:18:16 CEST 2020


    > The reason for the illegal memory read lies within the
    > garbage collector in module Kernel.Mod.
    >
    >   WHILE pvadr # 0 DO
    >      SYSTEM.GET(pvadr, p); SYSTEM.GET(p-4, offadr);
    >       IF (p >= heapOrg) & (offadr = 0) THEN …
    >
    >  [...]
    >
    > IF offset # -1 THEN (*down*)
    > SYSTEM.GET(pos+offset, r); SYSTEM.GET(r-4, offadr);
    >   IF (r >= heapOrg) & (offadr = 0) THEN ...
    >
    > As soon as I inserted the tests, the illegal access
    > was gone and Extended Oberon was running.

I thought I had fixed this several years ago, but apparently the change
didn’t make it to the official version. This vexes me. I have now made an
update. The two code fragments in Extended Oberon now read:

    WHILE pvadr # 0 DO SYSTEM.GET(pvadr, p);
      IF p >= heapOrg THEN SYSTEM.GET(p-4, offadr);
         ...

   IF offset # -1 THEN (*down*)
     SYSTEM.GET(pos+offset, r);
     IF r >= heapOrg THEN SYSTEM.GET(r-4, offadr);
       IF offadr = 0 THEN SYSTEM.PUT(pos+offset, q); q := p; p := r END
     END

Can you please try again with the latest version on Github?







More information about the Oberon mailing list