https://bz.apache.org/bugzilla/show_bug.cgi?id=62824
Bug ID: 62824
Summary: Nested macro attributes not thread safe
Product: Ant
Version: 1.10.5
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: Core
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Created attachment 36196
--> https://bz.apache.org/bugzilla/attachment.cgi?id=36196&action=edit
A small macro and target that reproduces the issue.
It appears that if a nested macro references its parent attribute while in a
<parallel>, the attributes will race on their values when accessed (causing
values from another macro invocation to carry over to another incorrectly).
I've attached a reproduce file that can be invoked with 'ant repro', this will
run 2 instances of the parent macro in a <parallel> block. The parent macro has
a child macro inside that references the parent's attribute value (the child
macro in this case does not accept its own attribute). The child macro is
invoked by the parent macro, and will print the value of the attribute.
The expectation is that both "true" and "false" will be printed (in any order).
However, the actual behavior here is that this seemingly incorrectly will print
values ("false" and "false") or ("true" and "true").
Note: If an explicit attribute is added to the inner macro, and the parent
passes its value into it then it works as expected.
I've looked at the documentation for macrodef, and I'm unsure if accessing the
parent attributes from a nested macro is supported. Ideally it would be nice to
make this thread-safe, if it can't be done (and the above isn't supported) then
it might make sense to make these attributes inaccessible to nested macros.
--
You are receiving this mail because:
You are the assignee for the bug.