Вопрос

I am running an old version of the linux code(2.6.27). I have the CONFIG_BUG=y and also the HAVE_ARCH_BUG defined. So i am using the BUG() definition in the asm-x86/bug.h instead of asm-generic. I see that when i insmod a test module (which just has a BUG() call), it does not crash the box. I am able to get to the console. It is an SMP system so i would expect that. The question i have is , by design, was BUG() supposed to hang the box just like panic? If so, any reason why it is not on this kernel?

thx Murali

Это было полезно?

Решение

BUG() itself is not supposed to hang the box, so the behaviour of your system is OK.

On x86, BUG() eventually tries to execute ud2 machine instruction which leads to "Invalid opcode" exception. It is up to the kernel how to handle that, whether to output a message and continue working or to stop. Different kernels may react in different ways here.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top