You are not logged in.

#1 2020-07-20 15:44:16

Birdy14
Member
Registered: 2020-07-20
Posts: 13

[SOLVED] startx freezes system

When I execute startx in a tty, my system freezes.
This is how it looks like.
Running Xorg using xinit works, but "loginctl show-session $XDG_SESSION_ID" returns Active=no and there are permission issues with systemd.
"sh -x startx" shows that startx freezes on

xinit /home/moritz/.xinitrc -- /etc/X11/xinit/xserverrc :0 vt2 -keeptty -auth /tmp/serverauth.fr61p0m1GO

So I tried running (I am on tty2)

xinit /home/moritz/.xinitrc -- /etc/X11/xinit/xserverrc vt2

but the result is the same - the system freezes.
If I run

xinit /home/moritz/.xinitrc -- /etc/X11/xinit/xserverrc -keeptty

, dwm starts, but it doesn't respond to my mouse and keyboard at all.

This is my .xinitrc:

#!/bin/sh

if [ -d /etc/X11/xinit/xinitrc.d ]; then
    for f in /etc/X11/xinit/xinitrc.d/?*.sh; do
        [ -x "$f" ] && . "$f"
    done
    unset f
fi

exec dwm

I have the same issue on my laptop, so there must be a configuration error somewhere.
The xorg.conf is generated by nvidia-settings on my desktop and by "X -configure" on my laptop.

Last edited by Birdy14 (2020-07-21 15:52:49)

Offline

#2 2020-07-20 15:46:34

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] startx freezes system

Generating an Xorg config that you likely don't need will just lead to brokeness.

Last edited by jasonwryan (2020-07-20 15:47:21)


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2020-07-20 15:57:56

Birdy14
Member
Registered: 2020-07-20
Posts: 13

Re: [SOLVED] startx freezes system

jasonwryan wrote:

Generating an Xorg config that you likely don't need will just lead to brokeness.

I just renamed my xorg.conf, but the problem stays the same

Offline

#4 2020-07-20 16:32:21

loqs
Member
Registered: 2014-03-06
Posts: 18,917

Re: [SOLVED] startx freezes system

Please post the contents of Xorg.log and the output of `lspci | grep -e VGA -e 3D`

Offline

#5 2020-07-20 16:45:22

Birdy14
Member
Registered: 2020-07-20
Posts: 13

Re: [SOLVED] startx freezes system

loqs wrote:

Please post the contents of Xorg.log and the output of `lspci | grep -e VGA -e 3D`

Output of `lspci | grep -e VGA -e 3D`:

27:00.0 VGA compatible controller: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] (rev a1)

/var/log/Xorg.0.log: https://gist.github.com/Birdy2014/af17a … xorg-0-log

Last edited by Birdy14 (2020-07-20 20:11:30)

Offline

#6 2020-07-20 18:37:47

loqs
Member
Registered: 2014-03-06
Posts: 18,917

Re: [SOLVED] startx freezes system

What is the output of:

dmesg
ps -ly -C Xorg

Last edited by loqs (2020-07-20 18:40:44)

Offline

#7 2020-07-20 18:52:57

Birdy14
Member
Registered: 2020-07-20
Posts: 13

Re: [SOLVED] startx freezes system

loqs wrote:

What is the output of:

dmesg
ps -ly -C Xorg

Output of "dmesg" (while Xorg is not running): https://gist.github.com/Birdy2014/af17a … file-dmesg
Output of "ps -ly -C Xorg" (while Xorg is running using "xinit"): https://gist.github.com/Birdy2014/af17a … -ly-c-xorg

Last edited by Birdy14 (2020-07-20 18:55:27)

Offline

#8 2020-07-20 18:56:25

loqs
Member
Registered: 2014-03-06
Posts: 18,917

Re: [SOLVED] startx freezes system

By stuck the system is unresponsive and you have to perform a hard reboot?  What is the end of the journal from a stuck boot?

Offline

#9 2020-07-20 19:15:52

Birdy14
Member
Registered: 2020-07-20
Posts: 13

Re: [SOLVED] startx freezes system

loqs wrote:

By stuck the system is unresponsive and you have to perform a hard reboot?  What is the end of the journal from a stuck boot?

Yes, the system is unresponsive after running startx and I have to perform a hard reboot.
This should be the journal from the boot running startx: https://gist.github.com/Birdy2014/af17a … le-journal

Offline

#10 2020-07-20 20:07:40

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,009

Re: [SOLVED] startx freezes system

The posted Xorg log is actually a dmesg?

