Title: Segmentation fault after referring a freed-up node · Issue #122 · CESNET/libyang-python · GitHub
Open Graph Title: Segmentation fault after referring a freed-up node · Issue #122 · CESNET/libyang-python
X Title: Segmentation fault after referring a freed-up node · Issue #122 · CESNET/libyang-python
Description: Using the example in README, there are at least 2 ways to hit segmentation fault, using v3.0.2. Requesting a fix or guide towards proper usage if the below seems incorrect. Intention is to delete nodes based on some conditions. >>> impor...
Open Graph Description: Using the example in README, there are at least 2 ways to hit segmentation fault, using v3.0.2. Requesting a fix or guide towards proper usage if the below seems incorrect. Intention is to delete n...
X Description: Using the example in README, there are at least 2 ways to hit segmentation fault, using v3.0.2. Requesting a fix or guide towards proper usage if the below seems incorrect. Intention is to delete n...
Opengraph URL: https://github.com/CESNET/libyang-python/issues/122
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Segmentation fault after referring a freed-up node","articleBody":"Using the example in README, there are at least 2 ways to hit segmentation fault, using v3.0.2.\r\nRequesting a fix or guide towards proper usage if the below seems incorrect.\r\nIntention is to delete nodes based on some conditions.\r\n```\r\n\u003e\u003e\u003e import libyang\r\n\u003e\u003e\u003e ctx = libyang.Context()\r\n\u003e\u003e\u003e module = ctx.parse_module_str('''\r\nmodule example {\r\n namespace \"urn:example\";\r\n prefix \"ex\";\r\n container data {\r\n list interface {\r\n key name;\r\n leaf name {\r\n type string;\r\n }\r\n leaf address {\r\n type string;\r\n }\r\n }\r\n leaf hostname {\r\n type string;\r\n }\r\n }\r\n}\r\n''')\r\n\u003e\u003e\u003e node = module.parse_data_dict({\r\n 'data': {\r\n 'hostname': 'foobar',\r\n 'interface': [\r\n {'name': 'eth0', 'address': '1.2.3.4/24'},\r\n {'name': 'lo', 'address': '127.0.0.1'},\r\n ],\r\n },\r\n})\r\n\u003e\u003e\u003e nodes = list(node.find_all(\"/example:data\"))\r\n\u003e\u003e\u003e nodes[0].free(with_siblings=False)\r\n\u003e\u003e\u003e print(node.print_mem('json', pretty=True)) # OR print(node.find_path(\"/example:data\"))\r\n```","author":{"url":"https://github.com/Unniboy","@type":"Person","name":"Unniboy"},"datePublished":"2024-09-04T00:21:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/122/libyang-python/issues/122"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5607399e-40ce-f88f-47ed-5f2f8afb13d9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CDBA:2B81A2:ADA7E9:EE0E30:6969EACA |
| html-safe-nonce | 43c9fb5a8c71a8c901ae5098f34183094b6e9564f8d01bfd498530d4b783abf2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDREJBOjJCODFBMjpBREE3RTk6RUUwRTMwOjY5NjlFQUNBIiwidmlzaXRvcl9pZCI6IjM0MzYwOTQ5OTk1OTU5NjkyMjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 74d9dc8215c981a02e64629ffc59917a8abfa9bf622f173f911bb9982778a326 |
| hovercard-subject-tag | issue:2504042453 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/CESNET/libyang-python/122/issue_layout |
| twitter:image | https://opengraph.githubassets.com/169ff4c99b4fbf4102d62bdfed6722638ad410a17509190bf0d1cb3aa718fbff/CESNET/libyang-python/issues/122 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/169ff4c99b4fbf4102d62bdfed6722638ad410a17509190bf0d1cb3aa718fbff/CESNET/libyang-python/issues/122 |
| og:image:alt | Using the example in README, there are at least 2 ways to hit segmentation fault, using v3.0.2. Requesting a fix or guide towards proper usage if the below seems incorrect. Intention is to delete n... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Unniboy |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| turbo-cache-control | no-preview |
| go-import | github.com/CESNET/libyang-python git https://github.com/CESNET/libyang-python.git |
| octolytics-dimension-user_id | 1116469 |
| octolytics-dimension-user_login | CESNET |
| octolytics-dimension-repository_id | 275748507 |
| octolytics-dimension-repository_nwo | CESNET/libyang-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 275748507 |
| octolytics-dimension-repository_network_root_nwo | CESNET/libyang-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width