Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Jun 2020 04:34:50 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Dewayne Geraghty <dewayne@heuristicsystems.com.au>
Cc:        FreeBSD Stable Mailing List <freebsd-stable@freebsd.org>, emaste@freebsd.org
Subject:   Re: Upgrading to 12.1S 362003 - a few issues
Message-ID:  <20200613013450.GS48478@kib.kiev.ua>
In-Reply-To: <978b8cb5-de88-4264-25ec-e7ecaaf80c75@heuristicsystems.com.au>
References:  <978b8cb5-de88-4264-25ec-e7ecaaf80c75@heuristicsystems.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jun 13, 2020 at 10:24:49AM +1000, Dewayne Geraghty wrote:
> After upgrading to 12.1Stable as of June 11:
> 1) squid - fails with segmentation fault, ldd "Cannot load PIE binary"
> 2) gcc9 - suffers a cc1 internal compiler error
> 3) pkg-static - issues "failed" messages, unable to package or install
> 
> Environment Xeon E3, ufs2 only, previously running FreeBSD 12.1 dated
> 1st May (from kernel.old).
> Prior to the upgrade all ports were rebuilt without issue, but NOT
> installed as they were a fall-back, in the event that clang 10 caused
> issues (the concern).  There are multiple jails on this system, both
> amd64 and i386 - some for building, testing and production use.  One of
> the production i386 jails runs squid, unchanged since Sept 2019.
> 
> /etc/src.conf contains
> WITH_PIE=YES
> WITH_BIND_NOW=YES
> 
> Most of our 1400+ ports are built and run with relro, now, pie and where
> possible with noexecstack &/or no-common.  These functioned in an ASLR
> environment.  (ASLR is only disabled during builds (gcc9 complains), or
> when there's a problem, now).
> 
> Note: NONE of the ports were rebuilt after the upgrade. However as part
> of resolution, beep and squid were rebuilt.
> 
> === Sequence of thigns ===
> 
> Upgrade performed.  System rebooted without incident to
> 	FreeBSD 12.1-STABLE #0 r362003M: Thu Jun 11 23:07:00 AEST 2020  i386
> hqdev-amd64-smp-vga 1201517 1201517
> but some port/application failures:
> 
> Problem 1
> ---------
> 
> i386 jail demonstrated:
> 
> # /usr/local/etc/rc.d/squid start
> Starting squid.
> Segmentation fault
Segmentation fault means that image was activated and kernel handed control
to usermode.  Try to debug it some, for instance use ktrace and LD_DEBUG=1
to see how much things progressed.

> 
> # ldd /usr/local/sbin/squid
> /usr/local/sbin/squid:
> ldd: /usr/local/sbin/squid: Cannot load PIE binary /usr/local/sbin/squid
> as DSO
> /usr/local/sbin/squid: exit status 1
This is cosmetics, the problem is in ldd(1) mis-detecting PIE binary as
DSO.  Before some changes in rtld it was innocent, but since from recent
times rtld refuses to dlopen(3) PIE binaries, method that ldd uses for
DSO no longer works.

It will take some time to fix ldd, because it needs to start parsing
dynamic segment for DF_1_FLAGS.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200613013450.GS48478>