[YANGTOOLS-411] StackOverflowError for leafref Created: 14/Feb/15 Updated: 10/Apr/22 Resolved: 18/Jun/15 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Minna Hu | Assignee: | Martin Ciglan |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Attachments: |
|
| External issue ID: | 2721 |
| Description |
|
I want to generate JAVA classes from ietf-ospf, I hit StackOverflowError at the following definition, and the generation failed. list neighbor { description "Neighbor."; If I replace path "../../neighbor/neighbor-id" with concrete path "/rt:routing-state/rt:routing-instance/" How can we solve the StackOverflowError without modifying ietf-ospf file? Could we fix it in yang-tools? Thank you! ietf-ospf.yang file is attached. Error message is: |
| Comments |
| Comment by Minna Hu [ 14/Feb/15 ] |
|
Attachment ietf-ospf@2014-09-17.yang has been added with description: ietf-ospf |
| Comment by Tony Tkacik [ 16/Feb/15 ] |
|
interface-operation { } This seems bit weird - this set of leafrefs references themselves (recursive definition), so there is not initial set of valid values, need to co Definitelly StackOverflowError is bug, but looking at original model - that one is not correct also. I believe that path should be ../../../ |
| Comment by Minna Hu [ 17/Feb/15 ] |
|
Thanks, Tony! The model is from IETF, I did not know why they defined the model in this way. You had good founding, the model will definitely causes StackOverflowError. Besides modifying the model, is there any way to handle the situation in yang-tools? Thanks! |
| Comment by Martin Ciglan [ 23/Feb/15 ] |
|
I propose checking schema node and leafref itself (going through schema path) to see if they match (leafref referencing itself) and in that case, throw exception. work in progress... |
| Comment by Minna Hu [ 24/Feb/15 ] |
|
Martin, thank you for your reply! Just to clarify, are you checking schema node and leafref? Or are you proposing for me to do that? Thanks! |
| Comment by Martin Ciglan [ 24/Feb/15 ] |
|
I am actually working on it, will come back to you with result |
| Comment by Robert Varga [ 11/Jun/15 ] |
|
Needs to be fixed before Lithium goes out. |
| Comment by Martin Ciglan [ 16/Jun/15 ] |
|
fix pushed: |