{"action":"created","issue":{"url":"https://api.github.com/repos/CESNET/libyang/issues/83","repository_url":"https://api.github.com/repos/CESNET/libyang","labels_url":"https://api.github.com/repos/CESNET/libyang/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/CESNET/libyang/issues/83/comments","events_url":"https://api.github.com/repos/CESNET/libyang/issues/83/events","html_url":"https://github.com/CESNET/libyang/issues/83","id":162890815,"number":83,"title":"Libyanag lyd_new_path crashes","user":{"login":"lukasmacko","id":16013493,"avatar_url":"https://avatars.githubusercontent.com/u/16013493?v=3","gravatar_id":"","url":"https://api.github.com/users/lukasmacko","html_url":"https://github.com/lukasmacko","followers_url":"https://api.github.com/users/lukasmacko/followers","following_url":"https://api.github.com/users/lukasmacko/following{/other_user}","gists_url":"https://api.github.com/users/lukasmacko/gists{/gist_id}","starred_url":"https://api.github.com/users/lukasmacko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukasmacko/subscriptions","organizations_url":"https://api.github.com/users/lukasmacko/orgs","repos_url":"https://api.github.com/users/lukasmacko/repos","events_url":"https://api.github.com/users/lukasmacko/events{/privacy}","received_events_url":"https://api.github.com/users/lukasmacko/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-06-29T10:20:46Z","updated_at":"2016-06-30T07:45:09Z","closed_at":"2016-06-30T07:43:33Z","body":"Libyang crashes when the value of existing string leaf is set to `NULL`\r\n\r\n````\r\nProgram received signal SIGSEGV, Segmentation fault.\r\n__strcmp_ssse3 () at ../sysdeps/x86_64/multiarch/../strcmp.S:210\r\n210\t../sysdeps/x86_64/multiarch/../strcmp.S: No such file or directory.\r\n(gdb) bt\r\n#0  __strcmp_ssse3 () at ../sysdeps/x86_64/multiarch/../strcmp.S:210\r\n#1  0x00007ffff7136915 in lyd_change_leaf (leaf=0x74f710, val_str=0x0) at /home/lukas/playground/libyang/src/tree_data.c:433\r\n#2  0x00007ffff71373e5 in lyd_new_path (data_tree=0x71f640, ctx=0x70b990, path=0x4c3900 \"/test-module:main/string\", value=0x0, options=1) at /home/lukas/playground/libyang/src/tree_data.c:758\r\n#3  0x000000000046e5f1 in dm_lyd_new_path (dm_ctx=0x70a040, data_info=0x757c40, ctx=0x70b990, path=0x4c3900 \"/test-module:main/string\", value=0x0, options=1)\r\n    at /home/lukas/workspace/sysrepo/src/data_manager.c:3146\r\n#4  0x00000000004479a6 in rp_dt_set_item (dm_ctx=0x70a040, session=0x749600, xpath=0x4c3900 \"/test-module:main/string\", options=SR_EDIT_DEFAULT, value=0x724810)\r\n    at /home/lukas/workspace/sysrepo/src/rp_dt_edit.c:409\r\n#5  0x000000000044a53a in rp_dt_set_item_wrapper (rp_ctx=0x6f9760, session=0x74f210, xpath=0x4c3900 \"/test-module:main/string\", val=0x724810, opt=0) at /home/lukas/workspace/sysrepo/src/rp_dt_edit.c:563\r\n#6  0x0000000000416f2f in empty_string_leaf_test (state=0x6f3530) at /home/lukas/workspace/sysrepo/tests/rp_dt_edit_test.c:2001\r\n#7  0x00007ffff7bd5176 in cmocka_run_one_test_or_fixture (function_name=0x4c405f \"empty_string_leaf_test\", test_func=0x416e70 <empty_string_leaf_test>, setup_func=0x0, teardown_func=0x0, state=0x6f3530, \r\n    heap_check_point=0x0) at /home/lukas/playground/cmocka/src/cmocka.c:2534\r\n#8  0x00007ffff7bd5423 in cmocka_run_one_tests (test_state=0x6f3520) at /home/lukas/playground/cmocka/src/cmocka.c:2642\r\n#9  0x00007ffff7bd5835 in _cmocka_run_group_tests (group_name=0x4c40ba \"tests\", tests=0x4c40c0 <main.tests>, num_tests=31, group_setup=0x40f910 <setup>, group_teardown=0x40f940 <teardown>)\r\n    at /home/lukas/playground/cmocka/src/cmocka.c:2757\r\n#10 0x0000000000417058 in main () at /home/lukas/workspace/sysrepo/tests/rp_dt_edit_test.c:2231\r\n"},"comment":{"url":"https://api.github.com/repos/CESNET/libyang/issues/comments/229585010","html_url":"https://github.com/CESNET/libyang/issues/83#issuecomment-229585010","issue_url":"https://api.github.com/repos/CESNET/libyang/issues/83","id":229585010,"user":{"login":"michalvasko","id":12510224,"avatar_url":"https://avatars.githubusercontent.com/u/12510224?v=3","gravatar_id":"","url":"https://api.github.com/users/michalvasko","html_url":"https://github.com/michalvasko","followers_url":"https://api.github.com/users/michalvasko/followers","following_url":"https://api.github.com/users/michalvasko/following{/other_user}","gists_url":"https://api.github.com/users/michalvasko/gists{/gist_id}","starred_url":"https://api.github.com/users/michalvasko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalvasko/subscriptions","organizations_url":"https://api.github.com/users/michalvasko/orgs","repos_url":"https://api.github.com/users/michalvasko/repos","events_url":"https://api.github.com/users/michalvasko/events{/privacy}","received_events_url":"https://api.github.com/users/michalvasko/received_events","type":"User","site_admin":false},"created_at":"2016-06-30T07:45:09Z","updated_at":"2016-06-30T07:45:09Z","body":"Hi,\r\nyou are right, I introduced this issue yesterday. It should be fixed now, but your example code (correctly) leaks memory, if you use it somewhere directly.\r\n\r\nRegards,\r\nMichal"}}
{"actor":{"display_login":"michalvasko"}}