# What to do when X11 hangs forever



## shinchan (Jun 12, 2016)

Hi all,
I'm using FreeBSD on my laptop, but once in a while, some X11 application causes the system to hang forever (at least seemingly) and irresponsive to any mouse or keyboard event. I've tried `Ctrl+Alt+F1` to switch back to console, but that didn't help. So, what can I do when in such cases (besides powering down) and how to identify the process causing the hang?
Thanks.


----------



## SirDice (Jun 13, 2016)

If you have another machine you could try to ssh(1) into the machine. That will tell you if it's only X that's hanging or if there's more. If you can login you'll have the opportunity to do some troubleshooting.


----------



## scottro (Jun 13, 2016)

This also _might_ have to do with the Intel card. Do you have in /boot/loader.conf


```
kern.vty=vt
```

Assuming your laptop is using an Intel driver, this may, if it freezes, enable you to use ctl+alt+F1 to get to a console.


----------



## shinchan (Jun 14, 2016)

SirDice said:


> If you have another machine you could try to ssh(1) into the machine. That will tell you if it's only X that's hanging or if there's more. If you can login you'll have the opportunity to do some troubleshooting.


Sounds great,  I'll only have to wait for the next hang .
But what to do next? Suppose I could login via ssh, which indicates that the OS scheduling properly, how can I find the process causing the hang? Do I `top` to see the process taking up the most resources or something?
Also, I fogot to mention that `Ctrl+Alt+Del` (wired directly to kernel I guess?) wasn't effective either.


----------



## shinchan (Jun 14, 2016)

scottro said:


> This also _might_ have to do with the Intel card. Do you have in /boot/loader.conf
> 
> ```
> kern.vty=vt
> ...


Yes, I already have that line in my /boot/loader.conf, and I can switch between virtual consoles ---until the hang occurs.


----------



## SirDice (Jun 14, 2016)

shinchan said:


> Also, I fogot to mention that  Ctrl+Alt+Del (wired directly to kernel I guess?) wasn't effective either.


It only works on the console, not when X is started.


----------

