[YANGTOOLS-876] Submodule with augment from another module throws NullPointerException Created: 12/Apr/18 Updated: 16/Apr/18 Resolved: 16/Apr/18 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | 1.2.2, 1.1.2, 2.0.3 |
| Fix Version/s: | 1.1.4, 1.2.3, 2.0.4 |
| Type: | Bug | Priority: | Medium |
| Reporter: | Michal Cmarada | Assignee: | Robert Varga |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
ietf-ipv6-router-advertisements submodule which augments ipv6 container from ietf-ip, causes build to fail with NullPointerException: see attachment for stack-trace. To reproduce this error use patch https://gerrit.fd.io/r/#/c/11658/. The patch contains a lot of models, because it is hard to reproduce the bug, but it is definitely caused by submodule hc2vpp-ietf-ipv6-router-advertisements and its augmentation for ipv6. If this module is changed to a regular module and used as import instead of include then everything works. There are two cases, where the bug can be observed:
|
| Comments |
| Comment by Robert Varga [ 12/Apr/18 ] |
|
It would seem this is related to ModuleDependencyInfo.sort() – which would explain why it is hard to replicate. Can you confirm if the error is suppressed when hc2vpp-ietf-ipv6-unicast-routing imports ietf-ip? |
| Comment by Robert Varga [ 12/Apr/18 ] |
|
Also, can you capture the modules being passed as input and update the patch to re-create the problem? |
| Comment by Robert Varga [ 12/Apr/18 ] |
|
Furthermore, if there is a FD.io issue depending on this, can you link it in as being blocked by this issue? |
| Comment by Michal Cmarada [ 13/Apr/18 ] |
|
yes, when I added ietf-ip to parent module both build and runtime errors disappeared. Will do some more tests and if I hit the bug again I will report it here. |
| Comment by Michal Cmarada [ 13/Apr/18 ] |
|
Not sure if you had this in mind, but i found a warning that the submodule was not found in input files: 1st case - build failure |
| Comment by Michal Cmarada [ 16/Apr/18 ] |
|
added output for modules from List<Module> sort(final Module... modules) method. see modules.txt |
| Comment by Robert Varga [ 16/Apr/18 ] |
|
The problem is we are inlining statements from the submodule, but not the import statement. This leads to the module being not tracked as depending on ietf-ip and being processed before ietf-ip. Inlining the import statement should fix this issue. |