[Tarantool-patches] [PATCH luajit] Correctly close VM state after early OOM during open.

Sergey Kaplun skaplun at tarantool.org
Tue Sep 9 12:44:05 MSK 2025


Hi, Sergey!
Thanks for the review!
Fixed your comment and force-pushed the branch.

On 09.09.25, Sergey Bronnikov wrote:
> Hi, Sergey,
> 
> thanks for the patch! LGTM with a minor comment.
> 
> Sergey
> 
> On 8/19/25 10:40, Sergey Kaplun wrote:

<snipped>

> > +	/*
> > +	 * Check that there is no crash and the limit is small enough.
> > +	 */
> > +	lua_State *L = lua_newstate(limited_alloc_f, NULL);
> s/lua_State/const lua_State/

Fixed, thanks!

===================================================================
diff --git a/test/tarantool-c-tests/lj-1248-close-state-early-OOM.test.c b/test/tarantool-c-tests/lj-1248-close-state-early-OOM.test.c
index 6c9cb2ca..fe91d5e9 100644
--- a/test/tarantool-c-tests/lj-1248-close-state-early-OOM.test.c
+++ b/test/tarantool-c-tests/lj-1248-close-state-early-OOM.test.c
@@ -49,7 +49,7 @@ static int limited_memory_on_lua_newstate(void *test_state)
         /*
          * Check that there is no crash and the limit is small enough.
          */
-        lua_State *L = lua_newstate(limited_alloc_f, NULL);
+        const lua_State *L = lua_newstate(limited_alloc_f, NULL);
         assert_true(L == NULL);
         return TEST_EXIT_SUCCESS;
 #endif
===================================================================

> > +	assert_true(L == NULL);
> > +	return TEST_EXIT_SUCCESS;
> > +#endif
> > +}
> > +
> > +#ifndef LJ_NO_UNWIND
> > +#  define LJ_NO_UNWIND 0
> > +#endif
> > +
> > +int main(void)
> > +{
> > +	/* Seehttps://github.com/LuaJIT/LuaJIT/issues/1311. */
> > +	if (!LJ_NO_UNWIND)
> > +		return skip_all("Disabled for external unwinding build due to #1311");
> > +	const struct test_unit tgroup[] = {
> > +		test_unit_def(limited_memory_on_lua_newstate),
> > +	};
> > +	return test_run_group(tgroup, NULL);
> > +}

-- 
Best regards,
Sergey Kaplun


More information about the Tarantool-patches mailing list