Project

General

Profile

Actions

Bug #3196

closed

ao_gendisp use by make is racey

Added by Rich Lowe over 10 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
tools - gate/build tools
Start date:
2012-09-14
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
External Bug:

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

Related to illumos gate - Bug #13609: i86xpv needs to be more careful with ao_gendispClosedRich Lowe

Actions
Actions #1

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]
Actions #2

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.

Actions #3

Updated by Marcel Telka over 10 years ago

  • Category set to tools - gate/build tools
Actions #4

Updated by Marcel Telka over 10 years ago

  • Assignee set to Marcel Telka
Actions #5

Updated by Marcel Telka over 10 years ago

  • Status changed from New to Pending RTI
Actions #6

Updated by Garrett D'Amore over 10 years ago

  • Status changed from Pending RTI to Resolved

commit a0900badd8eb6bcca99411c8906b483e84f2da91
Author: Garrett D'Amore <>
Date: Wed Jan 30 10:55:11 2013 -0800

3196 ao_gendisp use by make is racey
Reviewed by: Hans Rosenfeld &lt;&gt;
Reviewed by: Richard Lowe &lt;&gt;
Approved by: Garrett D'Amore &lt;&gt;

(I made a mistake in git... this should have had author # User Marcel Telka <>)

(Would be better if people would send git patches rather than Mercurial...)

Actions #7

Updated by Rich Lowe about 2 years ago

  • Related to Bug #13609: i86xpv needs to be more careful with ao_gendisp added
Actions

Also available in: Atom PDF