Skip to contentSkip to conversation

very obscure race: access to a just-populated binary

DISCUSSION Stanislav Brabec 3 participants 6 messages Sep 6, 2009 – Sep 9, 2009

lore
Share & tools
lore
#0 lore raw

Hallo.

I just encountered a very obscure race during the build: do_configure called grep exactly in the moment, when another process populated it:

/OE/build/tmp/staging/x86_64-linux/usr/bin/intltoolize: line 231: /OE/build/tmp/staging/x86_64-linux/usr/bin/grep: Text file busy /OE/build/tmp/staging/x86_64-linux/usr/bin/intltoolize: line 246: /OE/build/tmp/staging/x86_64-linux/usr/bin/grep: Text file busy

ls -al --full-time
work/armv5te-angstrom-linux-gnueabi/libgnomecups-0.2.3-r0/temp/log.do_configure.412
-rw-r--r-- 1 sbrabec users 1234 2009-09-06 03:23:45.000000000 +0200 work/armv5te-angstrom-linux-gnueabi/libgnomecups-0.2.3-r0/temp/log.do_configure.412 ls -al --full-time work/x86_64-linux/grep-native-2.5.1-r2/temp/log.populate_staging_preamble.21860
-rw-r--r-- 1 sbrabec users 12079 2009-09-06 03:23:44.000000000 +0200 work/x86_64-linux/grep-native-2.5.1-r2/temp/log.populate_staging_preamble.21860 
I guess it may be fixable by:
- do not populate binaries by installation in place
- extending of DEPENDS/RDEPENDS of native packages
- do_unpack should respect dependencies, otherwise it can happen with
unzip-native

________________________________________________________________________
Stanislav Brabec
http://www.penguin.cz/~utx/zaurus

#1 lore raw
Quoted 5 lines · Stanislav Brabec

Hallo.

I just encountered a very obscure race during the build: do_configure called grep exactly in the moment, when another process populated it:

Quoted 8 lines

/OE/build/tmp/staging/x86_64-linux/usr/bin/intltoolize: line 231: /OE/build/tmp/staging/x86_64-linux/usr/bin/grep: Text file busy /OE/build/tmp/staging/x86_64-linux/usr/bin/intltoolize: line 246: /OE/build/tmp/staging/x86_64-linux/usr/bin/grep: Text file busy

ls -al --full-time
work/armv5te-angstrom-linux-gnueabi/libgnomecups-0.2.3-r0/temp/log.do_configure.412
-rw-r--r-- 1 sbrabec users 1234 2009-09-06 03:23:45.000000000 +0200 work/armv5te-angstrom-linux-gnueabi/libgnomecups-0.2.3-r0/temp/log.do_configure.412 ls -al --full-time work/x86_64-linux/grep-native-2.5.1-r2/temp/log.populate_staging_preamble.21860
-rw-r--r-- 1 sbrabec users 12079 2009-09-06 03:23:44.000000000 +0200 work/x86_64-linux/grep-native-2.5.1-r2/temp/log.populate_staging_preamble.21860

A similar issue with coreutils-native was discussed here recently:

Quoted 17 lines


I guess it may be fixable by:
- do not populate binaries by installation in place
- extending of DEPENDS/RDEPENDS of native packages
- do_unpack should respect dependencies, otherwise it can happen with unzip-native

________________________________________________________________________
Stanislav Brabec
http://www.penguin.cz/~utx/zaurus

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#2 lore raw
Quoted 9 lines · Phil Blundell
Quoted 8 lines · Stanislav Brabec

Hallo.

I just encountered a very obscure race during the build: do_configure called grep exactly in the moment, when another process populated it:

/OE/build/tmp/staging/x86_64-linux/usr/bin/intltoolize: line 231: /OE/build/tmp/staging/x86_64-linux/usr/bin/grep: Text file busy /OE/build/tmp/staging/x86_64-linux/usr/bin/intltoolize: line 246: /OE/build/tmp/staging/x86_64-linux/usr/bin/grep: Text file busy

Quoted 7 lines
Quoted 5 lines

