Bug #3196
closedao_gendisp use by make is racey
0%
Description
We build ao_gendisp once, but then use it from other makefiles in a way that is apparently racely.
We've caught it at least twice, now, were the script is executed before it is executable.
It should probably be built by the consuming makefiles, so that they may depend on it more correctly.
Related issues
Updated by Marcel Telka over 10 years ago
I saw this in my build log:
/usr/bin/rm -f ../../i86pc/cpu/scripts/ao_gendisp; /usr/bin/sed -e "s@TEXT_DOMAIN@\\"\\"@" ../../i86pc/cpu/scripts/ao_gendisp.pl > ../../i86pc/cpu/scripts/ao_gendisp; /usr/bin/chmod +x ../../i86pc/cpu/scripts/ao_gendisp ../../i86pc/cpu/scripts/ao_gendisp ../../i86pc/cpu/amd_opteron/ao_mca_disp.in >debug64/ao_mca_disp.c sh: line 1: ../../i86pc/cpu/scripts/ao_gendisp: cannot execute [Permission denied]
Updated by Marcel Telka over 10 years ago
Root Cause:
The root cause seems to be that the usr/src/uts/Makefile runs all intel related architectures in parallel:
38 i386_ARCHITECTURES = i86pc i86xpv intel 39 40 # 41 # For i386 all architectures can be compiled in parallel. 42 # 43 # intel/Makefile knows how to build prerequisites needed for parallel build. 44 # 45 i386_PREREQ = intel 46 i386_PARALLEL = $(i386_ARCHITECTURES) 47 48 # 49 # For sparc all architectures can be compiled in parallel. 50 # 51 # sun4/Makefile knows how to build prerequisites needed for parallel build. 52 # can start. 53 # 54 sparc_PREREQ = sun4 55 sparc_PARALLEL = $(sparc_ARCHITECTURES) 56 57 # 58 # Platforms defined in $(MACH)_PARALLEL are built in parallel. DUMMY is placed 59 # at the end in case $(MACH)_PARALLEL is empty to prevent everything going in 60 # parallel. 61 # 62 .PARALLEL: $($(MACH)_PARALLEL) DUMMY
The ao_gendisp is built here:
usr/src/uts/i86pc/cpu/scripts/Makefile
but it is used here:
usr/src/uts/i86xpv/amd_opteron/Makefile usr/src/uts/i86pc/amd_opteron/Makefile
so there is a chance that the i86xpv will need the ao_gendisp before it was properly built in the i86pc.
Updated by Marcel Telka over 10 years ago
- Category set to tools - gate/build tools
Updated by Marcel Telka over 10 years ago
- Status changed from New to Pending RTI
Updated by Garrett D'Amore over 10 years ago
- Status changed from Pending RTI to Resolved
commit a0900badd8eb6bcca99411c8906b483e84f2da91
Author: Garrett D'Amore <garrett@dey-sys.com>
Date: Wed Jan 30 10:55:11 2013 -0800
3196 ao_gendisp use by make is racey
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Approved by: Garrett D'Amore <garrett@damore.org>
(I made a mistake in git... this should have had author # User Marcel Telka <Marcel.Telka@nexenta.com>)
(Would be better if people would send git patches rather than Mercurial...)
Updated by Rich Lowe about 2 years ago
- Related to Bug #13609: i86xpv needs to be more careful with ao_gendisp added