Skip to content

Internal Error: no cycle found for node builddir/some/dir/some/file.ext #2116

Closed

Description

@bdbaddog

This issue was originally created at: 2008-06-26 02:23:41.
This issue was reported by: mortenelo.
mortenelo said at 2008-06-26 02:23:41

At the end of my builds I get a error saying:
scons: *** Found dependency cycle(s):
Internal Error: no cycle found for node builddir/some/dir/some/file.ext
(<SCons.Node.FS.File instance at
0x2a9ed18cb0>) in state executed

My build otherwise passes.

I cannot provide an example, builds are 7h+ and uses licensed tools. Some
observations though.

  • The cycle is found for a seemingly random file - three runs three different
    files. Allthough it is currently only one 'kind' of file.
    Namely a file holding a list of source files for another builder. The filelist
    builder is used in several place, but the issue have yet appeared only for one
    specific use of it.
  • The issue have yet appeared only for a complete rebuild from scratch, with no
    sconsign.dblite and no build/variant directory.
  • Presently it have appeared consistently for the last three builds after
    upgrading from 0.97.0d20070918 to 0.98.5. Also we changed signature from
    TargetSignature('build') to md5 checksum, and changed the filelist builder to
    hold a md5 checksum of its input files, in order to ensure that a build is
    triggered when necessary.
  • I do run -j 10, until I get a smaller case I do not think I will try without -
    considering the run time.
  • The file's for which I have the issue should all be part of a diamond shaped
    sub-DAG. Though the diamond may be fairly big.
  • I have put in some print statements in the find_cycle function, it appears
    that no further nodes are searched, so the pending node is the only one left.
  • The build does otherwise complete, no other errors involved.
  • It may that dependencies and tool execution time, prevents the taskmaster
    from utilizing all the threads it have started i.e I run with -j 10 but
    possibly only 6-8 jobs on average are running.

stevenknight said at 2008-06-26 07:04:37

Reassigning to Benoit, already triaging it on the mailing list.

belley said at 2008-06-26 12:53:50

Hi Morten,

The Taskmaster.py file attached to this bug report contains a potential fix. You
can replace the Taskmaster.py of the 0.98.5 installation (or the SVN core
branch) with this one and see if the problem goes away.

If the problem is still there, there is a Taskmaster-dbg.py file that has some
additional debugging code activated. Again, just the replace the installed
Taskmaster.py file by this Taskmaster-dbg.py file (renaming it as Taskmaster.py
of course). The debug version of Taskmaster.py contains extra code that
validates the content of the pending_children set after each Taskmaster step. It
should help to pin-point the source of the problem (especially if ran with the
--taskmastertrace option).

Benoit

belley said at 2008-06-26 12:54:41

Created an attachment (id=438)
Potential fix.

belley said at 2008-06-26 12:55:25

Created an attachment (id=439)
Taskmaster with extra debugging code activated.

stevenknight said at 2008-07-01 11:09:58

Target milestone and priority per bug party triage.

mortenelo said at 2008-07-01 12:27:07

I have tried the taskmaster from Benoit (jun 26), I have not seen the issue
since then. So this appears to fix the problem.

jason_at_intel said at 2008-07-08 20:56:57

This problem seems to have shown up for us at work as well. I have tested the
new taskmaster.py file with our system with python 2.5.2 and SCons 0.98.5 and
everything seems to be better again. I would second this new taskmaster.py as
fixing the issue.

garyo said at 2008-08-20 04:25:29

Bug party triage: move to 1.0.1 from 1.0.x. Either a regression, trivial fix,
or important.

gregnoel said at 2008-09-02 15:21:45

Move unfinished 1.0.1 issues to 1.1.

stevenknight said at 2008-10-17 05:59:05

Update target milestone to 1.2.

gregnoel said at 2008-12-04 17:41:09

1.2 is frozen; issues that didn't make it into 1.2 are moved to 1.3.

stevenknight said at 2008-12-06 07:15:32

I integrated the taskmastertrace= portions of this patch as follows:

http://scons.tigris.org/ds/viewMessage.do?dsForumId=1268&dsMessageId=979971
http://scons.tigris.org/ds/viewMessage.do?dsForumId=5062&dsMessageId=979972

Not realizing that the patch originated here, I misattributed it to Jason Kenny,
who had passed it on in a different context. I updated the attribution:

http://scons.tigris.org/ds/viewMessage.do?dsForumId=1268&dsMessageId=980118
http://scons.tigris.org/ds/viewMessage.do?dsForumId=5062&dsMessageId=980119

stevenknight said at 2008-12-06 07:31:16

Benoit, if you're still out there, the patch breaks the current
test/Interactive/option-i.py, which verifies that dependent targets still get
built when the a previous failure is ignored using the -i option, but using a
slightly different case than test/option-i.py. Forcing removal of the
pending_children in all cases seems to be the cause of the problem. I'm trying
to track down a fix, but wanted to let you know in case you have some insight
into how to fix it.

stevenknight said at 2008-12-06 08:05:29

Found the problem, or at least a slightly different fix for it. This broke in
the --interactive case partly because we weren't making sure that the ref_count
for every Node was re-initialized to 0 in between individual commands. So
adding an explicit re-initialization of ref_count to 0 in the Node.clear()
method fixed this test case.

It doesn't quite explain to me why we can exit the Taskmaster loop in
--interactive mode with someone's ref_count being non-zero, though. That may be
a clue about different Taskmaster behaviors people are seeing. I may continue
digging into that, but in the meantime I'm going ahead with integrating this
along with the Node.clear() fix, since some people (e.g. Jason Kenny re: issue
#2265) have already been using this patch successfully.

stevenknight said at 2008-12-06 09:47:32

Benoit's patch integrated for next release:

http://scons.tigris.org/ds/viewMessage.do?dsForumId=1268&dsMessageId=980548
http://scons.tigris.org/ds/viewMessage.do?dsForumId=5062&dsMessageId=980549

Note that issue #2265 reports that spurious dependency cycles can still occur in
some circumstances even with this patch, and has a workaround that tries to
suppress reports of spurious cycles by eliminating still-pending children that
have transitioned to EXECUTED state (which eliminates the symptom, but not the
underlying cause).

belley attached Taskmaster.py at 2008-06-26 12:54:41.

Potential fix.

belley attached Taskmaster-dbg.py at 2008-06-26 12:55:25.

Taskmaster with extra debugging code activated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions