From owner-freebsd-current@freebsd.org Thu May 9 12:08:27 2019 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 765FA15A7996 for ; Thu, 9 May 2019 12:08:27 +0000 (UTC) (envelope-from ler@FreeBSD.org) Received: from thebighonker.lerctr.org (ns-b.lerctr.org [IPv6:2001:470:1f0f:3ad::53:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "*.lerctr.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 107DF8C141; Thu, 9 May 2019 12:08:27 +0000 (UTC) (envelope-from ler@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=ler2019; h=Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date: Content-Transfer-Encoding:Content-Type:MIME-Version:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=l5u57gy926vEn9PhxxvbWws0XEiYT+mcsdU38OjWSAg=; b=Kn4C7NCiO3qMW1Vw4W42M28+c3 pI+oeATPds1xCDeymgdzYnYyR3+baXEUEM1ESL+suqvvzfqxemSiAH3C1zgrvc4voXtiZHlVRYmKR jAWG/Rlz3bJ64s3GmPr4DAX7/qmCS3kcOcROgvtvbXMmJKmOrYPTNjyiQ9IfnNJkM1FVoZB/AH9Y4 2esaBOUNZk2+VT67YAXQNpylYDHXxu13vL5HcIhQaT8NwXQ5UGZE9kd+sS0iVwXpl+nPjr38zO4+m 2n7MoJslkVVFER4GUHAjd+k2mjbqjfRDsmwaS00/IvrrZW73gKFLWntxPImKSs6/6sfZchhek/Rxg CxkWhT6Q==; Received: from thebighonker.lerctr.org ([2001:470:1f0f:3ad:bb:dcff:fe50:d900]:33137 helo=webmail.lerctr.org) by thebighonker.lerctr.org with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92 (FreeBSD)) (envelope-from ) id 1hOhqb-000IIY-RV; Thu, 09 May 2019 07:08:25 -0500 Received: from 2600:1700:210:b180:d8c:cc0b:810:3d61 by webmail.lerctr.org with HTTP (HTTP/1.1 POST); Thu, 09 May 2019 07:08:24 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 09 May 2019 07:08:24 -0500 From: Larry Rosenman To: Mark Johnston Cc: freebsd-current@freebsd.org, Mark Johnston Subject: Re: Crash loading dtraceall In-Reply-To: <20190509043117.GF11774@raichu> References: <20190508205245.ulbo6fusk3b4py7t@ler-imac.local> <20190508222932.GB11774@raichu> <845dd186ef038d98c1a95a7454e432d2@FreeBSD.org> <20190508225553.GC11774@raichu> <460d563e2fe48bfd90b489015b4c0f9d@FreeBSD.org> <20190509033211.GE11774@raichu> <8418ec8f5e303dce4225a53be88fc49d@FreeBSD.org> <20190509043117.GF11774@raichu> Message-ID: <7e7d0f269e3393b252d53392c0c0c260@FreeBSD.org> X-Sender: ler@FreeBSD.org User-Agent: Roundcube Webmail/1.3.9 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 12:08:27 -0000 On 05/08/2019 11:31 pm, Mark Johnston wrote: > On Wed, May 08, 2019 at 11:01:58PM -0500, Larry Rosenman wrote: >> On 05/08/2019 10:32 pm, Mark Johnston wrote: >> > On Wed, May 08, 2019 at 05:57:18PM -0500, Larry Rosenman wrote: >> >> On 05/08/2019 5:55 pm, Mark Johnston wrote: >> >> > On Wed, May 08, 2019 at 05:47:08PM -0500, Larry Rosenman wrote: >> >> >> On 05/08/2019 5:29 pm, Mark Johnston wrote: >> >> >> > On Wed, May 08, 2019 at 03:52:45PM -0500, Larry Rosenman wrote: >> >> >> >> Greetings, >> >> >> >> >> >> >> >> Somewhere between r346483 and r347241 loading dtraceall causes a >> >> >> >> crash. I have the cores and kernels. >> >> >> >> >> >> >> >> It's hard for me to bisect more than this, as the box is remote. >> >> >> >> >> >> >> >> What more do you need? (this dump is fropm r347355). >> >> >> > >> > The problem is with the kernel linker's handling of ifuncs. When >> > enumerating symbols, it replaces ifunc symbol values with the return >> > value of the resolver but preserves the original symbol size, which is >> > that of the resolver. I believe this patch will address the panic >> > you're seeing: >> > >> It does *NOT*. > > I see, my theory above is not the real problem here. The resolver for > x86_rng_store() may return NULL, which we do not expect. Can you show > the CPU info and features lines from the dmesg to confirm? > > Also see if this patch helps: > > diff --git a/sys/dev/random/ivy.c b/sys/dev/random/ivy.c > index 57f3d0a1d80b..71065d788cf9 100644 > --- a/sys/dev/random/ivy.c > +++ b/sys/dev/random/ivy.c > @@ -97,6 +97,13 @@ x86_rdseed_store(u_long *buf) > return (retry); > } > > +static int > +x86_dead_store(u_long *buf __unused) > +{ > + > + panic("missing hardware PRNG support"); > +} > + > DEFINE_IFUNC(static, int, x86_rng_store, (u_long *buf), static) > { > has_rdrand = (cpu_feature2 & CPUID2_RDRAND); > @@ -107,7 +114,7 @@ DEFINE_IFUNC(static, int, x86_rng_store, (u_long > *buf), static) > else if (has_rdrand) > return (x86_rdrand_store); > else > - return (NULL); > + return (x86_dead_store); > } > > /* It is required that buf length is a multiple of sizeof(u_long). */ The above patch (on top of the previous one) fixes the crash. flags/features as requested: CPU: Intel(R) Xeon(R) CPU E5440 @ 2.83GHz (2826.30-MHz K8-class CPU) Origin="GenuineIntel" Id=0x1067a Family=0x6 Model=0x17 Stepping=10 Features=0xbfebfbff Features2=0xc0ce3bd AMD Features=0x20100800 AMD Features2=0x1 VT-x: HLT,PAUSE TSC: P-state invariant, performance statistics -- Larry Rosenman http://people.freebsd.org/~ler Phone: +1 214-642-9640 E-Mail: ler@FreeBSD.org US Mail: 5708 Sabbia Dr, Round Rock, TX 78665-2106