marekjm / viuavm

Parallel virtual machine designed to reliably run massively concurrent programs
https://viuavm.org/
GNU General Public License v3.0
71 stars 11 forks source link

Memory leak from global registers #89

Closed marekjm closed 8 years ago

marekjm commented 9 years ago

Memory leak of constant size (16 bytes) is introduced when a call frame is dropped when global register set is being used. Following code is sufficient to reproduce the issue:

.function: main
    ress global
    izero 0
    end
.end

Leak does not appear when return values are taken only from local registers.

marekjm commented 9 years ago

Size of the leak seems to increase if (1) the object returned from global register set in a call deeper on the stack reaches main function, and (2) main function local register set; if a deeper call returns from global, and main also returns from global - size of the leak gets back to 16 bytes.

marekjm commented 9 years ago

Temporary workaround: do not return from global registers.

marekjm commented 8 years ago

Looks like the bug was accidentally fixed.