{"id":19115393,"url":"https://github.com/polytypic/signal-issue","last_synced_at":"2025-07-01T02:36:02.951Z","repository":{"id":238903392,"uuid":"797646522","full_name":"polytypic/signal-issue","owner":"polytypic","description":"SIGSEGV or SIGBUS with OCaml 5.1.1+ when using signals","archived":false,"fork":false,"pushed_at":"2024-05-09T06:59:41.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T12:14:41.796Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/polytypic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-08T08:42:26.000Z","updated_at":"2024-05-09T06:59:44.000Z","dependencies_parsed_at":"2024-05-08T19:45:56.373Z","dependency_job_id":"3d746fe1-2087-4a28-a004-935e9e41cf4e","html_url":"https://github.com/polytypic/signal-issue","commit_stats":null,"previous_names":["polytypic/signal-issue"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/polytypic/signal-issue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polytypic%2Fsignal-issue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polytypic%2Fsignal-issue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polytypic%2Fsignal-issue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polytypic%2Fsignal-issue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polytypic","download_url":"https://codeload.github.com/polytypic/signal-issue/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polytypic%2Fsignal-issue/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262884174,"owners_count":23379345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T04:46:16.038Z","updated_at":"2025-07-01T02:36:02.912Z","avatar_url":"https://github.com/polytypic.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Steps to reproduce\n\n```sh\nwhile                                       \\\n  if dune exec -- ./signal_issue.exe; then  \\\n    echo OK;                                \\\n  else                                      \\\n    echo \"ERROR: $?\";                       \\\n    return 1;                               \\\n  fi;                                       \\\ndo                                          \\\n  echo;                                     \\\ndone\n```\n\nThe above will sooner or later stop and the last line will read `ERROR: 138` or\n`ERROR: 139` indicating a `SIGBUS` or `SIGSEGV`.\n\nRunning the program under `lldb` on macOS with e.g.\n\n```sh\nlldb                                        \\\n  --file ./_build/default/signal_issue.exe  \\\n  -o 'pro hand -p true -s false SIGUSR2'    \\\n  -o run\n```\n\nand you get lucky, the program stops at either\n\n```\n* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)\n    frame #0: 0x00000001000b6e10 signal_issue.exe`caml_runstack + 108\nsignal_issue.exe`caml_runstack:\n-\u003e  0x1000b6e10 \u003c+108\u003e: ldr    x26, [x16, #0x8]\n    0x1000b6e14 \u003c+112\u003e: str    x26, [x28, #0x30]\n    0x1000b6e18 \u003c+116\u003e: ldr    x21, [x16]\n    0x1000b6e1c \u003c+120\u003e: ldr    x16, [x28, #0x40]\n```\n\nor\n\n```\n* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x128100000)\n    frame #0: 0x000000018723b200 libsystem_platform.dylib`_platform_memmove + 96\nlibsystem_platform.dylib`:\n-\u003e  0x18723b200 \u003c+96\u003e:  ldnp   q0, q1, [x1]\n    0x18723b204 \u003c+100\u003e: add    x1, x1, #0x20\n    0x18723b208 \u003c+104\u003e: subs   x2, x2, #0x20\n    0x18723b20c \u003c+108\u003e: b.hi   0x18723b1f8               ; \u003c+88\u003e\n```\n\nThe program in this repository is a stripped down version of the test program\n[test_server_and_client](https://github.com/ocaml-multicore/picos/blob/234256f2a4f8f3ce3c7ffc96ff4ac3e474393e1a/test/test_server_and_client.ml#L1-L133)\nin Picos. Signals are used to force a blocking system call to return. The\nstripped down version of the program here is modified to remove all uses of\n\"unsafe\" OCaml features (which are evidently not the cause of this issue).\n\nThe problem has also been reproduced by Edwin Török:\n\n\u003e I tried 5.1.1 on aarch64 (my Android phone, using UserLand and\n\u003e `opam init --disable-sandboxing`). It does reproduce the problem (well the\n\u003e program just exits).\n\nSo, this does not seem to be an OS-specific issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolytypic%2Fsignal-issue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolytypic%2Fsignal-issue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolytypic%2Fsignal-issue/lists"}