From 645ea530191105dc89dd8d67640d61a4d0526df9 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 21 Feb 2025 17:13:20 -0800 Subject: runtime: in asan mode call __lsan_do_leak_check when exiting This enables the ASAN default behavior of reporting C memory leaks. It can be disabled with ASAN_OPTIONS=detect_leaks=0. Fixes #67833 Change-Id: I420da1b5d79cf70d8cf134eaf97bf0a22f61ffd0 Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-asan-clang15,gotip-linux-arm64-asan-clang15 Reviewed-on: https://go-review.googlesource.com/c/go/+/651755 Reviewed-by: Cherry Mui Reviewed-by: Ian Lance Taylor Auto-Submit: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI --- src/syscall/exec_linux_test.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/syscall/exec_linux_test.go') diff --git a/src/syscall/exec_linux_test.go b/src/syscall/exec_linux_test.go index 04973dc9ad..69d4916944 100644 --- a/src/syscall/exec_linux_test.go +++ b/src/syscall/exec_linux_test.go @@ -11,6 +11,7 @@ import ( "errors" "flag" "fmt" + "internal/asan" "internal/platform" "internal/syscall/unix" "internal/testenv" @@ -334,6 +335,10 @@ func TestUnshareMountNameSpaceChroot(t *testing.T) { // Test for Issue 29789: unshare fails when uid/gid mapping is specified func TestUnshareUidGidMapping(t *testing.T) { + if asan.Enabled { + t.Skip("test fails with ASAN beause the ASAN leak checker fails finding memory regions") + } + if os.Getenv("GO_WANT_HELPER_PROCESS") == "1" { defer os.Exit(0) if err := syscall.Chroot(os.TempDir()); err != nil { -- cgit v1.3