Just yesterday my friend and I were wondering why his Linux kernel module crashed the kernel in QEMU everytime the module was removed with
rmmod; it caused the kernel to issue the BUG message on the screen before crashing. The kernel module itself had just been transfered from his host GNU/Linux operating system via
scp. Examining the source code files together in QEMU did not reveal any problem. After trying several "
rmmod—wondering" cycles in QEMU, I typed
make clean before
make. And, voila! It worked! It looked like that there were some left over from the previous module compilation on the host system.