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: patch-diff.githubusercontent.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:71b4a7ff-259e-bee6-6167-ce9cc587003b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A78C:28E662:5C5923:777459:698D5AB1 |
| html-safe-nonce | d204dbe4c170c0cc54dc31a15989a78ac0756b9c85ffa975bd2306783669f63c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzhDOjI4RTY2Mjo1QzU5MjM6Nzc3NDU5OjY5OEQ1QUIxIiwidmlzaXRvcl9pZCI6IjY0NDIzNDA2NDI0MjA3NzU2MDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f7010cb59d61c22ef589a6423ae0b8c383f9ad6c84bd9a33dec916977e2cfeee |
| 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 | c0818105fa276287e9369cfdefa0a0fa7953719791ceff9b94d69623c0a4fe8a |
| 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 | a95a17cc440c14d4fcddc0641bc1136fa8d908f0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width