0

I'm trying to debug Hyprland and running it with gdb completely freezes all keyboard input and forces you to restart the computer. You can't Ctrl+C or Ctrl+Alt+F[1-6] to get away. It's completely stuck.

Does anyone know what may be causing it? Or even better know any way to escape when it happens? Or at least stop linux from switching you to that tty when it happens when you debug it with gdbserver remotely from another tty?

  • Please ignore my previous comments (now deleted). I just noticed your last sentence: what do you mean by "switching"? Debugging Hyprland triggers a console switch? Maybe it's only during the startup phase? Did you try to run Hyprland, switch to console (ctrl-alt-fn), and then attach gdb to the running Hyprland? – xhienne Oct 18 '23 at 23:23
  • Another thought: to escape the freeze: try chvt through ssh – xhienne Oct 18 '23 at 23:25
  • 1
    Thanks, by switching I mean that you are debugging a process that runs on tty3 from tty1. Then this "freezing crash" happens linux kicks you out of tty1 and into tty3. Thank you for mentioning ssh - that's what I'm trying now as well - loginctl terminate-session ID (something happened with Termux, but I should get it to work in a moment). – Daniel Krajnik Oct 18 '23 at 23:37
  • So, you are debugging locally (on tty1), not remotely? If you are using gdb in console: try running it in a screen session. If you are stuck, you can get your gdb session back from ssh (ssh ... screen -x) and then you can continue your debugging. PS: you didn't address my suggestion to attach to a running Hyprland process: does this trigger a console switch too? – xhienne Oct 18 '23 at 23:44
  • Okay, sshing from another machine and running loginctl terminate-session worked. Good news. Thanks for assistance. – Daniel Krajnik Oct 18 '23 at 23:48
  • Can't use screen sadly. I originally used tmux only to find out that Hyprland needs to start from "raw" tty. Changing this would invalidate results of debugging. – Daniel Krajnik Oct 18 '23 at 23:49
  • Sorry, I didn't understand originally what you meant by attaching to running Hyprland process. Do you mean starting it on tty3 gdb Hyprland, then gdb attach <PID> on tty1? Instead of using gdbserver? Because I tried that as well, but this gave error ptrace: Operation not permitted.. – Daniel Krajnik Oct 18 '23 at 23:51
  • Yes, this was roughly what I meant. Hyprland in tty3 (without gdb) and gdb -p elsewhere. You probably need to be root for that. – xhienne Oct 18 '23 at 23:57
  • Yes, I wanted to set it up this way as well, but running a gdbserver may be more secure than running gdb as root or removing the default /proc/sys/kernel/yama/ptrace_scope setting. – Daniel Krajnik Oct 19 '23 at 00:04

0 Answers0