[YANGTOOLS-522] Loop in typedefs causes stack overflow during compilation Created: 05/Oct/15  Updated: 10/Apr/22  Resolved: 27/Nov/15

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Peter Braun Assignee: Peter Kajsa
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Text File build.log    
External issue ID: 4410

 Description   

The following kind of loop in the typedefs causes stack overflow error during the compilation of the yang file:

typedef foo

{ type bar; }

typedef bar

{ type foo; }

The compiler should provide descriptive error message instead.



 Comments   
Comment by Tony Tkacik [ 05/Oct/15 ]

On which branch you are observing this issue? It is Helium, Lithium or Beryllium development versoin?

Comment by Peter Braun [ 05/Oct/15 ]

Yeah sorry. I forgot to mention that this one was observed on the master branch.

Comment by Tony Tkacik [ 05/Oct/15 ]

COuld you attach stack-trace? We switched implementaiton of YANG Parser,
and it would be helpful to pin-point source of stack overflow (new parser, old parser, java API generator).

I agree it should throw more specific error.

Comment by Tony Tkacik [ 05/Oct/15 ]

COuld you attach stack-trace? We switched implementaiton of YANG Parser,
and it would be helpful to pin-point source of stack overflow (new parser, old parser, java API generator).

I agree it should throw more specific error.

Comment by Peter Braun [ 05/Oct/15 ]

I attached the build log.

Here is the input yang:

pbraun@sdn-pc:~/work/sdn/dev/overflow/api$ cat src/main/yang/overflow.yang
// Contents of "overflow"
module overflow {
namespace "urn:opendaylight:overflow";
prefix "overflow";

revision 2015-10-05

{ description "Initial revision"; }

typedef foo

{ type bar; }

typedef bar

{ type foo; }

}

Comment by Peter Braun [ 05/Oct/15 ]

Attachment build.log has been added with description: Build log including the stack trace

Comment by Peter Kajsa [ 20/Oct/15 ]

fix: https://git.opendaylight.org/gerrit/#/c/28555/

Generated at Wed Feb 07 20:53:30 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.