Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Maxim Kokryashkin <m.kokryashkin@tarantool.org>,
	Igor Munkin <imun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit] Ensure correct stack top for OOM error message.
Date: Thu, 10 Nov 2022 09:02:40 +0300	[thread overview]
Message-ID: <Y2yUAHUcjz6HIjJQ@root> (raw)
In-Reply-To: <20221109174948.10952-1-skaplun@tarantool.org>

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

  reply	other threads:[~2022-11-10  6:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09 17:49 Sergey Kaplun via Tarantool-patches
2022-11-10  6:02 ` Sergey Kaplun via Tarantool-patches [this message]
2022-11-11  8:53 ` Igor Munkin via Tarantool-patches
2022-11-11 12:18   ` Sergey Kaplun via Tarantool-patches
2022-11-11 13:09     ` Sergey Kaplun via Tarantool-patches
2022-11-16 12:30       ` Maxim Kokryashkin via Tarantool-patches
2022-11-22 17:08       ` Igor Munkin via Tarantool-patches
2022-11-23  7:51 ` Igor Munkin via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y2yUAHUcjz6HIjJQ@root \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imun@tarantool.org \
    --cc=m.kokryashkin@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit] Ensure correct stack top for OOM error message.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox