Title: Segmentation fault upon print_dict · Issue #136 · CESNET/libyang-python · GitHub
Open Graph Title: Segmentation fault upon print_dict · Issue #136 · CESNET/libyang-python
X Title: Segmentation fault upon print_dict · Issue #136 · CESNET/libyang-python
Description: Requesting help to get past the segmentation fault. libyang: v2.1.148 libyang-python: v2.8.4 The following set of operations result in segmentation fault. Intermediate unrelated steps modifying dtree(play_tree after loading classroom) co...
Open Graph Description: Requesting help to get past the segmentation fault. libyang: v2.1.148 libyang-python: v2.8.4 The following set of operations result in segmentation fault. Intermediate unrelated steps modifying dtr...
X Description: Requesting help to get past the segmentation fault. libyang: v2.1.148 libyang-python: v2.8.4 The following set of operations result in segmentation fault. Intermediate unrelated steps modifying dtr...
Opengraph URL: https://github.com/CESNET/libyang-python/issues/136
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Segmentation fault upon print_dict","articleBody":"Requesting help to get past the segmentation fault.\nlibyang: v2.1.148\nlibyang-python: v2.8.4\n\nThe following set of operations result in segmentation fault. Intermediate unrelated steps modifying dtree(play_tree after loading classroom) could be a premonition of the eventual segmentation fault. \nCouldn't see anything wrong with the yangs themselves, given dtree was generated.\n```\n\u003e\u003e\u003e import libyang\n\u003e\u003e\u003e ctx = libyang.Context('poc')\n\u003e\u003e\u003e\n\u003e\u003e\u003e play_mod= ctx.load_module('playroom')\n\u003e\u003e\u003e play_dict={'playroom-container':{'playroom-list': [{'name': 'dodge', 'play': 'gogogo'}]}}\n\u003e\u003e\u003e play_tree = play_mod.parse_data_dict(play_dict, validate=False)\n\u003e\u003e\u003e\n\u003e\u003e\u003e play_tree.print_dict()\n{'playroom-container': {'playroom-list': [{'name': 'dodge', 'play': 'gogogo'}]}}\n\u003e\u003e\u003e\n\u003e\u003e\u003e\n\u003e\u003e\u003e class_mod= ctx.load_module('classroom')\n\u003e\u003e\u003e\n\u003e\u003e\u003e\n\u003e\u003e\u003e play_tree.print_dict()\n{'playroom-container': {}}\n\u003e\u003e\u003e\n\u003e\u003e\u003e\n\u003e\u003e\u003e class_dict={'classroom-container': {'classroom-list': [{'name': 'grade5', 'teacher-present': True, 'shout': 'wohoo'}]}}\n\u003e\u003e\u003e class_tree = class_mod.parse_data_dict(class_dict, validate=False)\n\u003e\u003e\u003e\n\u003e\u003e\u003e\n\u003e\u003e\u003e class_tree.print_dict()\n{'classroom-container': {'classroom-list': [{'name': 'grade5', 'teacher-present': True, 'shout': 'wohoo'}]}}\n\u003e\u003e\u003e\n\u003e\u003e\u003e\n\u003e\u003e\u003e play_tree.print_dict()\nSegmentation fault\n```\n\nThe yang definitions are as below:\n```\nmodule str-types {\n\tnamespace \"http://str-types\";\n\tprefix \"str-types\";\n\ttypedef name-type {\n\t\ttype string;\n\t}\n\tgrouping chaos {\n\t\tleaf shout {\n\t\t\ttype name-type;\n\t\t}\n\t}\n}\n```\n```\nmodule playroom {\n\tnamespace \"http://playroom\";\n\tprefix \"playroom\";\n\timport str-types { prefix str-types; }\n\tcontainer playroom-container {\n\t\tlist playroom-list {\n\t\t\tkey \"name\";\n\t\t\tleaf name {\n\t\t\t\ttype string;\n\t\t\t}\n\n\t\t\tleaf play {\n\t\t\t\ttype str-types:name-type;\n\t\t\t}\n\t\t}\n\t}\n}\n```\n```\nmodule classroom {\n\tnamespace \"http://classroom\";\n\tprefix \"classroom\";\n\timport str-types { prefix str-types; }\n\tcontainer classroom-container {\n\t\tlist classroom-list {\n\t\t\tkey \"name\";\n\t\t\tleaf name {\n\t\t\t\ttype string;\n\t\t\t}\n\t\t\tleaf teacher-present {\n\t\t\t\ttype boolean;\n\t\t\t}\n\n\t\t\tuses str-types:chaos {\n\t\t\t\twhen \"not(./teacher-present) or ./teacher-present = 'false'\";\n\t\t\t}\n\t\t\tleaf study {\n\t\t\t\twhen \"../teacher-present and ../teacher-present = 'true'\";\n\t\t\t\ttype str-types:name-type;\n\t\t\t}\n\t\t}\n\t}\n}\n```","author":{"url":"https://github.com/Unniboy","@type":"Person","name":"Unniboy"},"datePublished":"2025-04-01T03:18:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/136/libyang-python/issues/136"}
| 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:e2961a11-0fbf-8e4e-19f0-9af7705564db |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E244:345820:A7B24F:E4BD7E:6969EA23 |
| html-safe-nonce | 5aa08719519a07f97b2b6e0baa0e8ca4cfee9d61468086f6a872d42bcecade5b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjQ0OjM0NTgyMDpBN0IyNEY6RTRCRDdFOjY5NjlFQTIzIiwidmlzaXRvcl9pZCI6IjI5MzcwODQxODEzNjA1MzYxMDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 39b27712b16b3bedc9fbf5e97b1d0d983a426e4c98b0e25082c3b6dbdc5a183a |
| hovercard-subject-tag | issue:2962109425 |
| 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/136/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b5cc3e8b69f2dced755fbf266aa3fec19b813f4f353d3e8fb2f9b7dfbd4e92cf/CESNET/libyang-python/issues/136 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b5cc3e8b69f2dced755fbf266aa3fec19b813f4f353d3e8fb2f9b7dfbd4e92cf/CESNET/libyang-python/issues/136 |
| og:image:alt | Requesting help to get past the segmentation fault. libyang: v2.1.148 libyang-python: v2.8.4 The following set of operations result in segmentation fault. Intermediate unrelated steps modifying dtr... |
| 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