stacks-network / clarity-wasm

`clar2wasm` is a compiler for generating WebAssembly from Clarity.
GNU General Public License v3.0
12 stars 9 forks source link

OOM issues with `print` #407

Open Acaccia opened 1 month ago

Acaccia commented 1 month ago

The print function SIP5-serializes the value it wants to print to pass it to a host function. But if this value is big enough, it might cause OOM issues, because we don't count the serialized bytes in the computation for the number of pages to allocate.

Example of a Clarity snippet that provokes the issue:

(print "aaaaaaa...") ;; 65535 * 'a'