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

Exception happening while parsing deviation file #394

Closed
ghost opened this issue Nov 17, 2017 · 3 comments
Closed

Exception happening while parsing deviation file #394

ghost opened this issue Nov 17, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented Nov 17, 2017

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xf2e37b70 (LWP 86474)]
0xf7604185 in __strlen_sse2 () from /lib/libc.so.6
(gdb) bt
#0 0xf7604185 in strlen_sse2 () from /lib/libc.so.6
#1 0xf2e95da2 in lydict_remove (ctx=0x81e50f0, value=0x656e2d66 <Address 0x656e2d66 out of bounds>) at dict.c:123
#2 0xf2f1b773 in lys_restr_free (ctx=0x81e50f0, restr=0x81e9240, private_destructor=0x0) at tree_schema.c:1321
#3 0xf2f1ba34 in lys_type_free (ctx=0x81e50f0, type=0x820b628, private_destructor=0x0) at tree_schema.c:1982
#4 0xf2f1a9e5 in lys_leaf_free (private_destructor=, leaf=, ctx=) at tree_schema.c:2183
#5 lys_node_free (node=0x820b5e8, private_destructor=0x0, shallow=1) at tree_schema.c:2434
#6 0xf2f1c6de in lys_deviation_free (private_destructor=, dev=, module=) at tree_schema.c:2321
#7 module_free_common (module=0x81fd510, private_destructor=0x0) at tree_schema.c:2668
#8 0xf2f1cdf2 in lys_free (module=0x81fd510, private_destructor=0x0, remove_from_ctx=1) at tree_schema.c:3430
#9 0xf2eda7d2 in yin_read_module
(ctx=0x81e50f0, yin=0x8204548, revision=0x0, implement=1) at parser_yin.c:7089
#10 0xf2edd1b7 in yin_read_module (ctx=0x81e50f0,
data=0xf1ea4000 "\r\n\r\n<module xmlns="urn:ietf:params:xml:ns:yang:yin:1" name="ietf-netconf-acm-deviations-cx" xmlns:inet="urn:ietf:params:xml:ns:yang:ietf-netconf-acm-deviations-cx"..., revision=0x0, implement=1) at parser_yin.c:7106
#11 0xf2f21309 in lys_parse_mem
(ctx=0x81e50f0,
data=0xf1ea4000 "\r\n\r\n<module xmlns="urn:ietf:params:xml:ns:yang:yin:1" name="ietf-netconf-acm-deviations-cx" xmlns:inet="urn:ietf:params:xml:ns:yang:ietf-netconf-acm-deviations-cx"..., format=LYS_IN_YIN, internal=1, implement=1) at tree_schema.c:961

Is it a valid issue..please check..

@michalvasko
Copy link
Member

Hi,
you will need to provide the moduel that caused this or at least the part that caused this so I can reproduce it. Also, what libyang version did you use?

Regards,
Michal

@ghost
Copy link
Author

ghost commented Dec 7, 2017

I have defined one node like this:
<leaf name="name"> <type name="string"> <length value="1..max"/> </type> <description> <text>Arbitrary name assigned to the rule-list.</text> </description> </leaf>

In deviation file i want to restrict the length to 15, hence i added like this:
<deviation target-node="/nacm:nacm/nacm:rule-list/nacm:name"> ==> this name is the node <deviate value="replace"> <type name="string"> <length value="1..15"/> </type> </deviate> </deviation>

But during parsing it is giving exception:
#0 0xf75b4185 in strlen_sse2 () from /lib/libc.so.6
#1 0xf2f40de2 in lydict_remove (ctx=0x81e0298, value=0x656e2d66 <Address 0x656e2d66 out of bounds>) at dict.c:123
#2 0xf2fc6803 in lys_restr_free (ctx=0x81e0298, restr=0x81e4f20, private_destructor=0x0) at tree_schema.c:1321
#3 0xf2fc6ac4 in lys_type_free (ctx=0x81e0298, type=0x8206690, private_destructor=0x0) at tree_schema.c:1982
#4 0xf2fc5a75 in lys_leaf_free (private_destructor=, leaf=, ctx=) at tree_schema.c:2183
#5 lys_node_free (node=0x8206650, private_destructor=0x0, shallow=1) at tree_schema.c:2434
#6 0xf2fc776e in lys_deviation_free (private_destructor=, dev=, module=) at tree_schema.c:2321
#7 module_free_common (module=0x81f8730, private_destructor=0x0) at tree_schema.c:2668
#8 0xf2fc7e82 in lys_free (module=0x81f8730, private_destructor=0x0, remove_from_ctx=1) at tree_schema.c:3430
#9 0xf2f85862 in yin_read_module
(ctx=0x81e0298, yin=0x81f3208, revision=0x0, implement=1) at parser_yin.c:7089
#10 0xf2f88247 in yin_read_module (ctx=0x81e0298,
data=0xf1df0000 "\n<module xmlns:nacm-devs-cx="urn:ietf:params:xml:ns:yang:ietf-netconf-acm-deviations-cx" xmlns="urn:ietf:params:xml:ns:yang:yin:1" name="ietf-netconf-acm-deviatio"...,
revision=0x0, implement=1) at parser_yin.c:7106
#11 0xf2fcc399 in lys_parse_mem
(ctx=0x81e0298,
data=0xf1df0000 "\n<module xmlns:nacm-devs-cx="urn:ietf:params:xml:ns:yang:ietf-netconf-acm-deviations-cx" xmlns="urn:ietf:params:xml:ns:yang:yin:1" name="ietf-netconf-acm-deviatio"...,
format=LYS_IN_YIN, internal=1, implement=1) at tree_schema.c:961
#12 0xf2fcc503 in lys_parse_fd (ctx=0x81e0298, fd=34, format=LYS_IN_YIN) at tree_schema.c:1115
#13 0xf2fcc6ce in lys_parse_path (ctx=0x81e0298, path=0xf2ee1b18 "/home/ietf-netconf-acm-deviations-cx.yin", format=LYS_IN_YIN) at tree_schema.c:1052

Please help to check if i am doing anything wrong here?

@ghost ghost changed the title Excception happening while parsing deviation file Exception happening while parsing deviation file Dec 7, 2017
@michalvasko
Copy link
Member

Hi,
I have used this module

<?xml version="1.0" encoding="UTF-8"?>
<module name="dev"
        xmlns="urn:ietf:params:xml:ns:yang:yin:1">
    <namespace uri="urn:dev"/>
    <prefix value="d"/>
    <import module="ietf-netconf-acm">
        <prefix value="nacm"/>
    </import>
    <deviation target-node="/nacm:nacm/nacm:rule-list/nacm:name">
        <deviate value="replace">
            <type name="string">
                <length value="1..15"/>
            </type>
        </deviate>
    </deviation>
</module>

and did not find any problem so I will need your exact copy if I am to reproduce it. If it cannot be public, you can send it to me via email or try to isolate the problematic part.

Regards,
Michal

@michalvasko michalvasko closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant