{"id":17427401,"url":"https://github.com/jmgorius/diagalloc","last_synced_at":"2025-03-28T00:30:53.428Z","repository":{"id":135360606,"uuid":"386882018","full_name":"jmgorius/diagalloc","owner":"jmgorius","description":"A set of dynamic libraries to be used with LD_PRELOAD to monitor and test memory allocations.","archived":false,"fork":false,"pushed_at":"2021-07-18T17:20:17.000Z","size":18,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T02:27:29.713Z","etag":null,"topics":["c","diagnostics","memory","preload"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmgorius.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":"2021-07-17T08:31:00.000Z","updated_at":"2022-04-14T08:49:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"b61f9567-3009-442d-94aa-230fb2c9709f","html_url":"https://github.com/jmgorius/diagalloc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmgorius%2Fdiagalloc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmgorius%2Fdiagalloc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmgorius%2Fdiagalloc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmgorius%2Fdiagalloc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmgorius","download_url":"https://codeload.github.com/jmgorius/diagalloc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245948977,"owners_count":20698906,"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":["c","diagnostics","memory","preload"],"created_at":"2024-10-17T06:41:37.899Z","updated_at":"2025-03-28T00:30:53.377Z","avatar_url":"https://github.com/jmgorius.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# diagalloc - Memory allocation diagnostics and testing\n\nA set of dynamic libraries to be used with `LD_PRELOAD` to monitor and test\nmemory allocations.\n\n# Building\n\nTo build the code in this repository, run\n```console\n$ make\n```\n\n# Usage\n\nThis repository provides a set of shared libraries that need to be used in\nconjunction with `LD_PRELOAD` to override common memory allocation functions.\nThe following gives a brief description of each library.\n\n## logalloc.so\n\nThe `logalloc.so` library logs all allocations to the standard error output\nstream. It indicates the name of the called function, the value of the\nparameters as well as the returned value.\n\nFor example,\n```console\n$ LD_PRELOAD=./logalloc.so ls \u003e/dev/null\n```\nproduces the following log.\n```\n0x7fac4c6cac90 malloc(5) -\u003e 0x563c73aaf2a0\n0x7fac4c6c51dc free(0x563c73aaf2a0)\n...\n0x7fac4c713d55 free(0x563c73ab6540)\n```\n\n## failalloc.so\n\nThe `failalloc.so` library can be used to randomly fail allocations with a\nconfigurable failure rate. The latter is set through the `FAILALLOC_THRESHOLD`\nenvironment variable.\n\nFor example,\n```console\n$ FAILALLOC_THRESHOLD=0.25 LD_PRELOAD=./failalloc.so ls \u003e/dev/null\n```\ncan produce\n```\nFailing malloc(5), called from 0x7f2bed422c90\nFailing malloc(4096), called from 0x7f2bed45d564\nFailing realloc((nil), 1600), called from 0x7f2bed42236e\nFailing malloc(104), called from 0x7f2bed42297d\nFailing malloc(34), called from 0x7f2bed41ed7f\nFailing malloc(56), called from 0x55b6cdb03c9a\nls: memory exhausted\n```\n\n**Note:** `failalloc.so`'s behavior is not deterministic by nature.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmgorius%2Fdiagalloc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmgorius%2Fdiagalloc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmgorius%2Fdiagalloc/lists"}