[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #37703] job starts before dependency
From: |
Koen Van Hoof |
Subject: |
[bug #37703] job starts before dependency |
Date: |
Wed, 16 Jan 2013 13:16:35 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0 |
Follow-up Comment #2, bug #37703 (project make):
The error I got did only happen as part of a much bigger system, and it is not
easy to reproduce it in a small example.
But I can try to explain it with a small example.
The attached Makefile has a dependency tree
/x.a -
all +-x.b x.d - x.e
x.c -/
With a 'make -j' the following did happen.
1) The chain x.a - x.d -x.e is checked
the flag 'considered' is set for the files x.a x.d x.e
The command for x.e is launched.
2) x.b is checked.
The command for x.b is launched.
Before launching the command, there is a call to reap_children (0, 0)
Here is the situation that makes it hard to reproduce. In my setup, the job
of x.e was finished by the time we got here. I only can reproduce this in
this small example, by inserting a sleep(1) statement in the function new_job
new_job (struct file *file)
{
struct commands *cmds = file->cmds;
struct child *c;
char **lines;
unsigned int i;
/* Let any previously decided-upon jobs that are waiting
for the load to go down start before this new one. */
start_waiting_jobs ();
->sleep(1);
/* Reap any children that might have finished recently. */
reap_children (0, 0);
...
Within reap_children, the command_state of x.e is set to cs_finished
3) The chain x.c - x.d - x.e is checked
In the function update_file for file x.c, a call is done to update_file for
x.d.
This one returns 0 because the flag 'considered' of x.d is already set.
As a result, the commands for x.c are launched, while x.d did not yet run.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?37703>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/