# "Fatal trap 9: general protection fault while in kernel mode" crashes are consistent and daily



## CodeJoule (Feb 28, 2021)

I've been searching online for answers to this, and I could not find a solution so I am making a new thread. My system will often crash in an instant, dump the memory, and then shutdown. Usually this happens when I open up specific pages in my browser (www/qutebrowser) but it can often happen at random, for an example I ran "`rustup update`" in a VT without X once a couple days ago, so I could update the Rust language toolchain, and it crashed after downloading the updates. Another time I simply launched X with `startx` (which I always do, odd it crashed that once.) And another time it happened when I started telegram-desktop. It is consistent with random pages on my web browser, however.

Here is a portion of the log it generated for me:

clipping of core.txt.5

```
HostName dumped core - see /var/crash/vmcore.5

Sat Feb 27 12:11:29 PST 2021

FreeBSD HostName 12.2-RELEASE-p3 FreeBSD 12.2-RELEASE-p3 GENERIC  amd64

panic: general protection fault

-snip by me-

Reading symbols from /boot/kernel/kernel...
Reading symbols from /usr/lib/debug//boot/kernel/kernel.debug...

Unread portion of the kernel message buffer:


Fatal trap 9: general protection fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer    = 0x20:0xffffffff8107b5ce
stack pointer            = 0x0:0xfffffe0039645830
frame pointer            = 0x0:0xfffffe0039645900
code segment        = base 0x0, limit 0xfffff, type 0x1b
            = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags    = interrupt enabled, resume, IOPL = 0
current process        = 90549 (QtWebEngineProcess)
trap number        = 9
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-fa1387d/drivers/gpu/drm/drm_atomic_helper.c:577
```

I have read _some_ posts that said this is a hardware issue, which I am not too sure of (I didn't have this problem on Linux but it has been a while, so the hardware could have degraded since then.) It could be a graphics setup error. I don't know, I got X and all programs working and I am able to use my laptop most of the time, whenever it isn't crashing. Sometimes I get black squares with fuzzy stuff inside them but usually I just restart the program having that issue and it fixes itself.

I hope this can be fixed. I may have to install Linux if it can't, although it would only be because I need to use my computer without all these interruptions and limitations, and I would definitely miss FreeBSD a lot.


----------



## SirDice (Feb 28, 2021)

It's likely a hardware problem. Especially due to the randomness I suspect some bad memory. Test the memory with a tool like sysutils/memtest86. Second thing to check is heat, make sure things like the CPU fan are still working properly.


----------



## _martin (Feb 28, 2021)

On a contrary I think it's a bad driver and you are toggling the bug in it. Judging from that failed mutex. 
Maybe you could ask in a mailing lists and/or contact port maintainers ( graphics/drm-fbsd12.0-kmod).


----------



## CodeJoule (May 3, 2021)

I'm sorry, I thought I replied to this a long while ago! I must have written out a draft and forgot to post it.


SirDice said:


> It's likely a hardware problem. Especially due to the randomness I suspect some bad memory. Test the memory with a tool like sysutils/memtest86. Second thing to check is heat, make sure things like the CPU fan are still working properly.


I ran this tool on your advice, and it went through 2 complete runs (if I remember correctly, those are "passes") and nothing was found faulty.


_martin said:


> On a contrary I think it's a bad driver and you are toggling the bug in it. Judging from that failed mutex.
> Maybe you could ask in a mailing lists and/or contact port maintainers ( graphics/drm-fbsd12.0-kmod).


This is likely it. I'll have to do this soon while I'm not feeling scatterbrained now. Do you have any suggestions for a mailing list? I'll be sure to contact the port maintainers as well.


----------



## _martin (May 4, 2021)

CodeJoule said:


> Do you have any suggestions for a mailing list?


As this is port I'd start with the /usr/ports/graphics/drm-fbsd12.0-kmod/Makefile where you can find the following:


```
# Created by: Johannes Dieterich <jmd@FreeBSD.org>
..
..
MAINTAINER=    x11@FreeBSD.org
```
 x11 is the official mailing list so I think that's a good start.


----------



## Jose (May 4, 2021)

CodeJoule said:


> ...Sometimes I get black squares with fuzzy stuff inside them but usually I just restart the program having that issue and it fixes itself...


Sounds like a bad video card to me. They are mortal, unfortunately.


----------



## CodeJoule (May 5, 2021)

Jose said:


> Sounds like a bad video card to me. They are mortal, unfortunately.


But these bugs and crashes don't happen at all while using GNU/Linux on the same hardware. Hopefully this can get resolved. I love FreeBSD very much and plan to start contributing as soon as I can learn to make ports.


----------

