Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Oct 2000 20:05:02 +0100 (BST)
From:      Keith Jones <keith@mithy.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/22256: [RARE] cross-compiled static bins in /usr/obj/usr/src/i386 can cause Signal 4 during make installworld
Message-ID:  <200010231905.e9NJ52B01139@celery.mithy.org>

next in thread | raw e-mail | index | archive | help

>Number:         22256
>Category:       bin
>Synopsis:       [RARE] cross-compiled static bins in /usr/obj/usr/src/i386 can cause Signal 4 during make installworld
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 23 12:10:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Keith Jones
>Release:        FreeBSD 4.1.1-STABLE i386
>Organization:
no
>Environment:

	MACHINE #1

	uname output:
	FreeBSD celery.mithy.org 4.1.1-STABLE
	FreeBSD 4.1.1-STABLE #0: Sat Oct 21 19:24:18 BST 2000
	root@celery.mithy.org:/usr/obj/usr/src/sys/CELERY  i386

	cpu/mem (dmesg output):
	CPU: Pentium II/Pentium II Xeon/Celeron (400.91-MHz 686-class CPU)
	Origin = "GenuineIntel"  Id = 0x665  Stepping = 5
	Features=0x183f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,
		MCA,CMOV,PAT,PSE36,MMX,FXSR>
	real memory  = 268435456 (262144K bytes)
	avail memory = 257970176 (251924K bytes)

	MACHINE #2

	uname output:
	FreeBSD dino.mithy.org 4.1.1-STABLE
	FreeBSD 4.1.1-STABLE #0: Mon Oct 23 03:32:15 BST 2000
	root@celery.mithy.org:/usr/obj/usr/src/sys/DINO.syscons  i386

	cpu/mem (dmesg output):
	CPU: i386DX (386-class CPU)
	real memory  = 8388608 (8192K bytes)
	avail memory = 6225920 (6080K bytes)

>Description:

	I'm not really sure which category this belongs in; 'bin' seems
	to be the likeliest bet. Apologies if this is in error.

	To remake world on #2, it is first built on #1 as compliation time
	is far too long and available memory probably isn't up to the job.

	'make world' was previously run on machine #1 with CFLAGS options
	'-march=i686 -mcpu=i686', for obvious performance reasons.

	Before performing 'make buildworld' with machine #2 as the intended
	target system, these options were changed to '-march=i386 -mcpu=i386'.

	The installation is performed in the following stages (assume
	single-user mode for machine #2):

	1.  a 'make buildworld buildkernel KERNEL=DINO' is run on machine #1.
	2.  /usr/src and /usr/obj are NFS-mounted onto machine #2.
	3.  'make installkernel KERNEL=DINO' is run on machine #2.
	4.  'make installworld' is run on machine #2.

	In the case above (which is admittedly rare), this results in a
	Signal 4 (Illegal Instruction) during 'make installworld' when the
	'strip' command is called (notably by 'install with the '-s' option)
	as 'make installworld' will attempt to use the broken binaries in the
	/usr/obj/usr/src/i386 tree.

	I suspect that that is happening during build time is this: a number
	of static binaries in /usr/obj/usr/src/i386 are being linked with the
	(possibly older, or even incompatible) libraries resident in /usr/lib
	at the time the build took place, rather than the newly-compiled
	libraries in /usr/obj. I suspect therefore that this is a bug in the
	'make buildworld' process.

	This may affect other binaries used during the install process (though
	I must confess I didn't notice any problems with any of the others).
	It is not expected to affect any binaries on the target system once
	installation is complete, as the new binaries will be (dynamically
	or statically) linked with the correct libraries during the
	installation process (they are not statically linked during the
	build process).

>How-To-Repeat:

	See above. (You'll need two machines, I suspect.)

>Fix:

	The workaround is to copy the existing (static) 'strip' command
	from Machine #2's /usr/bin to /usr/obj/usr/src/i386/usr/bin prior
	to performing 'make installworld'.

	A permanent fix may be to include 'strip' in the list of files to be
	copied to '/tmp/install.NNN' (where NNN is the PID) during the install
	phase, and remove it from the list of static binaries built in
	/usr/obj/usr/src/i386 during the build phase.


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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