{"id":29904528,"url":"https://github.com/wujingcheng7/zombiehunter","last_synced_at":"2026-04-15T22:35:57.018Z","repository":{"id":303949224,"uuid":"1016674656","full_name":"wujingcheng7/ZombieHunter","owner":"wujingcheng7","description":"Find wild pointer / dangling pointer / zombie object in iOS; 发现 iOS 的野指针/悬垂指针/僵尸对象","archived":false,"fork":false,"pushed_at":"2025-08-01T03:28:19.000Z","size":69,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-01T03:49:33.418Z","etag":null,"topics":["cocoapod","dangling-pointers","ios","objective-c","pod","zombie"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wujingcheng7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-07-09T11:03:16.000Z","updated_at":"2025-08-01T03:27:57.000Z","dependencies_parsed_at":"2025-07-10T17:26:23.842Z","dependency_job_id":"bea531cb-159f-4f87-9d13-f5bca42b02b2","html_url":"https://github.com/wujingcheng7/ZombieHunter","commit_stats":null,"previous_names":["wujingcheng7/zombiehunter"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/wujingcheng7/ZombieHunter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wujingcheng7%2FZombieHunter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wujingcheng7%2FZombieHunter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wujingcheng7%2FZombieHunter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wujingcheng7%2FZombieHunter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wujingcheng7","download_url":"https://codeload.github.com/wujingcheng7/ZombieHunter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wujingcheng7%2FZombieHunter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268272395,"owners_count":24223784,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cocoapod","dangling-pointers","ios","objective-c","pod","zombie"],"created_at":"2025-08-01T18:01:22.710Z","updated_at":"2026-04-15T22:35:56.971Z","avatar_url":"https://github.com/wujingcheng7.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ZombieHunter\n\n| Helps detect wild pointers/zombie objects/dangling references in iOS projects early, supports OC/C\n\n![CocoaPods Version](https://img.shields.io/cocoapods/v/ZombieHunter.svg?style=flat)\n![Platform](https://img.shields.io/cocoapods/p/ZombieHunter.svg?style=flat)\n![License](https://img.shields.io/cocoapods/l/ZombieHunter.svg?style=flat)\n\n## [中文介绍](README_CN.md)\n\n## Features\n\n### Objective-C Objects\n\n- Expose OC zombie objects early\n- Provide detailed information when exposed:\n  - Class name\n  - Method name\n  - Object address\n  - Stack trace when object was deallocated\n  - Stack trace when object was called\n- Offers 4 monitoring strategies:\n  - Monitor all objects (with mandatory class filtering) (default strategy)\n  - Monitor only custom objects\n  - Use blacklist\n  - Use whitelist\n- Configurable maximum memory usage (default: 10MB)\n- Configurable whether to record deallocation stack (default: YES)\n- Configurable whether to crash when zombie is detected (default: YES)\n- Can use Symbolicating.py file to symbolize stack traces\n\n### C Pointers\n\n- Expose wild pointers early\n- Configurable maximum memory usage (default: 10MB)\n\n## Usage\n\n### Podfile Code\n\n```ruby\npod 'ZombieHunter'\n# If you only want to use in Debug mode:\n# pod 'ZombieHunter', :configurations =\u003e ['Debug', 'Inhouse', 'Dev']\n```\n\n### Starting and Stopping Monitoring\n\n```Objective-C\n@import ZombieHunter; // import pod\n\n- (void)whenEverYourWantToStartMonitorZombie {\n    // Create default config with separate settings for cConfig and ocConfig\n    WJCZombieHunterConfig *config = [WJCZombieHunterConfig new];\n\n    // Custom NSObject wild pointer settings\n    config.ocConfig.shouldWork = YES; // Whether to detect NSObject objects\n    config.ocConfig.crashWhenDetectedZombie = YES; // Whether to crash immediately when wild pointer is detected\n    config.ocConfig.detectStrategy = WJCZombieOCDetectStrategyAll; // Custom monitoring strategy\n    config.ocConfig.traceDeallocStack = YES; // Whether to record call stack when object is first deallocated\n    config.ocConfig.whiteList = nil; // Custom whitelist (requires config.ocConfig.detectStrategy = .whitelist)\n    config.ocConfig.blackList = nil; // Custom blacklist (requires config.ocConfig.detectStrategy = .blacklist)\n    config.ocConfig.filterList = nil; // Custom filter list\n    config.ocConfig.maxOccupyMemorySizeBytes = 50 * 1024 * 1024; // Custom max memory cache\n    config.ocConfig.handler = ^(WJCZombieInfo * _Nonnull zombieInfo) {\n        // First, zombieInfo provides comprehensive details. You can customize how to use this information\n\n        // Additionally, zombieInfo offers a jsonFileText string for detailed diagnostics. Usage:\n        // Step 1: Save jsonFileText string as xxx.json file\n        // Step 2: Obtain dsym.zip file\n        // Step 3: Execute: python3 symbolicate_zombie.py {json_path} {dsym_zip_path} {output_dir}\n        // Step 4: Read the .log files in {output_dir}\n    };\n\n    // Custom C wild pointer settings (completely independent from NSObject settings)\n    config.cConfig.shouldWork = YES; // Whether to detect C wild pointers\n    config.cConfig.crashWhenDetectedZombie; // Always YES. Set config.cConfig.shouldWork = NO if you don't want immediate crash\n    config.cConfig.maxStealMemorySizeBytes = 50 * 1024 * 1024; // Custom max memory cache\n\n    [WJCZombieHunter startWorkWithConfig:config]; // Start monitoring\n}\n\n- (void)whenEverYourWantToStopMonitorZombie {\n    [WJCZombieHunter stopWork]; // Stop monitoring\n}\n\n- (void)testZombieWithAccidentalCoverage {\n    /*\n     If ZombieHunter OC monitoring is NOT enabled:\n     Output: [ZombieHunter]-accidentalCoverage[YES]-correct[19450815]-result[19310918]❌\n     This indicates your program isn't crashing yet, but producing uncontrolled incorrect results\n\n     If ZombieHunter OC monitoring is enabled:\n     The ocConfig.handler will provide detailed information, allowing you to take any desired action \n     (e.g., upload logs/force quit the app/etc.)\n     */\n    [WJCZombieTest testOCZombieWithAccidentalCoverage:YES];\n}\n\n- (void)testZombieWithoutAccidentalCoverage {\n    /*\n     If ZombieHunter OC monitoring is NOT enabled:\n     Immediate crash: Thread 1: EXC_BAD_ACCESS\n\n     If ZombieHunter OC monitoring is enabled:\n     The ocConfig.handler will provide detailed information, allowing you to take any desired action\n     (e.g., upload logs/prevent immediate crash/etc.)\n     */\n    [WJCZombieTest testOCZombieWithAccidentalCoverage:NO];\n}\n```\n\n### Code Notes\n\n```Objective-C\n// Please only use classes and methods with WJC prefix, do not use other classes/methods directly\n```\n\n### How to Symbolize zombieInfo\n\n```Objective-C\n[WJCZombieTest testOCZombieWithAccidentalCoverage:YES]; // Execute this method after monitoring is enabled for testing\n```\n\n#### Step 1: Save JSON File\n\nSave the zombieInfo.jsonFileText string as an xxx.json file\n\n#### Step 2: Obtain dsym.zip File\n\nAcquire the dsym.zip file\n\n#### Step 3: Execute symbolicate_zombie.py\n\npython3 symbolicate_zombie.py \u003cpath_to_json\u003e \u003cpath_to_dSYM_file\u003e \u003coutput_dir\u003e\n\n#### Step 4: Obtain zombie.log File (Example)\n\n```log\nClassName: UIView\nZombieObjectAddress: 0x1259588c0\nSelectorName: tag\n\nZombieStack:\ntid: 259\n[0] 0x00000001891de338 -\u003e CoreFoundation + 0x21338\n[1] 0x00000001891de1b0 -\u003e CoreFoundation + 0x211b0\n[2] 0x00000001018082dc -\u003e +[WJCZombieTest testOCZombieWithAccidentalCoverage:] (in Demo) (WJCZombieTest.m:39)\n...\n\nDeallocStack:\ntid: 259\n[0] 0x00000001018072a4 -\u003e -[NSObject(DDZombieDetector) hy_newDealloc] (in Demo) (NSObject+DDZombieDetector.m:20)\n[1] 0x000000018ba5c21c -\u003e UIKitCore + 0xd421c\n[2] 0x000000018ba5c114 -\u003e UIKitCore + 0xd4114\n[3] 0x0000000101808248 -\u003e +[WJCZombieTest testOCZombieWithAccidentalCoverage:] (in Demo) (WJCZombieTest.m:25)\n...\n```\n\n## Contributions\n\n### Contribution Summary\n\n- Core code for OC zombie objects comes from AlexTing0's open source library\n- Core concept for C wild pointers comes from TencentBuglyTeam/Chen Qifeng's technical articles\n- C wild pointer code depends on Facebook's fishhook (using latest code due to bug in fishhook 0.2)\n  - Current fishhook version: aadc161ac3b80db07a9908851839a17ba63a9eb1\n- wujingcheng7 integrated these components:\n  - Created pod version for easy integration and direct use\n\n### Contribution Links\n\n- AlexTing0\n  - homepage: \u003chttps://github.com/AlexTing0\u003e\n  - article: \u003chttps://github.com/AlexTing0/Monitor_Zombie_in_iOS\u003e\n  - repo: \u003chttps://github.com/AlexTing0/DDZombieMonitor\u003e\n\n- TencentBuglyTeam/Chen Qifeng\n  - homepage: \u003chttps://cloud.tencent.com/developer/user/1069749\u003e\n  - article1: \u003chttps://cloud.tencent.com/developer/article/1070505\u003e\n  - article2: \u003chttps://cloud.tencent.com/developer/article/1070512\u003e\n  - article3: \u003chttps://cloud.tencent.com/developer/article/2256759\u003e\n\n- FacebookTeam\n  - homepage: \u003chttps://github.com/facebook\u003e\n  - repo: \u003chttps://github.com/facebook/fishhook\u003e\n  - repoVersion: aadc161ac3b80db07a9908851839a17ba63a9eb1\n\n## License\n\nZombieHunter uses MIT license, free to use\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwujingcheng7%2Fzombiehunter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwujingcheng7%2Fzombiehunter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwujingcheng7%2Fzombiehunter/lists"}