Wild guess, try passing "nvidia-drm.modeset=1" to the kernel.

Offline

#11 2020-07-20 20:12:45

Birdy14
Member
Registered: 2020-07-20
Posts: 13

Re: [SOLVED] startx freezes system

seth wrote:

The posted Xorg log is actually a dmesg?

Wild guess, try passing "nvidia-drm.modeset=1" to the kernel.

I corrected the link to the Xorg log and will try the nvidia-drm.modeset=1 now.

Offline

#12 2020-07-20 20:16:10

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,009

Re: [SOLVED] startx freezes system

Seems to happen when the vesa driver is loaded.
Why is xf86-video-vesa installed itfp?

Offline

#13 2020-07-20 20:29:10

Birdy14
Member
Registered: 2020-07-20
Posts: 13

Re: [SOLVED] startx freezes system

seth wrote:

Seems to happen when the vesa driver is loaded.
Why is xf86-video-vesa installed itfp?

I think xf86-video-vesa was still installed from when I (unsuccessfully) tried vga passthrough. Uninstalling it didn't change anything.
Adding "nvidia-drm.modeset=1" to the kernel command line caused the screen to go blank for a second after running startx.

Offline

#14 2020-07-20 20:38:15

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,009

Re: [SOLVED] startx freezes system

Updated xorg log?

Offline

#15 2020-07-20 20:54:22

Birdy14
Member
Registered: 2020-07-20
Posts: 13

Re: [SOLVED] startx freezes system

seth wrote:

Updated xorg log?

I just deleted all Xorg logs under /var/log/Xorg* and .local/share/xorg/ and ran startx.
After the hard reboot, there was only an empty file under /var/log/Xorg.0.log.
So apparently xorg doesn't generate any log file when startx fails and the original Xorg.0.log that I posted was from a successful start using "xinit".
This is the new Xorg.0.log from "xinit".

Offline

#16 2020-07-21 06:06:43

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,009

Re: [SOLVED] startx freezes system

If xinit works but startx doesn't it's not a problem w/ the server (despite you re-added the nvidia-xconfig generated config file… and w/o "nvidia-drm.modeset=1")

For completeness: do you use the same VT?
https://wiki.archlinux.org/index.php/Xinit#xserverrc

Also: do you just run "xinit" resp. "startx" or do you pass some arguments?

stat /bin/sh
type startx
type xinit

Offline

#17 2020-07-21 07:22:27

Birdy14
Member
Registered: 2020-07-20
Posts: 13

Re: [SOLVED] startx freezes system

seth wrote:

If xinit works but startx doesn't it's not a problem w/ the server (despite you re-added the nvidia-xconfig generated config file… and w/o "nvidia-drm.modeset=1")

For completeness: do you use the same VT?
https://wiki.archlinux.org/index.php/Xinit#xserverrc

Also: do you just run "xinit" resp. "startx" or do you pass some arguments?

stat /bin/sh
type startx
type xinit

I use the default xserverrc, which doesn't specify any vt. When I run startx (without arguments), it tries to use the same vt, which fails.
Running xinit (also without arguments) uses the next free vt, which works.
When I start the X server on any different vt than the current one, everything works fine.
But this is not a permanent solution, because systemd has permission problems when the X server is started on another vt.

Last edited by Birdy14 (2020-07-21 07:29:52)

Offline

#18 2020-07-21 12:13:38

Birdy14
Member
Registered: 2020-07-20
Posts: 13

Re: [SOLVED] startx freezes system

I just managed to log into my computer using ssh while it was stuck (I executed "startx" without any arguments).
After I killed the Xorg process, the system worked again normally and I got an Xorg log!
Here it is: https://gist.github.com/Birdy2014/af17a … xorg-1-log
It says that is disabled the keyboard and mouse and it just stops after loading the nvidia driver, do you have any idea why?

Offline

#19 2020-07-21 12:44:06

Birdy14
Member
Registered: 2020-07-20
Posts: 13

Re: [SOLVED] startx freezes system

I used ssh to attach gdb to the frozen Xorg process and it says:

Program received signal SIGTTOU, Stopped (tty output).
0x00007fb976f71f48 in tcsetattr () from /usr/lib/libc.so.6

I have no idea what that means, but it didn't occur on a successful start of Xorg using xinit.
Apparently this signal can be ignored using "stty tostop", which suppressed any output of Xorg. Instead, it said

waiting for X server to begin accepting connections .

Then it printed a lot of dots until it finally gave up:

xinit: giving up
xinit: unable to connect to X server: Connection refused

waiting for X server to shut down ..........
xinit: X server slow to shut down, sending KILL signal

