Title: Segmentation fault Error when script exists · Issue #2 · healeycodes/untrusted-python · GitHub
Open Graph Title: Segmentation fault Error when script exists · Issue #2 · healeycodes/untrusted-python
X Title: Segmentation fault Error when script exists · Issue #2 · healeycodes/untrusted-python
Description: When I run the python file below, it will throw following error after python exist: Segmentation fault (core dumped) Here is my source code: # -*- coding: utf-8 -*- import json import sys filter = None defaction = 0 try: import seccomp e...
Open Graph Description: When I run the python file below, it will throw following error after python exist: Segmentation fault (core dumped) Here is my source code: # -*- coding: utf-8 -*- import json import sys filter = ...
X Description: When I run the python file below, it will throw following error after python exist: Segmentation fault (core dumped) Here is my source code: # -*- coding: utf-8 -*- import json import sys filter = ...
Opengraph URL: https://github.com/healeycodes/untrusted-python/issues/2
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Segmentation fault Error when script exists","articleBody":"When I run the python file below, it will throw following error after python exist:\n\n\u003e Segmentation fault (core dumped)\n\nHere is my source code:\n```\n# -*- coding: utf-8 -*-\n\nimport json\nimport sys\n\nfilter = None\ndefaction = 0\ntry:\n import seccomp\nexcept ImportError:\n # pip3 install pyseccomp -i https://mirrors.aliyun.com/pypi/simple\n import pyseccomp as seccomp\nfinally:\n # respond with EPERM: operation not permitted so users can tell\n # they're being blocked from doing something\n defaction = seccomp.ERRNO(seccomp.errno.EPERM)\n filter = seccomp.SyscallFilter(seccomp.ERRNO(seccomp.errno.EPERM))\n\n # allow `write`ing to two already-opened files stdout and stderr\n filter.add_rule(\n seccomp.ALLOW, \"write\", seccomp.Arg(0, seccomp.EQ, sys.stdout.fileno())\n )\n filter.add_rule(\n seccomp.ALLOW, \"write\", seccomp.Arg(0, seccomp.EQ, sys.stderr.fileno())\n )\n\n # load the filter in the kernel\n filter.load()\n\nfrom typing import Dict, Any\nArgs = Dict[str, Any]\ndef main(args:Args) -\u003e dict:\n return {\n \"result\": args[\"input\"] + args[\"input\"]\n }\n\n# decode and prepare input dict\ninputs_obj = {'input': '1'}\n\n# execute main function\noutput_obj = main(inputs_obj)\n\n# convert output to json and print\noutput_json = json.dumps(output_obj, indent=4, ensure_ascii=False)\nprint(output_json)\n```\n\nMy env is ubuntu 22, python3.10.\n\nThx","author":{"url":"https://github.com/jamesliu668","@type":"Person","name":"jamesliu668"},"datePublished":"2025-04-18T03:45:06.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2/untrusted-python/issues/2"}
| 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:c47bc85c-786f-9f45-9bb9-6e36b1eb1bba |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8ECA:3A955:C2EDDE:110E002:6970BC63 |
| html-safe-nonce | 16225a23166e3ec589816fe5665c2917155bdcee24e98891dae94d6ae38b5dbf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RUNBOjNBOTU1OkMyRURERToxMTBFMDAyOjY5NzBCQzYzIiwidmlzaXRvcl9pZCI6IjU5MzAwNjA3MTE3MDEwMzYxMzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c3e32a8abfaf2cc1e968c3d7cc64cab36ee9dbeb0459700cd4e871f6e4c194f9 |
| hovercard-subject-tag | issue:3003883744 |
| 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/healeycodes/untrusted-python/2/issue_layout |
| twitter:image | https://opengraph.githubassets.com/61fb3331e60c45dcf359e3e0a64b216c9f26e0bb4e05f6d1d9f4c4a9fd1bab4e/healeycodes/untrusted-python/issues/2 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/61fb3331e60c45dcf359e3e0a64b216c9f26e0bb4e05f6d1d9f4c4a9fd1bab4e/healeycodes/untrusted-python/issues/2 |
| og:image:alt | When I run the python file below, it will throw following error after python exist: Segmentation fault (core dumped) Here is my source code: # -*- coding: utf-8 -*- import json import sys filter = ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jamesliu668 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8e0be80373b724b033cdf8a7b1f78bf5fb6a5d7a2182a9a403aa30894606e390 |
| turbo-cache-control | no-preview |
| go-import | github.com/healeycodes/untrusted-python git https://github.com/healeycodes/untrusted-python.git |
| octolytics-dimension-user_id | 34559231 |
| octolytics-dimension-user_login | healeycodes |
| octolytics-dimension-repository_id | 668573392 |
| octolytics-dimension-repository_nwo | healeycodes/untrusted-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 668573392 |
| octolytics-dimension-repository_network_root_nwo | healeycodes/untrusted-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 | 84d9d5bf3b01412ea10f7c2429cbfc735ccce9ce |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width