From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id D24C36EC5B; Fri, 14 May 2021 13:19:52 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D24C36EC5B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1620987592; bh=hba0g2bD0RHqrviYBOUXFrYCGrsiKDMBMSD+owhrRMQ=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=Xn5gOd6eDXqkhHeNydnBWv5OgrpnEDYC5z1+UdhjW5DfLWMNUi0JAg/DT6dnX5hGP Vjb+qAkzh7rPJViPFLzJHHaL5GqziLIC7k78n9n8cgaos+WlA27DYxQhCsPaV2WcKm VVPQn59ozJmp4Dj310FhrQJWJJ2lhkQnZFyDwOEE= Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id B4EC66EC5B for ; Fri, 14 May 2021 13:19:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B4EC66EC5B Received: by mail-lf1-f41.google.com with SMTP id t11so42336094lfl.11 for ; Fri, 14 May 2021 03:19:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=T2N2qZ9TqxB/gEiXD5fQEIIOq/kLMPTfcMMZFMb+1j4=; b=HlbPeAR0Z1GzxvF4Bueu5ZIFiisu+Tp2bsJsHc9yYE2YHmNN2m6f5VbMEgrO6BHdO8 VmEbcCL2LYxEp0qRM5unz4eNQMwCvZU3j5i6Ka6OJ7hFn3C9JnKrM7i93Qve380rI5eE tKDZU3rDnG5pzaQCV81flRniuskAu18C8aufNASiysgc3+sJHn3opqNJw4+wUiq94/zz c8x09ZpMOpoo5uLVFAGZrX3v4xw4eQJ9heNWdxI9lCM2kOBsHBNehqOJVgza9Za97YXb UdzvQsPUAq1szVUw7sG/2k1eJ4gPLS5xAz4ZXgirExr4EE8L6wGhrbEy50c2UzuXgJKK ubWA== X-Gm-Message-State: AOAM530+s/JjwpmG0KfZQHn5khvDu+emlITFteR6PxAJgr8nTVJTdevk gcJAIKGbBjMNNU/8QP3wxa4BUEENdlQ= X-Google-Smtp-Source: ABdhPJxfGG/EWdJ/xlVOTwPm2dJ8ftlHJmcQ9mxVF2I+H/X8i3ml5gQNgpkYhraHXGiFgZVWt00JGw== X-Received: by 2002:a19:a418:: with SMTP id q24mr31046994lfc.649.1620987590728; Fri, 14 May 2021 03:19:50 -0700 (PDT) Received: from grain.localdomain ([5.18.171.94]) by smtp.gmail.com with ESMTPSA id d19sm571105lfi.256.2021.05.14.03.19.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 03:19:49 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id D8D655A003D; Fri, 14 May 2021 13:19:48 +0300 (MSK) To: tml Date: Fri, 14 May 2021 13:19:47 +0300 Message-Id: <20210514101947.106581-1-gorcunov@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH] lua/utils: fix fiber->fid print in Lua tracing X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Cyrill Gorcunov via Tarantool-patches Reply-To: Cyrill Gorcunov Cc: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This fixes a nit in commit 6af473778 (fiber: use uint64_t for fiber IDs). Since lua_pushfstring doesn't support %llu format it breaks the test app-tap/gh-1700-abort-recording-on-fiber-switch.test.lua Signed-off-by: Cyrill Gorcunov --- branch gorcunov/gh-5846-fid-name-fix src/lua/utils.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lua/utils.c b/src/lua/utils.c index 0fbe700fc..6e5b6e8e8 100644 --- a/src/lua/utils.c +++ b/src/lua/utils.c @@ -1341,6 +1341,7 @@ void cord_on_yield(void) * code misbehaviour and failures, so stop its execution. */ if (unlikely(tvref(g->jit_base))) { + char buf[256]; /* * XXX: mcode is executed only in scope of Lua * world and one can obtain the corresponding Lua @@ -1348,10 +1349,12 @@ void cord_on_yield(void) */ struct lua_State *L = fiber()->storage.lua.stack; assert(L != NULL); - lua_pushfstring(L, "fiber %llu is switched while running the" - " compiled code (it's likely a function with" - " a yield underneath called via LuaJIT FFI)", - (long long)fiber()->fid); + snprintf(buf, sizeof(buf), + "fiber %llu is switched while running the" + " compiled code (it's likely a function with" + " a yield underneath called via LuaJIT FFI)", + (long long)fiber()->fid); + lua_pushstring(L, buf); if (g->panic) g->panic(L); exit(EXIT_FAILURE); -- 2.31.1