waiting for X server to die ...
xinit: X server refuses to die

Offline

#20 2020-07-21 13:10:36

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,009

Re: [SOLVED] startx freezes system

Please don't bump - if noone has responded, just edit your previous post.

keybpard and mouse are diabled, because nvidia-xconfig writes a config full of cruft (and the kbd and mouse drivers aren't available or even maintained anymore) - that's insignificant.
If you attach gdb to a process, the latter will stop. You'll have to tell gdb to "continue" to … well, guess what ;-) - so this is normal as well (unless the process is actually stopped *before* you attach gdb)

The interesting aspect is that you cannot re-use the VT and the log stops when loading the nvidia driver.

1. remove the xorg.conf
2. add "nvidia-drm.modeset=1" to the kernel (if you think it should be there: it's not. You likely have to recreate grub-mkconfig or add it at the command line)
3. https://wiki.archlinux.org/index.php/GR … ramebuffer (nvidia doesn't officially support framebuffer consoles)

Offline

#21 2020-07-21 13:43:53

Birdy14
Member
Registered: 2020-07-20
Posts: 13

Re: [SOLVED] startx freezes system

seth wrote:

Please don't bump - if noone has responded, just edit your previous post.

keybpard and mouse are diabled, because nvidia-xconfig writes a config full of cruft (and the kbd and mouse drivers aren't available or even maintained anymore) - that's insignificant.
If you attach gdb to a process, the latter will stop. You'll have to tell gdb to "continue" to … well, guess what ;-) - so this is normal as well (unless the process is actually stopped *before* you attach gdb)

The interesting aspect is that you cannot re-use the VT and the log stops when loading the nvidia driver.

1. remove the xorg.conf
2. add "nvidia-drm.modeset=1" to the kernel (if you think it should be there: it's not. You likely have to recreate grub-mkconfig or add it at the command line)
3. https://wiki.archlinux.org/index.php/GR … ramebuffer (nvidia doesn't officially support framebuffer consoles)

Sorry for bumping, I won't do it again.
When debugging with gdb, it stopped with the mentioned message before attaching and after I tried to continue. That's why I mentioned that it worked fine on a working Xorg (started with xinit).
I followed your suggestions (and yes, I did recreate the grub config and edited the grub boot entry when trying 2. previously), but the result was the same as when I tried 2 before:
The screen went blank for a second, the message from Xorg returned and any input from keyboard and mouse is ignored.
"GRUB_TERMINAL_OUTPUT=console" was uncommented in my /etc/default/grub anyway.
I also tried reinstalling xorg-server, xorg-xinit and nvidia, but that didn't change anything.

Edit: When "nvidia-drm.modeset=1" is set, I can't even start Xorg using xinit:

parse_vt_settings: Cannot open /dev/tty0 (Permission denied)

Maybe I should just reinstall Arch...

Last edited by Birdy14 (2020-07-21 14:11:30)

Offline

#22 2020-07-21 14:21:04

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,009

Re: [SOLVED] startx freezes system

'key so Xorg gets a SIGTTOU and stops.

Let's play w/ xinit:
Use the xserverrc to re-use the terminal. See what happens.
Also try the "-keeptty" and "-quiet" parameters (before the -nolisten… switch) to see whether they've any impact.

(Obviously start X11 w/ xinit, not startx)

Edit: the error is because you're running Xorg rootless but don't re-use the VT.
Re-installing is unlikely to cause a difference. This isn't windows.

Last edited by seth (2020-07-21 14:22:36)

Offline

#23 2020-07-21 15:48:54

Birdy14
Member
Registered: 2020-07-20
Posts: 13

Re: [SOLVED] startx freezes system

seth wrote:

'key so Xorg gets a SIGTTOU and stops.

Let's play w/ xinit:
Use the xserverrc to re-use the terminal. See what happens.
Also try the "-keeptty" and "-quiet" parameters (before the -nolisten… switch) to see whether they've any impact.

(Obviously start X11 w/ xinit, not startx)

Edit: the error is because you're running Xorg rootless but don't re-use the VT.
Re-installing is unlikely to cause a difference. This isn't windows.

I just re-installed Arch on my desktop and that solved the issue.
The reason was probably because I broke something when I tried vga passthrough.
Anyway, thank you very much!

Edit: I found the real reason: I had symlinked /usr/bin/sh to zsh, because I thought that any bash compatible shell could be used and I used zsh. Apparently this breaks startx.

Last edited by Birdy14 (2020-07-21 17:43:42)

Offline

Board footer

Powered by FluxBB