Truffle: [NodeUtil.findFirstNodeInstance(..) + SpecializationNode.next]: NullPointerException!!
Christian Humer
christian.humer at gmail.com
Mon Jun 8 09:40:37 UTC 2015
Thanks! From the error you sent me it looks like a null value assigned to a
field similar to: @Children Node[] childrenField
btw.: You don't need @CompilationFinal if your field is already annotated with
@Child. @Child implies @CompilationFinal implicitely.
- Christian Humer
"Mohaned Y Qunaibit" <mqunaibi at uci.edu> wrote:
> Hello Christian,
> Yes, you are right it's not related to the ; it's one of the children from a
> parent class:
> The work around I used for now is use instead.
> I will try to find a way to create a small example after I fully find the
> root of the issue.
>> On Sun, Jun 7, 2015 at 10:08 AM, Christian Humer
>> <[christian.humer at gmail.com](mailto:christian.humer at gmail.com)> wrote:
>>
>> Hi Mohaned,
>>
>> I am not sure its related to the next pointer. Can you provide me with some
>> some test code that I can run as well as the full stack trace?
>>
>> My first guess would be that you have a field annotated with @Children that
>> is null. Can you also show me the code of the node that is responsible for
>> the error?
>>
>> Anyway I think nodeAt should be more robust with null values in fields
>> annotated with @Children. Will discuss this in the meantime.
>>
>> Thanks.
>>
>> - Christian Humer
>>
>> "Mohaned Y Qunaibit" <[mqunaibi at uci.edu](mailto:mqunaibi at uci.edu)> wrote:
>>
>> Hi,
>>
>>
>> While I was merging the new changes on Graal+Truffle for ZipPy, I got null
>>
>> pointer exception when calling NodeUtil.findFirstNodeInstance(..) function.
>>
>>
>> The problem is related to the SpecializationNode.next child. Since next is
>>
>> the only child of the uninitialized node NodeClass().getChildren() returns
>>
>> a list with null child and cause this issue.
>>
>>
>> More specifically when fetching
>>
>> *childFields[0].getObject(UninitializedNode_);*
>>
>> NodeClass.java: 215
>>
>> private Node nodeAt(int idx) {
>>
>> int nodeCount = childFields.length;
>>
>> if (idx < nodeCount) {
>>
>> return (Node) *childFields[idx].getObject(node);*
>>
>> } else {
>>
>> for (NodeFieldAccessor childrenField : childrenFields) {
>>
>> Object[] nodeArray = (Object[])
>>
>> childrenField.getObject(node);
>>
>> if (idx < nodeCount + nodeArray.length) {
>>
>> return (Node) nodeArray[idx - nodeCount];
>>
>> }
>>
>> nodeCount += nodeArray.length;
>>
>> }
>>
>> }
>>
>> return null;
>>
>> }
>>
>>
>> Any idea on how to fix/avoid it?
>>
>>
>> Best,
>>
>> Mohaned Qunaibit
More information about the graal-dev
mailing list