{"id":14991137,"url":"https://github.com/fanyang89/gwp-asan","last_synced_at":"2025-07-29T01:07:50.673Z","repository":{"id":242494612,"uuid":"809702322","full_name":"fanyang89/gwp-asan","owner":"fanyang89","description":"Standalone gwp-asan from LLVM","archived":false,"fork":false,"pushed_at":"2024-10-24T04:29:17.000Z","size":716,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-12T03:30:19.581Z","etag":null,"topics":["address-sanitizer","gwp-asan","llvm","sanitizer","sanitizers"],"latest_commit_sha":null,"homepage":"https://github.com/fanyang89/gwp-asan","language":"C++","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/fanyang89.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,"zenodo":null}},"created_at":"2024-06-03T09:33:29.000Z","updated_at":"2024-11-07T14:51:36.000Z","dependencies_parsed_at":"2025-04-12T03:28:53.328Z","dependency_job_id":"ee1f90c2-a6e0-477b-9b9f-7ae90099f43e","html_url":"https://github.com/fanyang89/gwp-asan","commit_stats":null,"previous_names":["fanyang89/gwp-asan"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fanyang89/gwp-asan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fanyang89%2Fgwp-asan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fanyang89%2Fgwp-asan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fanyang89%2Fgwp-asan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fanyang89%2Fgwp-asan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fanyang89","download_url":"https://codeload.github.com/fanyang89/gwp-asan/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fanyang89%2Fgwp-asan/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267613326,"owners_count":24115611,"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-07-28T02:00:09.689Z","response_time":68,"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":["address-sanitizer","gwp-asan","llvm","sanitizer","sanitizers"],"created_at":"2024-09-24T14:21:32.633Z","updated_at":"2025-07-29T01:07:50.632Z","avatar_url":"https://github.com/fanyang89.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gwp-asan\n\nIndependent standalone gwp-asan, from [llvm](https://github.com/llvm/llvm-project)\n\n## What's this\n\nGWP-ASan is a sampled allocator framework that assists in finding use-after-free and heap-buffer-overflow bugs in\n**production** environments.\n\nThis repo contains a standalone gwp-asan, you can easily use it with CMake.\n\nCheck the documents here: [gwp-asan](https://llvm.org/docs/GwpAsan.html)\n\n## Integration\n\nTL;DR read the [example](https://github.com/fanyang89/gwp-asan/blob/main/example/helloworld/main.cc)\n\nIntegration by simply performing the following steps:\n\n1. add hook to malloc/free\n\n    ```c++\n    void *operator new(std::size_t sz) {\n        if (allocator.shouldSample()) {\n            return allocator.allocate(sz, MinAlignment);\n        }\n        return malloc(sz);\n    }\n\n    void operator delete(void *ptr) {\n        if (allocator.pointerIsMine(ptr)) {\n            allocator.deallocate(ptr);\n            return;\n        }\n        free(ptr);\n    }\n    ```\n\n2. register SEGV handler and init the allocator\n\n    ```c++\n    gwp_asan::options::Options options;\n    options.Enabled = true;\n    options.MaxSimultaneousAllocations = 16;\n    options.SampleRate = 3;\n    options.Backtrace = gwp_asan::backtrace::getBacktraceFunction();\n    allocator.init(options);\n    gwp_asan::segv_handler::installSignalHandlers(\n            \u0026allocator, PrintfToBuffer,\n            gwp_asan::backtrace::getPrintBacktraceFunction(),\n            gwp_asan::backtrace::getSegvBacktraceFunction(),\n            false\n    );\n    ```\n\n## Resolve output\n\n```bash\n./buggy-program | ./scripts/symbolize.sh\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffanyang89%2Fgwp-asan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffanyang89%2Fgwp-asan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffanyang89%2Fgwp-asan/lists"}