如何生成MCE(机器检查错误)

时间:2022-05-10 15:06:28

As much I know that mcelog is used to check the memory errors in the hardware. I want to simulate the same case. I don't have any machine which is having the issue with hardware where I can simulate this case. Can anybody suggest me some simulator or any other way through which I can generate these errors. Because my main aim is to display the Uncorrectable Memory errors. Thanks.

我知道mcelog用于检查硬件中的内存错误。我想模拟相同的情况。我没有任何机器在硬件上有问题我可以模拟这种情况。有没有人能给我推荐一些模拟器或者其他可以产生这些错误的方法?因为我的主要目的是显示不可纠正的内存错误。谢谢。

1 个解决方案

#1


3  

You can use the tool mce-inject, but you'll need to load the mce_inject kernel module. This kernel module is available on Ubuntu 12.04 (the only system I have access to) and should be available on newer Ubuntus, as well.

您可以使用工具mce注入,但是您需要加载mce_inject内核模块。这个内核模块可以在Ubuntu 12.04(我唯一可以访问的系统)上使用,也可以在新的Ubuntus上使用。

First, you need to load the module:

首先,需要加载模块:

$ sudo modprobe mce_inject

Next, you need to download the source for the mce_inject tool, install the dependencies, and compile it:

接下来,您需要下载mce_inject工具的源代码,安装依赖项并编译:

$ git clone https://github.com/andikleen/mce-inject.git
$ sudo apt-get install flex bison
$ cd mce-inject
$ make

Next, you need to create a file that simulates the error you want. You should check the mce-inject man page (included in the source) for more information on the structure. You can find some examples in the test/ directory in the [mce-inject source](

接下来,您需要创建一个文件来模拟您想要的错误。您应该检查mce-inject man页面(包含在源代码中),以获得关于结构的更多信息。您可以在[mce-inject源代码]中的test/目录中找到一些示例(

Injecting a FATAL error can destabilize and crash the system; doing this is not recommended.

注入致命错误会破坏系统的稳定和崩溃;不建议这样做。

Once you've decided which example file to use (or have created your own) you can inject it with mce-inject. For example, injecting the test/corrected example error included with mce-inject:

一旦您决定使用哪个示例文件(或创建了自己的示例文件),您就可以使用mce-inject对它进行注入。例如,注入mce-inject包含的测试/修正示例错误:

$ sudo ./mce-inject test/corrected

You can now check your logs and find that the error has been injected.

现在可以检查日志并发现错误已经被注入。

#1


3  

You can use the tool mce-inject, but you'll need to load the mce_inject kernel module. This kernel module is available on Ubuntu 12.04 (the only system I have access to) and should be available on newer Ubuntus, as well.

您可以使用工具mce注入,但是您需要加载mce_inject内核模块。这个内核模块可以在Ubuntu 12.04(我唯一可以访问的系统)上使用,也可以在新的Ubuntus上使用。

First, you need to load the module:

首先,需要加载模块:

$ sudo modprobe mce_inject

Next, you need to download the source for the mce_inject tool, install the dependencies, and compile it:

接下来,您需要下载mce_inject工具的源代码,安装依赖项并编译:

$ git clone https://github.com/andikleen/mce-inject.git
$ sudo apt-get install flex bison
$ cd mce-inject
$ make

Next, you need to create a file that simulates the error you want. You should check the mce-inject man page (included in the source) for more information on the structure. You can find some examples in the test/ directory in the [mce-inject source](

接下来,您需要创建一个文件来模拟您想要的错误。您应该检查mce-inject man页面(包含在源代码中),以获得关于结构的更多信息。您可以在[mce-inject源代码]中的test/目录中找到一些示例(

Injecting a FATAL error can destabilize and crash the system; doing this is not recommended.

注入致命错误会破坏系统的稳定和崩溃;不建议这样做。

Once you've decided which example file to use (or have created your own) you can inject it with mce-inject. For example, injecting the test/corrected example error included with mce-inject:

一旦您决定使用哪个示例文件(或创建了自己的示例文件),您就可以使用mce-inject对它进行注入。例如,注入mce-inject包含的测试/修正示例错误:

$ sudo ./mce-inject test/corrected

You can now check your logs and find that the error has been injected.

现在可以检查日志并发现错误已经被注入。