From patchwork Thu Nov 7 06:35:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kito Cheng X-Patchwork-Id: 2007868 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=Nynrilu1; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XkXRb38Kcz1xyS for ; Thu, 7 Nov 2024 17:36:59 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9C288385842D for ; Thu, 7 Nov 2024 06:36:57 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by sourceware.org (Postfix) with ESMTPS id ACBF33858408 for ; Thu, 7 Nov 2024 06:35:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ACBF33858408 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sifive.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ACBF33858408 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::b33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730961361; cv=none; b=wEk6YLzurN2iHBshQzsKMlst/GUU1sFdX4XZn6A9RhzCEgbc+lxiZ+LNhku8DimNlJDGdXRT8OCebyDwiicNp9X84t/bS+tXLYDHEQBskjfk7jS8mGMxQXHQ2IwFjSWruib1NfH4GC2N7IHqhnyJwoxx33xPSDEHCzm5pw5h8/M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730961361; c=relaxed/simple; bh=Hqg/vzSRSphrEzDK5vADrAisMSX+xfSrAOE9/sV/F0c=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=vEQS7U46jkVYrFlHY8xUAT1Wz9Swyscqr9vf9TTXXz0Q8mCxRst3uxT5r8ni/BtYHsAgRw4oaBiDRrXWL+CzloQcG3Lgvx2Lo987lM/U4a09zNRQGhDRKP5S6FkoOsAaGAZuWPjC+acm/R4+JlEXCki+9jLYTzm0MdPXLtZZzvI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yb1-xb33.google.com with SMTP id 3f1490d57ef6-e28fe07e97dso641932276.3 for ; Wed, 06 Nov 2024 22:35:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1730961352; x=1731566152; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sEhsUKZXonoca0CKHsZUPg0r4xdurG65SkYW/E/hD4s=; b=Nynrilu1Uc102ca17uJwODLyeEeIhDB6N3V0JH8W84+qk4AAvw7Q/9hOMZlJspzs05 WtdWr70lDH/VhrGb4xO7MmFzffP1pT0Ls3hpHp8H41qH6X85NGR0mC/0Cn2IrHTQYERw GKXNlU6ZF2Lkmk+bq6Z4zqbpSjX6JhRiogTSIvYpaM3tIvFqwMzY3VabR9LNnv7w2jHd KieR9LjzQm9XEnh51HSBz02NQGOsnIcsdgnXAJjC7BcsKfW8te+nWiV1YDF+14t0agSA U0HHxOX4a2u+HguwWwmuAWSn8Y1OEqfYH7nQYEG2V94cHCUeTr7UtVgYMGkw28HJgKSe F0gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730961352; x=1731566152; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sEhsUKZXonoca0CKHsZUPg0r4xdurG65SkYW/E/hD4s=; b=N8buhBOOLM8kOAQ/yTay/MhbQxzL8ZkIKqh6DeGFXQbP1FhnC5BFwwjZn70jGwTTTb lBd7LtHV/TVdLPa1KfzQHGT0GxI7q8d3ziyRF1qcqrkiG577dnfBG8eb+a1Two4yrui9 OJzNJmVz8f/0frManyHws5egoW9hu7245P4O+1j9TiXq4kapaMDjRUKbL3NwbF90+Wtj IbW8sWhJ7n7M5sih1UKcdgms48euKBefQm9/Q5dKVUJkG2JxZCanLUXN7f+6yOUSHIvZ KydoWgSGP2kzcHNpLmgT0RThuxyczfLarPA2UBRnqkgxsVwxwKgQ3gvNoJYSrQTidjRI VM4w== X-Forwarded-Encrypted: i=1; AJvYcCVt3ROyGWOeaOZL9jW84i2C2BKRDo5tSdYqi1cR74OVeoZ5vgnY33hLDTnOhZbFaMOq77JTy2t0r0LgQA==@gcc.gnu.org X-Gm-Message-State: AOJu0YxgCWM0n04XcEWNAOxrBNzmd202g5InfGeHxblnWSWbZxkvKaHQ DRcn9wgemg60pptld4l7W7/ZeUJEQ0LZi1DmE0yWJhnGV9eLbu8SfRY9BzZp2bA= X-Google-Smtp-Source: AGHT+IFt/pag9/Ex8aney2JdxRvyqA7qA8CHoHL5ET3rWYLq0A1n9eNr6HpuyKj4GEzgUIn5MQwx0g== X-Received: by 2002:a05:6902:1581:b0:e2b:d9d7:9078 with SMTP id 3f1490d57ef6-e330254b1aemr19918846276.3.1730961351981; Wed, 06 Nov 2024 22:35:51 -0800 (PST) Received: from hsinchu18.internal.sifive.com (59-124-168-89.hinet-ip.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7f41f5f048esm510048a12.50.2024.11.06.22.35.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 22:35:51 -0800 (PST) From: Kito Cheng To: Jakub Jelinek , Dodji Seketeli , Dmitry Vyukov , gcc-patches@gcc.gnu.org Cc: Kito Cheng Subject: [PATCH 3/4] libsanitizer: Improve FrameIsInternal Date: Thu, 7 Nov 2024 14:35:37 +0800 Message-Id: <20241107063538.4172543-4-kito.cheng@sifive.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241107063538.4172543-1-kito.cheng@sifive.com> References: <20241107063538.4172543-1-kito.cheng@sifive.com> MIME-Version: 1.0 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org `FrameIsInternal` is a function that improves report quality by filtering out internal functions from the sanitizer, allowing it to point to a more precise root cause. However, the current checks are mostly specific to compiler-rt, so we are adding a few more rules to enhance the filtering for libsanitizer as well. --- .../sanitizer_common/sanitizer_symbolizer_report.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libsanitizer/sanitizer_common/sanitizer_symbolizer_report.cpp b/libsanitizer/sanitizer_common/sanitizer_symbolizer_report.cpp index 351e00db6fb2..6f68e484ac90 100644 --- a/libsanitizer/sanitizer_common/sanitizer_symbolizer_report.cpp +++ b/libsanitizer/sanitizer_common/sanitizer_symbolizer_report.cpp @@ -41,10 +41,18 @@ static bool FrameIsInternal(const SymbolizedStack *frame) { return true; if (file && internal_strstr(file, "\\compiler-rt\\lib\\")) return true; + if (file && internal_strstr(file, "\\libsanitizer\\")) + return true; if (module && (internal_strstr(module, "libclang_rt."))) return true; if (module && (internal_strstr(module, "clang_rt."))) return true; + if (module && (internal_strstr(module, "libtsan.") + || internal_strstr(module, "libhwasan.") + || internal_strstr(module, "liblsan.") + || internal_strstr(module, "libasan.") + || internal_strstr(module, "libubsan.")) + return true; return false; }