Solved kernel keep crashing while step through code with kgdb

Any idea why the kernel keep crashing with trap 12: page fault while in kernel mode while I step through the code of a module with kgdb(1).
I think it is not modules fault because is happening in different places, maybe it's worth mentioning that I am using remote debugging?

I added
makeoptions DEBUG=-g
to kernel before compiling as handbook says, there is another option that i omitted?

Also I tried to use just 1 core on the qemu vm that I'm debugging, but was useless.
Last edited:
Honestly, this is like asking why windows goes blue screen. My guess is a module is causing it... :)

With such trap reboots there is some chance you might get a backtrace with some information, but you need the vmcore to properly debug it.