{"id":13419502,"url":"https://github.com/vmware/chap","last_synced_at":"2025-04-05T11:12:11.581Z","repository":{"id":41153518,"uuid":"86946762","full_name":"vmware/chap","owner":"vmware","description":"chap analyzes un-instrumented core files for leaks, memory growth, and corruption","archived":false,"fork":false,"pushed_at":"2024-08-27T16:47:02.000Z","size":60928,"stargazers_count":362,"open_issues_count":4,"forks_count":42,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-08-27T18:12:18.696Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vmware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE-OF-CONDUCT.md","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":"2017-04-01T22:31:42.000Z","updated_at":"2024-08-27T16:47:06.000Z","dependencies_parsed_at":"2024-10-26T22:31:17.545Z","dependency_job_id":null,"html_url":"https://github.com/vmware/chap","commit_stats":{"total_commits":250,"total_committers":5,"mean_commits":50.0,"dds":"0.052000000000000046","last_synced_commit":"dd5ce02e687e893d18bd45689a6d5722bef603b1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware%2Fchap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware%2Fchap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware%2Fchap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware%2Fchap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vmware","download_url":"https://codeload.github.com/vmware/chap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247325693,"owners_count":20920714,"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-07-30T22:01:16.929Z","updated_at":"2025-04-05T11:12:06.572Z","avatar_url":"https://github.com/vmware.png","language":"C++","readme":"\n\u003cimg alt=\"Chap\" src=\"doc/img/chap-logo-small.png\"\u003e\n\n`chap` analyzes un-instrumented ELF core files for leaks, memory growth, and\ncorruption. It is sufficiently reliable that it can be used in automation to\ncatch leaks before they are committed. As an interactive tool, it helps explain\nmemory growth, can identify some forms of corruption, and  supplements a\ndebugger by giving the status of various memory locations.\n\n`chap` currently supports glibc malloc and the allocator used for cpython.\nIt has tentative support of tcmalloc but that is not at all well tested.  It has\npartial support for golang, also not at all well tested as yet,\nbut the support for golang will not work for leak analysis.  There is as yet no\nsupport for jemalloc.\n\n## Motivation\n\nTraditionally, memory analysis for C and C++ requires instrumentation. However,\nif an incident occurs using code that was not instrumented it may not be\npractical to reproduce the problem. For example, it may have been due to a rare\nexecution path, or resources required for the reproduction setup may not be\navailable. Instrumentation may also distort timing enough that it is not\npractical to run on a regular basis, or it may be incomplete and report false\nleaks.\n\n## Quick Start\n\n`chap` is distributed as source, so first build it (on 64-bit Linux):\n\n```\n$ git clone https://github.com/vmware/chap.git\n$ cd chap\n$ git submodule update --init --recursive\n$ mkdir build-chap\n$ cd build-chap\n$ cmake ../\n$ make\n$ ./chap\nUsage: chap [-t] \u003cfile\u003e\n\n-t means to just do truncation check then stop\n   0 exit code means no truncation was found\n\nSupported file types include the following:\n\n64-bit little-endian ELF core file\n32-bit little-endian ELF core file\n```\n\nIf that doesn't work out of the box, see [CONTRIBUTING.md](CONTRIBUTING.md) for\npre-requisites and other details.\n\n`chap` has REPL support for command history and tab completion using\nthe [replxx](https://github.com/AmokHuginnsson/replxx)  library.\n\nOnce built, here's a trivial example of an interactive session:\n\n```\n$ echo \"int main() { new int; new int; *(int *)0 = 1; return 0; }\" | g++ -xc++ -\n$ ulimit -c unlimited\n$ ./a.out\nSegmentation fault (core dumped)\n$ ./chap `ls -t core.* | head -1`\n\u003e summarize leaked\nUnsigned allocations have 1 instances taking 0x18(24) bytes.\n   Unsigned allocations of size 0x18 have 1 instances taking 0x18(24) bytes.\n1 allocations use 0x18 (24) bytes.\n\u003e enumerate allocations /size 18\n13f5010\n13f5030\n\u003e explain 13f5010\nAddress 13f5010 is at offset 0x0 in a used allocation at 13f5010 of size 0x18\nThis allocation appears to be leaked.\nThis allocation appears to be unreferenced.\n\u003e explain 13f5030\nAddress 13f5030 is at offset 0x0 in a used allocation at 13f5030 of size 0x18\nThis allocation appears to be anchored.\nAllocation at 13f5030 appears to be directly anchored from at least one register.\nRegister rcx for thread 1 references 13f5030\n\u003e\n```\n\nFor more information on how to use `chap`, please see the built-in help and the\n[USERGUIDE.md](USERGUIDE.md).\n\n## Community\n\nThe best way to communicate with the maintainers is via the\n[GitHub issue tracker](https://github.com/vmware/chap/issues).\n\n## Contributing\n\nWe welcome contributions from the community. Please see\n[CONTRIBUTING.md](CONTRIBUTING.md) for details.\n\nIf you wish to contribute code and you have not signed our contributor license\nagreement (CLA). Our bot will update the issue when you open a pull request. For\nany questions about the CLA process, please refer to our\n[FAQ](https://cla.vmware.com/faq).\n\n## License\n\n`chap` is available under the GNU GENERAL PUBLIC LICENSE Version 2. Please see\n[LICENSE.txt](LICENSE.txt).\n","funding_links":[],"categories":["TODO scan for Android support in followings","Programming Languages","Other"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmware%2Fchap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvmware%2Fchap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmware%2Fchap/lists"}