Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libyang2 segfault while parsing schema #1403

Closed
awesomenode opened this issue Feb 1, 2021 · 2 comments
Closed

libyang2 segfault while parsing schema #1403

awesomenode opened this issue Feb 1, 2021 · 2 comments
Labels
is:bug Bug description. status:completed From the developer perspective, the issue was solved (bug fixed, question answered,...)

Comments

@awesomenode
Copy link

Hi!

I made a dummy YANG module, which augments ietf-interfaces. Libyang segfaults, when I
try to parse it using lys_parse().

The error appeared after I inserted some dummy description to each leaf, if I remove them,
the libyang successfully proceeds.

Here is the backtrace from the core dump:

#0 0x00007fdfb032aff0 in lys_compile_unres_xpath (ctx=0x7ffe520f78e0, node=0x5590a9e85390, unres=0x7ffe520f89c0) at libyang/src/schema_compile.c:998
#1 0x00007fdfb032c1f0 in lys_compile_unres_glob (ctx=0x5590a9e43260, unres=0x7ffe520f89c0) at libyang/src/schema_compile.c:1351
#2 0x00007fdfb0350e9d in lys_parse (ctx=0x5590a9e43260, in=0x5590a9e64a60, format=LYS_IN_YANG, features=0x0, module=0x0) at libyang/src/tree_schema.c:1278
#3 0x00005590a8251098 in add_yang_files (ctx=0x5590a9e43260) at ly_test.c:48
#4 0x00005590a825115c in main () at ly_test.c:61

I attached the YANG files and the parser code.

libyang2 version: 2d5f6df
if_error.tar.gz

Thanks!

@michalvasko
Copy link
Member

Should work properly now.

@michalvasko michalvasko added is:bug Bug description. status:completed From the developer perspective, the issue was solved (bug fixed, question answered,...) labels Feb 3, 2021
@awesomenode
Copy link
Author

Yes, it works fine now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:bug Bug description. status:completed From the developer perspective, the issue was solved (bug fixed, question answered,...)
Projects
None yet
Development

No branches or pull requests

2 participants