[Scons-users] Possible threading bug in scons
William Blevins
wblevins001 at gmail.com
Mon Jan 18 16:46:01 EST 2016
On Mon, Jan 18, 2016 at 2:48 PM, Tom Tanner (BLOOMBERG/ LONDON) <
ttanner2 at bloomberg.net> wrote:
> Someone here has been doing a lot of parallel builds and come across what
> looks like a bug though I'm not sure why:
>
> The problem is with this bit in Taskmaster:
>
> def execute(self):
> """
> Called to execute the task.
>
> This method is called from multiple threads in a parallel build,
> so only do thread safe stuff here. Do thread unsafe stuff in
> prepare(), executed() or failed().
> """
> T = self.tm.trace
> if T: T.write(self.trace_message(u'Task.execute()', self.node))
>
> try:
> cached_targets = []
> for t in self.targets:
> if not t.retrieve_from_cache():
> break
>
> The t.retrieve_from_cache ends up doing this:
>
> File ".../SCons/Node/FS.py", line 1778, in get_csig
> contents = self.get_contents()
> File ".../SCons/Node/FS.py", line 1769, in get_contents
> contents.append('%s %s\n' % (node.get_csig(), node.name))
> File ".../SCons/Node/__init__.py", line 784, in get_csig
> return self.ninfo.csig
> AttributeError: 'FileNodeInfo' object has no attribute 'csig'
>
> which goes away if he puts a lock in Node.get_ninfo.
>
> Now, the only way I can think of this triggering is if he's managed to get
> two rules with the same target. Is that possible? and if so how can you
> detect it? I don't like the idea of having a lock in Node.get_ninfo.
>
Two rules with the same target generate a SCons Error at SConscript parser
time.
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20160118/059e0aa2/attachment.html>
More information about the Scons-users
mailing list