the following yang file causes a segmentation fault in lys_parse_path, caused by a stack overflow due to too many function calls.
module mod1 {
namespace "urn:all";
prefix av;
yang-version 1.1;
leaf l1 {
type union-type;
}
leaf-list list5 {
type string;
}
typedef union-type {
type union {
type leafref {
path /list5;
}
type union-type;
}
}
}
The issue seems to be caused due to the self-referential union-type type containing a leaf-ref.
If the list5 leaf-list is removed, the issue persists, but the stack overflow takes longer to appear.
A gdb backtrace shows that the call stack is full of lys_copy_union_leafrefs calls, called in src/tree_schema.c:1903 and src/tree_schema.c:1887.
Regards,
Juraj
The text was updated successfully, but these errors were encountered:
Also, thanks for the nice issue reports but it is great already when you provide a simple model that can be used for reproducing the issue. No other information is necessary and you can save yourself the trouble.
I've tested all the files that I reported that caused issues for libyang 1 so far, and this is the only one that causes a segmentation fault for the new parser in libyang2.
Hi,
the following yang file causes a segmentation fault in lys_parse_path, caused by a stack overflow due to too many function calls.
The issue seems to be caused due to the self-referential union-type type containing a leaf-ref.
If the list5 leaf-list is removed, the issue persists, but the stack overflow takes longer to appear.
A gdb backtrace shows that the call stack is full of lys_copy_union_leafrefs calls, called in src/tree_schema.c:1903 and src/tree_schema.c:1887.
Regards,
Juraj
The text was updated successfully, but these errors were encountered: