[Scons-users] Text file busy race condition bug on linux

David Roundy roundyd at physics.oregonstate.edu
Thu Aug 22 19:01:46 EDT 2013


Hi all,

I've been running into a sporadic bug on linux, and have just managed to
create a small test case that reproduces the bug for me. Presumably it is
a race condition. It smells like for some reason the cache is not closing
the files that it creates before they are used. My system is debian
stable, and the scons packaged for debian:

$ scons --version
SCons by Steven Knight et al.:
script: v2.1.0.r5357[MODIFIED], 2011/09/09 21:31:03, by bdeegan on ubuntu
engine: v2.1.0.r5357[MODIFIED], 2011/09/09 21:31:03, by bdeegan on ubuntu

I understand that there are more recent releases, and hope to find time to
test on the latest release. I didn't see anything, however, in the release
notes to suggest this bug has been fixed.

The circumstances are that I am building an executable, and then running
that executable to generate another file. I am using a cache, and have
never observed the bug while the cache was disabled. The cache is on an
NFS filesystem (my home directory), and I have only observed the bug when
building on /tmp, which is a local disk. The error message is (just
cutting some of the output):

Retrieved `hello-0059-small' from cache
Retrieved `hello-0058' from cache
Retrieved `hello-0059' from cache
./hello-0057 > greeting-0057.txt
./hello-0056 > greeting-0056.txt
Retrieved `hello-0060.o' from cache
Retrieved `hello-0060-small' from cache
Retrieved `hello-0060' from cache
./hello-0058 > greeting-0058.txt
./hello-0059 > greeting-0059.txt
sh: 1: ./hello-0059: Text file busy
scons: *** [greeting-0059.txt] Error 2
scons: building terminated because of errors.

I'm attaching the necessary files. It's just a simple hello world program
that I copy a hundred times, and build and run to create greeting*.txt
files. In order to reproduce the bug, I had to make the executable files
large, which I did by adding a few megabytes of zeroes to the end. With
this setup I can reproduce the above error pretty much on every "scons -j4"
with a "scons -c" in between.

Any ideas if this has been fixed, or what could be causing this? If I can
reproduce this on the latest version, I'll file a bug report, but for now I
am curious if anyone else has seen this problem.
--
David Roundy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20130822/8b759f9d/attachment-0001.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SConstruct
Type: application/octet-stream
Size: 683 bytes
Desc: not available
Url : http://four.pairlist.net/pipermail/scons-users/attachments/20130822/8b759f9d/attachment-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hello.c
Type: text/x-csrc
Size: 75 bytes
Desc: not available
Url : http://four.pairlist.net/pipermail/scons-users/attachments/20130822/8b759f9d/attachment-0001.c


More information about the Scons-users mailing list