From owner-freebsd-current@freebsd.org Tue Aug 22 15:34:54 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7F03DCC307 for ; Tue, 22 Aug 2017 15:34:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id AC63666BB2 for ; Tue, 22 Aug 2017 15:34:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id ABAF4DCC301; Tue, 22 Aug 2017 15:34:54 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB546DCC300 for ; Tue, 22 Aug 2017 15:34:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A75D66BB1 for ; Tue, 22 Aug 2017 15:34:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v7MFYggU050231 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 22 Aug 2017 18:34:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v7MFYggU050231 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v7MFYgVw050230; Tue, 22 Aug 2017 18:34:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 22 Aug 2017 18:34:42 +0300 From: Konstantin Belousov To: David Wolfskill , current@freebsd.org Subject: Re: SIGSEGV in /bin/sh after r322740 -> r322776 update Message-ID: <20170822153442.GG1700@kib.kiev.ua> References: <20170822114627.GC1130@albert.catwhisker.org> <20170822115923.GC1700@kib.kiev.ua> <20170822122836.GH1130@albert.catwhisker.org> <20170822123449.GD1700@kib.kiev.ua> <20170822124617.GN1130@albert.catwhisker.org> <20170822131958.GE1700@kib.kiev.ua> <20170822151738.GV1130@albert.catwhisker.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170822151738.GV1130@albert.catwhisker.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Tue, 22 Aug 2017 15:34:54 -0000 On Tue, Aug 22, 2017 at 08:17:38AM -0700, David Wolfskill wrote: > On Tue, Aug 22, 2017 at 04:19:58PM +0300, Konstantin Belousov wrote: > > ... > > > > Ok, can you rebuild kernel and libc from scratch ? I.e. remove your > > > > object directories. > > > > > > I think I'll need a working /bin/sh to do that. As noted, I could > > > try the stable/11 /bin/sh; on the other hand, if it's dying in a > > > library, that's not likely to help a whole lot. :-} > > I highly suspect that this is not /bin/sh at all. Backtrace strongly > > suggests that the malloc() has issues, but again I suspect that the > > reason is not an issue in malloc, but its use of TLS. > > > > The amd64 changes were to the TLS base register handling. So you might > > try to boot previous kernel. If this works out without replacing libc > > then it is definitely TLS, but I still do not know what is wrong. > > > > > > > > But yes: once we resolve the "working /bin/sh" issue, clearing > > > /usr/obj & rebuilding is straighforward and shouldn't take too long. > > .... > > OK. Booting from the previous kernel (/boot/kernel.old) allowed /bin/sh > (et al.) to work without segfaults, so after clearing /usr/obj, I > rebuilt r322776 from scratch (yes, userland as well as kernel). > > On reboot, I wtached the serial console, and noted: > > ... > Mounting local filesystems:. > ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/perl5/5.24/mach/CORE > 32-bit compatibility ldconfig path: /usr/lib32 /usr/lib32/compat > Setting hostname: freebeast.catwhisker.org. > Setting up harvesting: [UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,NET_ETHER,NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED > Feeding entropy: . > Starting Network: lo0 re0. > lo0: flags=8049 metric 0 mtu 16384 > options=600003 > inet6 ::id 298 (sh), uid 0: exited on signal 11 prefixlen 128 1 (core dumped) > > inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 > inet 127.0.0.1 netmask 0xff000000 > nd6 options=21 > groups: lo > re0: flags=8843 metric 0 id 305 (sh), uid 0: exited on signal 11 (core dumped) > mtu 1500 > options=8209b > ether 98:90:96:d6:c9:6d > inet 172.16.8.10 netmask 0xffffff00 pid 310 (sh), uid 0: exited on signal 11 (core dumped) > broadcast 172.16.8.255 > nd6 options=29 > media: Ethernet autoselect (none) > status: no re0: link state changed to UP > carrier > Segmentation fault (core dumped) > Startpid 314 (sh), uid 0: exited on signal 11 (core dumped) > ing devd. > Segmentation fault (core dumped) > Segmentation fault (core dumped) > Segmentation fault (core dumped) > pid 319 (sh), uid 0: exited on signal 11 (core dumped) > Segmentation fault (core dumped) > pid 330 (sh), uid 0: exited on signal 11 (core dumped) > Segmentation fault (core dumped)ubt0 on uhub2 > ubt0: on usbus0 > > random: harvesting attach, 8 bytes (4 bits) from ubt0 > pid 339 (sh), uid 0: exited on signal 11 (core dumped) > Segmentation fault (core dumped) > pid 343 (sh), uid 0: exited on signal 11 (core dumped) > Segmentation fault (core dumped)WARNING: attempt to domain_add(bluetooth) after domainfinalize() > > WARNING: attempt to domain_add(netgraph) after domainfinalize() > add host 127.0.0.1: gateway lo0 fib 0: route already in table > add net default: gateway 172.16.8.1 > add host ::1: gateway lo0 fib 0: route already in table > add net fe80::: gateway ::1 > add net ff02::: gateway ::1 > add net ::ffff:0.0.0.0: gateway ::1 > add net ::0.0.0.0: gateway ::1 > Creating and/or trimming log files. > Starting syslogd. > Starting rpcbind. > NFS access cache time=60 > No core dumps found. > Setting NIS domain: lmdhw.com. > Starting ypbind. > Clearing /tmp (X related). > Starting mountd. > NFSv4 is disabled > Starting nfsd. > Starting statd. > Starting lockd. > Recovering vi editor sessions:. > Starting lpd. > Upda > FreeBSD/amd64 (freebeast.catwhisker.org) (ttyu0) > > login: > [end of console output -- dhw] > > > So ... looks as if we still have at least one issue, and we have a way > to evade the segfaults. > > Bisection time? Or if there's another approach (or even a suggestion > for a revision to try first), I'm up for it. 9And yes, I'll just > be rebuilding the kernel for the rest of this exercise, I think. > That should speed things up significantly.) No need. It is clearly something with r322762 (more likely) or r322763 (less likely). Give me some time, I either fix it today or revert the commits.