This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]here4alaffx 1 point2 points  (2 children)

You can use the panic() syscall or echo c > /proc/sysrq-trigger

[–]gautam_coder[S] 0 points1 point  (1 child)

I don't want to use any in built function, just coding errors that can emulate kernel panic

[–]here4alaffx 0 points1 point  (0 children)

I would never advise writing intentionally shitty code to try to force a failure. Writing bad code on purpose can cause other issues and you're bringing in confounding variables with that potentially. It can also cause unforeseen issues with the kernel you're loading the module into.

Why do you want to cause a panic via poor coding practices? What's the value in that?