[Tarantool-patches] [PATCH luajit] Ensure correct stack top for OOM error message.

Sergey Kaplun skaplun at tarantool.org
Thu Nov 10 09:02:40 MSK 2022


Hi, again!

On 09.11.22, Sergey Kaplun wrote:
> From: Mike Pall <mike>

<snipped>

> +
> +-- Avoid OOM on traces.
> +jit.off()
> +
> +-- Stack slots are needed for coredump in case of misbehaviour.
> +-- luacheck: no unused
> +local r, e = pcall(eat_chunks, 8 * MB)
> +collectgarbage()
> +pcall(eat_chunks, 8 * KB)
> +collectgarbage()
> +pcall(eat_chunks, 8)
> +collectgarbage()

Forgot that `collectgarbage()` (`full_gc()`) enables GC. Fixed. Branch
is force-pushed.

===================================================================
diff --git a/test/tarantool-tests/lj-906-fix-err-mem.test.lua b/test/tarantool-tests/lj-906-fix-err-mem.test.lua
index a139e1c9..f512e802 100644
--- a/test/tarantool-tests/lj-906-fix-err-mem.test.lua
+++ b/test/tarantool-tests/lj-906-fix-err-mem.test.lua
@@ -74,10 +74,13 @@ jit.off()
 -- luacheck: no unused
 local r, e = pcall(eat_chunks, 8 * MB)
 collectgarbage()
+collectgarbage('stop')
 pcall(eat_chunks, 8 * KB)
 collectgarbage()
+collectgarbage('stop')
 pcall(eat_chunks, 8)
 collectgarbage()
+collectgarbage('stop')
 
 pcall(frame_before_TDUP)
 
===================================================================

> +
> +pcall(frame_before_TDUP)
> +
> +-- Release memory for `tap` functions.
> +gc_anchor = nil
> +collectgarbage()
> +
> +test:ok(true, 'correctly throw memory error')
> +
> +os.exit(test:check() and 0 or 1)
> -- 
> 2.34.1
> 

-- 
Best regards,
Sergey Kaplun


More information about the Tarantool-patches mailing list