ls -al --full-time
work/armv5te-angstrom-linux-gnueabi/libgnomecups-0.2.3-r0/temp/log.do_configure.412
-rw-r--r-- 1 sbrabec users 1234 2009-09-06 03:23:45.000000000 +0200 work/armv5te-angstrom-linux-gnueabi/libgnomecups-0.2.3-r0/temp/log.do_configure.412 ls -al --full-time work/x86_64-linux/grep-native-2.5.1-r2/temp/log.populate_staging_preamble.21860
-rw-r--r-- 1 sbrabec users 12079 2009-09-06 03:23:44.000000000 +0200 work/x86_64-linux/grep-native-2.5.1-r2/temp/log.populate_staging_preamble.21860

A similar issue with coreutils-native was discussed here recently:

... that is to say, here:

http://thread.gmane.org/gmane.comp.handhelds.openembedded

Quoted 2 lines
Quoted 2 lines

I guess it may be fixable by:
- do not populate binaries by installation in place

This sounds like the right answer. In a future, packaged-staging-only utopia, this would probably happen automatically.

Quoted 1 line
Quoted 1 line

- extending of DEPENDS/RDEPENDS of native packages

I'm not quite sure how this would help, but possibly I don't understand exactly what you're suggesting.

Quoted 2 lines
Quoted 2 lines

- do_unpack should respect dependencies, otherwise it can happen with unzip-native

As far as I know, do_unpack should already respect dependencies (i.e. "do_unpack[depends] += ...". Is that not working for you?

p.

#3 lore raw
Quoted 6 lines · Phil Blundell
Quoted 1 line · Phil Blundell
Quoted 1 line

- extending of DEPENDS/RDEPENDS of native packages

I'm not quite sure how this would help, but possibly I don't understand exactly what you're suggesting.

If intltool-native would contain DEPENDS = "grep-native", than intltool build will probably wait for finishing of grep-native build or rebuild.

But it may be couter-productive to catch all of these dependencies (and cause dependency loops) - coreutils-native, grep-native, sed-native are dependencies of nearly all recipes.

Quoted 5 lines
Quoted 2 lines
Quoted 2 lines

- do_unpack should respect dependencies, otherwise it can happen with unzip-native

As far as I know, do_unpack should already respect dependencies (i.e. "do_unpack[depends] += ...". Is that not working for you?

i did not know it. recipes/jpeg/jasper_1.900.1.bb and other recipes contain DEPENDS = "unzip-native", and it does not work.

________________________________________________________________________
Stanislav Brabec
http://www.penguin.cz/~utx/zaurus

#4 lore raw
Quoted 2 lines · Stanislav Brabec

i did not know it. recipes/jpeg/jasper_1.900.1.bb and other recipes contain DEPENDS = "unzip-native", and it does not work.

Try:

do_unpack[depends] += "unzip-native:do_populate_staging"

p.

#5 lore raw
Quoted 7 lines · Phil Blundell
Quoted 2 lines · Stanislav Brabec

i did not know it. recipes/jpeg/jasper_1.900.1.bb and other recipes contain DEPENDS = "unzip-native", and it does not work.

Try:

do_unpack[depends] += "unzip-native:do_populate_staging"

Works:
NOTE: Running task 3984 of 4299 (ID: 3650, /OE/openembedded/recipes/jpeg/jasper_1.900.1.bb, do_fetch)
NOTE: Running task 4023 of 4299 (ID: 1693, /OE/openembedded/recipes/unzip/unzip-native_552.bb, do_populate_staging)
NOTE: Running task 4027 of 4299 (ID: 3651, /OE/openembedded/recipes/jpeg/jasper_1.900.1.bb, do_unpack)

Before the change, bitbake was trying to unpack jasper before populating of unzip-native.

Pushed as
http://cgit.openembedded.org/cgit.cgi/openembedded/commit/?id=d5345f88b5ffdca098e0281f42f51e42ef43e79d

Thanks for your hint.

________________________________________________________________________
Stanislav Brabec
http://www.penguin.cz/~utx/zaurus