{"id":15724425,"url":"https://github.com/cldellow/libfailmalloc","last_synced_at":"2025-06-10T20:36:13.594Z","repository":{"id":140790773,"uuid":"126610024","full_name":"cldellow/libfailmalloc","owner":"cldellow","description":"Patched version of http://www.nongnu.org/failmalloc/ that compiles under modern g++","archived":false,"fork":false,"pushed_at":"2018-03-24T15:05:13.000Z","size":308,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-10T19:02:43.028Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cldellow.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-24T14:57:27.000Z","updated_at":"2018-03-24T15:05:14.000Z","dependencies_parsed_at":"2024-05-19T14:00:26.485Z","dependency_job_id":null,"html_url":"https://github.com/cldellow/libfailmalloc","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/cldellow%2Flibfailmalloc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldellow%2Flibfailmalloc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldellow%2Flibfailmalloc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldellow%2Flibfailmalloc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cldellow","download_url":"https://codeload.github.com/cldellow/libfailmalloc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldellow%2Flibfailmalloc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259147077,"owners_count":22812358,"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-10-03T22:16:36.940Z","updated_at":"2025-06-10T20:36:13.564Z","avatar_url":"https://github.com/cldellow.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"*NOTE*: This is a copy of Yoshinori K. Okuji's failmalloc library,\nwhose original homepage is at http://www.nongnu.org/failmalloc/\n\nIt has been patched to compile on modern Ubuntu systems.\n\n# Introduction\n\nWelcome to failmalloc. This software generates a shared library\nwhich can be loaded by `LD_PRELOAD` or linked at compilation time.\n\nThe idea behind failmalloc is to demonstrate what really happens\nif memory allocation fails. Unfortunately, most programs in this\nworld are not robust, mostly because programmers are careless,\nbut sometimes because programmers are too brave. Regardless of\nwhatever reasons, the most critical problem is in that there is no\ngood way to see such failures in reality, until a program is\ndeployed into a heavy production system. Clearly, this is too\nlate!\n\nFailmalloc addresses this problem. Failmalloc inserts hooks\ninto your program, which induces always, often or sometimes\nfailures of memory allocation calls. The functions `malloc`,\n`realloc` and `memalign` are hooked, but other functions which\nuse one of these functions are also affected.\n\n# Supported systems\n\nThis library depends on glibc. So it will run with all glibc-based\noperating systems, such as GNU/Linux and GNU/Hurd.\n\n# Installation\n\nAs usual, `configure \u0026\u0026 make \u0026\u0026 make install`.\n\nIf you want to test it without installing, use `.libs/libfailmalloc.so`.\n\n# Usage\n\nThe easiest way is to use `LD_PRELOAD`. For example:\n\n  `env LD_PRELOAD=libfailmalloc.so ls`\n\nNote that failmalloc always fails by default. So there are\nfour environment variables to tweak the behavior:\n\n  `FAILMALLOC_PROBABILITY` -- specifies how often it should fail\n                            between 0.0 and 1.0.\n\n  `FAILMALLOC_INTERVAL` -- specifies the interval of failures.\n\n  `FAILMALLOC_TIMES` -- specifies how many times failures may happen\n                      at most.\n\n  `FAILMALLOC_SPACE` -- specifies the size of free space where memory\n                      can be allocated safely in bytes.\n\nFor example, this makes malloc/realloc/memalign fail at 80%:\n\n  `env LD_PRELOAD=libfailmalloc.so FAILMALLOC_PROBABILITY=0.8 ls`\n\nThis makes them fail every 5 times:\n\n  `env LD_PRELOAD=libfailmalloc.so FAILMALLOC_INTERVAL=5 ls`\n\nIf you specify both variables, they fail at 80% every 5 times:\n\n  ```\n  env LD_PRELOAD=libfailmalloc.so FAILMALLOC_INTERVAL=5 \\\n    FAILMALLOC_PROBABILITY=0.8 ls\n  ```\n\nThis ensures that they can fail only once:\n\n  `env LD_PRELOAD=libfailmalloc.so FAILMALLOC_TIMES=1 ls`\n\nThis ensures that memory allocations do not fail up to 1MB being\nallocated:\n\n  `env LD_PRELOAD=libfailmalloc.so FAILMALLOC_SPACE=0x100000 ls`\n\n# Contact information\n\nPlease look at \u003chttp://www.nongnu.org/failmalloc\u003e or send email\nto \"Yoshinori K. Okuji\" \u003cokuji@enbug.org\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcldellow%2Flibfailmalloc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcldellow%2Flibfailmalloc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcldellow%2Flibfailmalloc/lists"}