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 C548BD49AF2; Thu, 22 Aug 2024 21:15:47 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C548BD49AF2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1724350547; bh=0wvw48H+Ws9+vfUlyPFUCL7ie7SimmfHiTwIk1X7r+E=; h=To:Cc:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=yIuB3+vgF9wU4lRd+jug5y3CX5X7BpUi8nui0pPoqV0dj/6MYT3REH2z0HKWEHtBn lEdniIF+3whIGRghMoQqELUMhjGv3peuSUJhZigkGogh2A8pv9evisrhPzibU+6wMo IIla9N3W+vmAHquKybFFTAOYPWPoGENdNq3J1FNE= Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (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 E499F4AA35A for ; Thu, 22 Aug 2024 21:15:45 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E499F4AA35A Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-533488ffb03so1540091e87.3 for ; Thu, 22 Aug 2024 11:15:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724350545; x=1724955345; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UyMc5j1ceEnaBqKBz8NYrn2YUOUJcXd6sL/qk8S64yU=; b=KwpzwCCjfDmmzmljOKScyqejkzRNyAKpNnhVuxgk3OUoeFTpQz3Sl6qIoaCV9fQg/P aFilxtH1DRXr2yK/88TpdXB4jPXQxPym9fZUA0Ov8n/GFQHBuDdQm3qktF3HmdPS4gBK gI6Iat+R+7zRCI47AhujHuknOZi0QurttCfK/iUGDNwG6Aogl3+x1244HOiRjumcNMx4 MhROm2EIau77m/hLooD3CKnBqWqAzYVsBG6ACIGHXA4K7Pb+0dZCu1jxPo1K5vg2UIBy ROg1WbY+SPZX+pbi2Bhr4/bJ6SA1q8nB0b+WCFF8NdgMBb19pJFy185DbiV1t3N4NvKN GgDQ== X-Gm-Message-State: AOJu0YwJQkE9YgLov/ZAtFqEl2Av0lpqIPd63+RjWTSpoKfIaiJ9+5kT LkLWEbe42yC/4ICJ6JIQmsAmqlPkFNkB7Saop4szTdcEYQ7a0MuUYXf6gX1AtM4= X-Google-Smtp-Source: AGHT+IFtms/tHQAlfvF+e5HLGkOeKIwtJydM5ccQxWZEEHH0bVICXyEN7lXpnim6tTfG6zGsDI8Uqg== X-Received: by 2002:a05:6512:3b0f:b0:533:4652:983a with SMTP id 2adb3069b0e04-5334fcf7f0cmr2212682e87.35.1724350544173; Thu, 22 Aug 2024 11:15:44 -0700 (PDT) Received: from mandesero.. ([95.153.162.123]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5334ea88e53sm321988e87.269.2024.08.22.11.15.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Aug 2024 11:15:43 -0700 (PDT) To: tarantool-patches@dev.tarantool.org, skaplun@tarantool.org, m.kokryashkin@tarantool.org Cc: Maksim Tiushev Date: Thu, 22 Aug 2024 18:15:41 +0000 Message-Id: <20240822181542.482869-1-mandesero@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH luajit 0/1] ASAN & LuaJIT allocator 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: mandesero--- via Tarantool-patches Reply-To: mandesero@gmail.com Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" From: Maksim Tiushev This patch introduces ASAN instrumentation for the internal LuaJIT allocator. Each CI job testing with ASAN now includes two scenarios: testing with the internal LuaJIT allocator and testing with `sysmalloc`. Additionally, certain tests can be disabled using the `LJ_ASAN_HARDENING` environment variable which is useful in cases where a test fails due to time constraints. The ASAN instrumentation of the internal LuaJIT allocator enhances the ability to detect memory handling errors, particularly when utilizing FFI. Branch: https://github.com/tarantool/luajit/tree/mandesero/lj-10231-ASAN-and-LJ-allocator Issue: https://github.com/tarantool/tarantool/issues/10231 Testing the patch with Tarantool: PR: https://github.com/tarantool/tarantool/pull/10232 Maksim Tiushev (1): asan: instrumented LuaJIT memory allocator .github/workflows/sanitizers-testing.yml | 20 +- CMakeLists.txt | 29 +- src/lj_alloc.c | 267 +++++++++++++++++- .../asan-alloc-instrumentation.test.c | 141 +++++++++ .../asan-mmap-instrumentation.test.c | 128 +++++++++ .../ASAN-left-memory-miss.test.lua | 12 + .../ASAN-left-memory-miss/script.lua | 19 ++ .../ASAN-right-memory-miss.test.lua | 12 + .../ASAN-right-memory-miss/script.lua | 19 ++ .../ASAN-use-after-free.test.lua | 12 + .../ASAN-use-after-free/script.lua | 24 ++ test/tarantool-tests/CMakeLists.txt | 2 +- .../lj-1034-tabov-error-frame.test.lua | 2 + 13 files changed, 669 insertions(+), 18 deletions(-) create mode 100644 test/tarantool-c-tests/asan-alloc-instrumentation.test.c create mode 100644 test/tarantool-c-tests/asan-mmap-instrumentation.test.c create mode 100644 test/tarantool-tests/ASAN-left-memory-miss.test.lua create mode 100644 test/tarantool-tests/ASAN-left-memory-miss/script.lua create mode 100644 test/tarantool-tests/ASAN-right-memory-miss.test.lua create mode 100644 test/tarantool-tests/ASAN-right-memory-miss/script.lua create mode 100644 test/tarantool-tests/ASAN-use-after-free.test.lua create mode 100644 test/tarantool-tests/ASAN-use-after-free/script.lua -- 2.34.1