From nobody Wed Jan 05 05:18:59 2022 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AC40E193B296 for ; Wed, 5 Jan 2022 05:19:07 +0000 (UTC) (envelope-from ricky@rickysquid.org) Received: from mail.rickysquid.org (hwsrv-751118.hostwindsdns.com [IPv6:2607:5501:3000:207d::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4JTHpL669Dz3F3V for ; Wed, 5 Jan 2022 05:19:06 +0000 (UTC) (envelope-from ricky@rickysquid.org) Received: by mail.rickysquid.org (Postfix, from userid 1000) id 75EEB45695; Wed, 5 Jan 2022 05:18:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rickysquid.org; s=default; t=1641359939; bh=RS0706j1px0XHnQTpE6/JcV1P7uLYXXprmXnlRjTBco=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=axePmV3hi3gI6Kso/OxgVPiqy27k6/1wZbAoYNljyhkmefzDOSI764lWqlaE4znxh bZGvXYV7CBva7WyHrFVoEz6P+VgssoRJqSfKmuuBlSOIMeXXuTOIFsGupT3IQzWzoF K1sDvXR76FbxTdpvaHCNYXuCJSuhi9gUnTCt6kiTz1OH4omeyODAQpIzevEmlYbu4W pJq4gTxZl+wUbZZRRVt5liEw6slNDnWFScV0hLetVXaoNf6kSKqlhvP37zgzSBCIWq o1D3MElg9CooAXGpWetMTqVECvwUYKsze1K7uIXTgei2zw+sTAcpq6SfV11WEe9Jdi W+M9BUDeJMeKA== Date: Wed, 5 Jan 2022 05:18:59 +0000 From: Eric Gullufsen To: Luoqi Chen Cc: freebsd-hackers@freebsd.org Subject: Re: leak sanitizer support Message-ID: <20220105051859.GA28486@rickysquid.org> References: <20211230201614.z4bsknfgdde7ufwu@mutt-hbsd> <20220102002851.GA32472@rickysquid.org> <20220102193506.GA6478@rickysquid.org> <20220102210156.GA16266@rickysquid.org> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220102210156.GA16266@rickysquid.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 4JTHpL669Dz3F3V X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=pass header.d=rickysquid.org header.s=default header.b=axePmV3h; dmarc=pass (policy=none) header.from=rickysquid.org; spf=softfail (mx1.freebsd.org: 2607:5501:3000:207d::2 is neither permitted nor denied by domain of ricky@rickysquid.org) smtp.mailfrom=ricky@rickysquid.org X-Spamd-Result: default: False [1.22 / 15.00]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[rickysquid.org:s=default]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; HFILTER_HOSTNAME_2(1.00)[hwsrv-751118.hostwindsdns.com]; NEURAL_HAM_LONG(-0.98)[-0.979]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_SOFTFAIL(0.00)[~all]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.99)[0.994]; DKIM_TRACE(0.00)[rickysquid.org:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(0.00)[rickysquid.org,none]; DMARC_POLICY_ALLOW_WITH_FAILURES(-0.50)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:54290, ipnet:2607:5501::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On Sun, Jan 02, 2022 at 09:01:56PM +0000, rickygee wrote: > On Sun, Jan 02, 2022 at 07:35:06PM +0000, Eric Gullufsen wrote: > > Awesome sounds great - will test with your new diff & module files posted & > > report back here in a few - thanks! > > > > On Sun, Jan 02, 2022 at 09:53:06AM -0800, Luoqi Chen wrote: > > > locking issue and also to cleanup some unused code, would you mind trying > > > out the new version? I've updated the diff files. > > > > > > -luoqi > > > > Hey Luoqi, > > Dang you rock - I applied your updated patch against -current (commit > 642f77be1d), and everything went swimmingly in initial testing: > > -Eric Hey Luoqi, Shoot so sorry for my confusion, but it looks like the updated diff/.cpp do not actually run quite right on -current. I think this is due to the signature of SuspendedThreadsList::GetRegistersAndSP changing in June 2021 A commit in June 2021 (e8d8bef9) changed this signature on you in sanitizer_stoptheworld.h Here is `git show` for that commit/file, where you can see the sig change: [e@bsd /usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common]$ git show e8d8bef96 -- sanitizer_stoptheworld.h [cut] - virtual PtraceRegistersStatus GetRegistersAndSP(uptr index, uptr *buffer, - uptr *sp) const { ++ virtual PtraceRegistersStatus GetRegistersAndSP( ++ uptr index, InternalMmapVector *buffer, uptr *sp) const { + UNIMPLEMENTED(); + } + [cut] I think this explains my run-time errors when using lsan on -current (see output) [begin error output] AddressSanitizer: CHECK failed: sanitizer_stoptheworld.h:37 "((0 && "unimplemented")) != (0)" (0x0, 0x0) (tid=169384) AddressSanitizer:DEADLYSIGNAL [end error output] Anyway - just a heads up - you probably would have been right on it when you moved up to the new header, instead of squinting at lldb like me for *awhile*. Oh here is a patch it might be easier to see it that way: https://raw.githubusercontent.com/emgullufsen/freebsd/lsan/lsan-params.diff Thanks and sorry for my confusion earlier! -Eric