Tarantool development patches archive
 help / color / mirror / Atom feed
From: Igor Munkin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Kaplun <skaplun@tarantool.org>,
	Sergey Bronnikov <sergeyb@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH luajit v2 2/5] memprof: remove invalid assertions
Date: Fri, 21 Jul 2023 08:12:05 +0000	[thread overview]
Message-ID: <4f1b53eae2355844a92444570d79761db44fa622.1689925402.git.imun@tarantool.org> (raw)
In-Reply-To: <cover.1689925402.git.imun@tarantool.org>

The assertions checking the state of the allocator, being replaced by
memory profiler, against NULL can fail if this allocator requires no
internal state (e.g. glibc functions for allocating dynamic memory). In
fact, when building LuaJIT with LUAJIT_USE_SYSMALLOC option enabled,
NULL is given as the second parameter to <lua_newstate> and these
assertions fail as a result. Hence, they are simply removed.

Follows up tarantool/tarantool#5442
Needed for tarantool/tarantool#5878

Signed-off-by: Igor Munkin <imun@tarantool.org>
---
 src/lj_memprof.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/lj_memprof.c b/src/lj_memprof.c
index 8cab8204..c600c4f0 100644
--- a/src/lj_memprof.c
+++ b/src/lj_memprof.c
@@ -295,7 +295,6 @@ int lj_memprof_start(struct lua_State *L, const struct lj_memprof_options *opt)
   oalloc->allocf = lua_getallocf(L, &oalloc->state);
   lua_assert(oalloc->allocf != NULL);
   lua_assert(oalloc->allocf != memprof_allocf);
-  lua_assert(oalloc->state != NULL);
   lua_setallocf(L, memprof_allocf, oalloc->state);
 
   return PROFILE_SUCCESS;
@@ -328,7 +327,6 @@ int lj_memprof_stop(struct lua_State *L)
 
   lua_assert(memprof_allocf == lua_getallocf(L, NULL));
   lua_assert(oalloc->allocf != NULL);
-  lua_assert(oalloc->state != NULL);
   lua_setallocf(L, oalloc->allocf, oalloc->state);
 
   if (LJ_UNLIKELY(lj_wbuf_test_flag(out, STREAM_STOP))) {
-- 
2.30.2


  parent reply	other threads:[~2023-07-21  8:24 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-21  8:12 [Tarantool-patches] [PATCH luajit v2 0/5] Add ASan support in LuaJIT Igor Munkin via Tarantool-patches
2023-07-21  8:12 ` [Tarantool-patches] [PATCH luajit v2 1/5] ci: clean up workflow for exotic builds Igor Munkin via Tarantool-patches
2023-07-24 10:36   ` Sergey Bronnikov via Tarantool-patches
2023-07-26  9:37   ` Sergey Kaplun via Tarantool-patches
2023-07-21  8:12 ` Igor Munkin via Tarantool-patches [this message]
2023-07-24 10:46   ` [Tarantool-patches] [PATCH luajit v2 2/5] memprof: remove invalid assertions Sergey Bronnikov via Tarantool-patches
2023-07-26  9:41   ` Sergey Kaplun via Tarantool-patches
2023-07-21  8:12 ` [Tarantool-patches] [PATCH luajit v2 3/5] test: introduce test:done TAP helper Igor Munkin via Tarantool-patches
2023-07-24 10:53   ` Sergey Bronnikov via Tarantool-patches
2023-07-26 10:43   ` Sergey Kaplun via Tarantool-patches
2023-07-26 12:42     ` Igor Munkin via Tarantool-patches
2023-07-21  8:12 ` [Tarantool-patches] [PATCH luajit v2 4/5] build: introduce LUAJIT_USE_ASAN option Igor Munkin via Tarantool-patches
2023-07-24 11:41   ` Sergey Bronnikov via Tarantool-patches
2023-07-26 13:06     ` Igor Munkin via Tarantool-patches
2023-07-25 12:26   ` Sergey Bronnikov via Tarantool-patches
2023-07-26 12:54     ` Igor Munkin via Tarantool-patches
2023-07-27 11:06       ` Sergey Bronnikov via Tarantool-patches
2023-07-26 11:03   ` Sergey Kaplun via Tarantool-patches
2023-07-21  8:12 ` [Tarantool-patches] [PATCH luajit v2 5/5] ci: introduce testing workflow with sanitizers Igor Munkin via Tarantool-patches
2023-07-24 11:54   ` Sergey Bronnikov via Tarantool-patches
2023-07-26 14:53     ` Igor Munkin via Tarantool-patches
2023-07-27 11:13       ` Sergey Bronnikov via Tarantool-patches
2023-07-26 11:29   ` Sergey Kaplun via Tarantool-patches
2023-07-26 16:35     ` Igor Munkin via Tarantool-patches
2023-08-03  7:31 ` [Tarantool-patches] [PATCH luajit v2 0/5] Add ASan support in LuaJIT 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=4f1b53eae2355844a92444570d79761db44fa622.1689925402.git.imun@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imun@tarantool.org \
    --cc=sergeyb@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit v2 2/5] memprof: remove invalid assertions' \
    /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