NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain/59189: leak sanitizer broken



The following reply was made to PR toolchain/59189; it has been noted by GNATS.

From: Thomas Klausner <wiz%NetBSD.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: toolchain/59189: leak sanitizer broken
Date: Tue, 18 Mar 2025 16:15:32 +0100

 --Yv63Z8Q90D8MSmcU
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 The breakage is not pthread-related, it also causes a segfault with an
 even simpler test case, attached, which on NetBSD 10 prints:
 
 $ ./lsan
 All is well.
 
 =================================================================
 ==29831==ERROR: LeakSanitizer: detected memory leaks
 
 Direct leak of 1 byte(s) in 1 object(s) allocated from:
     #0 0x73aab1405d27 in __interceptor_malloc /usr/src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_interceptors.cc:53
     #1 0x4009db in main /home/wiz/lsan.c:13
     #2 0x4008fc in ___start /usr/src/lib/csu/common/crt0-common.c:350
     #3 0x7f7f9900baf7  (/usr/libexec/ld.elf_so+0xbaf7)
 
 SUMMARY: LeakSanitizer: 1 byte(s) leaked in 1 allocation(s).
 
  Thomas
 
 --Yv63Z8Q90D8MSmcU
 Content-Type: text/x-c; charset=us-ascii
 Content-Disposition: attachment; filename=lsan.c
 
 /*
  * make lsan DBG=-g\ -Wall\ -Werror\ -fsanitize=leak
  */
 
 #include <stdio.h>
 #include <stdlib.h>
 
 int
 main(void)
 {
 	void *p;
 
 	p = malloc(1);
 	p = NULL;
 
 	if (p == NULL) {
 	  printf("All is well.\n");
 	}
 	return 0;
 }
 
 --Yv63Z8Q90D8MSmcU--
 


Home | Main Index | Thread Index | Old Index