[Scons-users] Possible threading bug in scons
William Blevins
wblevins001 at gmail.com
Mon Jan 18 17:20:43 EST 2016
I looked through TaskMaster::execute in the latest and didn't see anything
that jumped out at me. Do you have a full stack trace or just that snippet?
On Mon, Jan 18, 2016 at 9:51 PM, William Blevins <wblevins001 at gmail.com>
wrote:
> I'll take a brief look, but I am pretty busy during exam season. I have
> ran heterogeneous SCons builds on 40-core servers without every running
> into this, but it is still possible...
>
> On Mon, Jan 18, 2016 at 9:46 PM, William Blevins <wblevins001 at gmail.com>
> wrote:
>
>>
>>
>> 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/62e96aa1/attachment.html>
More information about the Scons-users
mailing list