{"id":20790619,"url":"https://github.com/ryanashcraft/badaccessplayground","last_synced_at":"2025-04-15T01:43:30.058Z","repository":{"id":198143299,"uuid":"700089664","full_name":"ryanashcraft/BadAccessPlayground","owner":"ryanashcraft","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-10T01:34:35.000Z","size":15242,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T12:12:05.832Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/ryanashcraft.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":"2023-10-03T23:27:49.000Z","updated_at":"2025-02-23T23:23:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"e8ec6027-5fa9-42ea-ba51-c40a7ecdeb4f","html_url":"https://github.com/ryanashcraft/BadAccessPlayground","commit_stats":null,"previous_names":["ryanashcraft/badaccessplayground"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanashcraft%2FBadAccessPlayground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanashcraft%2FBadAccessPlayground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanashcraft%2FBadAccessPlayground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanashcraft%2FBadAccessPlayground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanashcraft","download_url":"https://codeload.github.com/ryanashcraft/BadAccessPlayground/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248991516,"owners_count":21194893,"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-17T15:36:13.026Z","updated_at":"2025-04-15T01:43:30.042Z","avatar_url":"https://github.com/ryanashcraft.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BadAccessPlayground\n\nI'm trying to understand why this unit test (often) produces EXC_BAD_ACCESS errors. Is the code doing something unsafe? Take a look at [CombineTests.swift](/BadAccessPlaygroundTests/CombineTests.swift).\n\n## Instructions\n\n1. Open BadAccessPlayground.xcodeproj in Xcode 15\n2. Run the testBadAccess() test in CombineTests.swift [repeatedly until failure](https://www.avanderlee.com/debugging/flaky-tests-test-repetitions/). Recommended 10000+ max iterations.\n3. Repeat until you witness a EXC_BAD_ACCESS error\n\n## Additional Tests\n\n- See the simplified test case testBadAccessSimplified(), which removes the usage of the Store class and managing cancellable handlers.\n- See testBadAccess() in OpenCombineTests.swift, which uses [OpenCombine](https://github.com/OpenCombine/OpenCombine) instead of Apple's Combine. A EXC_BAD_ACCESS error can also be observed.\n- See testNoBadAccess() in PromisesTests.swift, which uses [Promises](https://github.com/google/promises) to implement a similar test case. This test does not seem to exhibit a EXC_BAD_ACCESS error.\n\n## Screenshots\n\n![Screenshot of Xcode with an EXC_BAD_ACCESS from running testBadAccess in CombineTests](/screenshots/combine.png)\n![Screenshot of Xcode with an EXC_BAD_ACCESS from running testBadAccess in OpenCombineTests](/screenshots/opencombine.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanashcraft%2Fbadaccessplayground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanashcraft%2Fbadaccessplayground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanashcraft%2Fbadaccessplayground/lists"}