I have a sample driver with intentional null pointer access. When I load driver, my ubunut 18.04 with 4.15.0-55-generic kernel is not showing up any stack trace in dmesg or dmesg -w or in /var/log/kern.log file.
I have other Ubuntu system with the same config, where it is not hanging up and it is showing proper kernel oops in dmesg or /var/log/kern.log.
I want to fix the problem exactly what is causing and what setting is making kernel to hang up forever.
I tried reinstallation of linuxcrashdump kdump and kexec-tools. But still problem is there.
Later, I compare with the working Ubuntu and non working Ubuntu. In working system, there is no Linux-crashdump, kdump-tools and kexec-tools.
Maybe in the kernel the flag CONFIG_DEBUG_KERNEL is not turned on. But anyhow it is not likely a problem of kernel itself.
I used printk a lot in driver development. It shows information normally on console, when you load the driver. I recommend to put a printk at init of your driver and before and after critical lines. Hence, you will see how far code is executed.
With KERN_xxx you can set severity. When you start, choose a high one. It has to be set. Apart from that it works like printf.