{"id":18363244,"url":"https://github.com/andikleen/mcelog","last_synced_at":"2025-04-12T21:28:42.448Z","repository":{"id":1715713,"uuid":"2445641","full_name":"andikleen/mcelog","owner":"andikleen","description":"Linux kernel machine check handling middleware","archived":false,"fork":false,"pushed_at":"2025-02-15T19:30:16.000Z","size":1017,"stargazers_count":137,"open_issues_count":33,"forks_count":64,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-04-04T01:07:53.823Z","etag":null,"topics":["intel","linux","machine-check","memory","predictive-failure-analysis","ras"],"latest_commit_sha":null,"homepage":"http://www.mcelog.org","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andikleen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES","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}},"created_at":"2011-09-23T17:46:54.000Z","updated_at":"2025-02-15T19:30:20.000Z","dependencies_parsed_at":"2024-01-06T21:25:48.897Z","dependency_job_id":"f1ebc8ea-9107-4307-869b-a7341b8c6a4b","html_url":"https://github.com/andikleen/mcelog","commit_stats":{"total_commits":598,"total_committers":71,"mean_commits":8.422535211267606,"dds":"0.40969899665551834","last_synced_commit":"d70a0a7a794b35225295f77225941462c1d57254"},"previous_names":[],"tags_count":110,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andikleen%2Fmcelog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andikleen%2Fmcelog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andikleen%2Fmcelog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andikleen%2Fmcelog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andikleen","download_url":"https://codeload.github.com/andikleen/mcelog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248634025,"owners_count":21136964,"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":["intel","linux","machine-check","memory","predictive-failure-analysis","ras"],"created_at":"2024-11-05T23:05:45.387Z","updated_at":"2025-04-12T21:28:42.413Z","avatar_url":"https://github.com/andikleen.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mcelog\n\nmcelog is the user space backend for logging machine check errors reported\nby the hardware to the kernel. The kernel does the immediate actions\n(like killing processes etc.) and mcelog decodes the errors and manages\nvarious other advanced error responses like offlining memory, CPUs or triggering\nevents. In addition mcelog also handles corrected errors, by logging and\naccounting them.\nIt primarily handles machine checks and thermal events, which are reported\nfor errors detected by the CPU.\n\nFor more details on what mcelog can do and the underlying theory\nsee [mcelog.org](https://www.mcelog.org).\n\nIt is recommended that mcelog runs on all x86 machines, both 64bit\n(since early 2.6) and 32bit (since 2.6.32).\n\nmcelog can run in several modes:\n\n- cronjob\n- trigger\n- daemon\n\n**cronjob** is the old method. mcelog runs every 5 minutes from cron and checks\nfor errors. Disadvantage of this is that it can delay error reporting\nsignificantly (upto 10 minutes) and does not allow mcelog to keep extended state.\n\n**trigger** is a newer method where the kernel runs mcelog on a error.\n\nThis is configured with:\n```sh\necho /usr/sbin/mcelog \u003e /sys/devices/system/machinecheck/machinecheck0/trigger\n```\nThis is faster, but still doesn't allow mcelog to keep state,\nand has relatively high overhead for each error because a program has\nto be initialized from scratch.\n\nIn **daemon** mode mcelog runs continuously as a daemon in the background and\nwait for errors. It is enabled by running `mcelog --daemon \u0026`\nfrom a init script. This is the fastest and most feature-ful.\n\nThe recommended mode is **daemon**, because several new functions (like page\nerror predictive failure analysis) require a continuously running daemon.\n\n## Documentation\n\n- The primary reference documentation are the man pages.\n- [lk10-mcelog.pdf](lk10-mcelog.pdf)\n  has a overview over the errors mcelog handles (originally from Linux Kongress 2010).\n- [mce.pdf](mce.pdf)\n  is a very old paper describing the first releases of mcelog (some parts are obsolete).\n\n## For distributors\n\nYou can run mcelog from systemd or similar daemons. An example systemd unit\nfile is in `mcelog.service`.\n\nBy default mcelog reports its version as the git tag. This can be overridden\nby setting up a `.os_version` file in the source directory. A build system\ncould write the OS version to this file to mark the binary.\n\n### For older distributions using init scripts\n\nPlease install an init script by default that runs mcelog in daemon mode.\nThe `mcelog.init` script is a good starting point. Also install a\nlogrotated file (mcelog.logrotate) or equivalent when mcelog is running\nin daemon mode.\nThese two are not in make install.\n\nThe installation also requires a config file `/etc/mcelog.conf` and the default\ntriggers. These are all installed by `make install`\n\n`/dev/mcelog` is needed for mcelog operation. If it's not there it can be\ncreated with:\n```sh\nmknod /dev/mcelog c 10 227\n```\n\nNormally it should be created automatically in udev.\n\n## Security\n\nmcelog needs to run as root because it might trigger actions like\npage-offlining, which require `CAP_SYS_ADMIN`. Also it opens `/dev/mcelog`\nand an UNIX socket for client support.\n\nIt also opens `/dev/mem` to parse the BIOS DMI tables. It is careful to close\nthe file descriptor and unmap any mappings after using them.\n\nThere is support for changing the user in daemon mode after opening the device\nand the sockets, but that would stop triggers from doing corrective action\nthat require `root`.\n\nIn principle it would be possible to only keep `CAP_SYS_ADMIN` for page-offling,\nbut that would prevent triggers from doing root-only actions not covered by\nit (and `CAP_SYS_ADMIN` is not that different from full root)\n\nIn `daemon` mode mcelog listens to a UNIX socket and processes requests from\n`sh mcelog --client`. This can be disabled in the configuration file.\nThe uid/gid of the requestor is checked on access and is configurable\n(default 0/0 only). The command parsing code is very straight forward\n(server.c). The client parsing/reply is currently done with full privileges\nof the `daemon`.\n\n## Testing\n\nThere is a simple test suite in `sh tests/`. The test suite requires root to\nrun and access to mce-inject and a kernel with MCE injection support\n`CONFIG_X86_MCE_INJECT`.  It will kill any running mcelog daemon.\n\nRun it with `sh make test`.\n\nThe test suite requires the\n[mce-inject](git://git.kernel.org/pub/utils/cpu/mce/mce-inject.git) tool.\nThe `mce-inject` executable must be either in `$PATH` or in the\n`../mce-inject` directory.\n\nYou can also test under **valgrind** with `sh make valgrind-test`. For this\nvalgrind needs to be installed of course. Advanced valgrind options can be\nspecified with:\n```sh\nmake VALGRIND=\"valgrind --option\" valgrind-test\n```\n\n### Other checks\n\n`make iccverify` and `make clangverify` run the static verifiers in *clang*\nand *icc* respectively.\n\n## License\n\nThis program is licensed under the subject of the GNU Public General\nLicense, v.2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandikleen%2Fmcelog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandikleen%2Fmcelog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandikleen%2Fmcelog/lists"}