Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text-input-v3 clients sometimes crash Hyprland #5189

Closed
q234rty opened this issue Mar 20, 2024 · 20 comments
Closed

text-input-v3 clients sometimes crash Hyprland #5189

q234rty opened this issue Mar 20, 2024 · 20 comments
Labels
bug Something isn't working

Comments

@q234rty
Copy link
Contributor

q234rty commented Mar 20, 2024

Hyprland Version

System/Version info
Hyprland, built from branch main at commit 9ddf1b105e1b63a77b851af5e541a9412b0e0928 dirty (tablet: Add left_handed option for tablets (5178)).
Date: Wed Mar 20 12:00:43 2024
Tag: v0.37.1-29-g9ddf1b10

flags: (if any)


System Information:
System name: Linux
Node name: arch-g14
Release: 6.8.1-arch1-1
Version: #1 SMP PREEMPT_DYNAMIC Sat, 16 Mar 2024 17:15:35 +0000


GPU information: 
04:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Renoir [Radeon RX Vega 6 (Ryzen 4000/5000 Mobile Series)] [1002:1636] (rev c6) (prog-if 00 [VGA controller])


os-release: NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo


plugins:
  hy3 by outfoxxed ver 0.1

Bug or Regression?

Regression

Description

When using text-input-v3 clients, hyprland sometimes crashes. Haven't bisected yet but I guess this is a regression from #5147 , so CC @sujoshua .

How to reproduce

It happens when using text-input-v3 clients but I'm not sure how to reliable repro.

Crash reports, logs, images, videos

This is a full gdb session, including bt full and printing some variables.
gdb.txt

@q234rty q234rty added the bug Something isn't working label Mar 20, 2024
@sujoshua
Copy link
Contributor

This issue, at first glance, seems to occur because when switching windows, an attempt is made to send a send_leave to the previously focused window. However, it appears that the PTI object of the previous window has already been reclaimed by the time send_leave is sent.

I have never encountered this issue locally. Could you please pay attention to which software's window this issue occurs when leaving? Of course, I will also dig deeper into this tomorrow (GMT+8).

@q234rty
Copy link
Contributor Author

q234rty commented Mar 20, 2024

It's mostly gtk3 software (I don't have GTK_IM_MODUlE set, so gtk3 uses tiv3)

@FUFSoB
Copy link
Contributor

FUFSoB commented Mar 20, 2024

Same issue here. Reliable steps to reproduce:

  1. Have /usr/bin/foot --server=3 active with either exec-once = ... or systemctl --user start foot-server
  2. Open footclient with keybind on empty workspace
  3. Close footclient
  4. Open footclient (or anything else, also tested with Qt and Chromium apps) and get a crash

@vaxerski
Copy link
Member

patch.txt
try this

@q234rty
Copy link
Contributor Author

q234rty commented Mar 20, 2024

Unfortunately Hyprland seem to crash with the same bt more under the above patch.

@vaxerski
Copy link
Member

well dunno then, can't really repro in a nest. I'll let @sujoshua try and repro this

@sujoshua
Copy link
Contributor

reproduced. Foot in server mode will not send destory event to Hyprland when a window is closed. Hmm.. then a listener to listen surface destoryed in Hyprland side is needed

@Zyuke
Copy link

Zyuke commented Mar 21, 2024

encountered similar random crashes when exiting kitty terminal / switching between workspaces

crash report on kitty exit:
hyprlandCrashReport3095.txt

crash report on workspace switching:
hyprlandCrashReport16235.txt

sujoshua added a commit to sujoshua/Hyprland that referenced this issue Mar 21, 2024
fix hyprwm#5189

add surface destory listner to remove itself from map

Signed-off-by: Joshua Su <i@joshua.su>
sujoshua added a commit to sujoshua/Hyprland that referenced this issue Mar 21, 2024
fix hyprwm#5189

add surface destroy listener to remove itself from map

Signed-off-by: Joshua Su <i@joshua.su>
@Elixity1
Copy link

I believe I have the same problem too, infact my hyprland crashed while making this report and I had to re-write this so thats fun. Anyway I got a problem with something to do with text-input-v1 clients registering as v3 or something weird but that's also crashing my thing.

Opening Kvantum: hyprlandCrashReport927.txt

Opening KDE system setting by accident: hyprlandCrashReport3874.txt

@vaxerski
Copy link
Member

patch.txt
reprod and this seems to fix it for me

sujoshua added a commit to sujoshua/Hyprland that referenced this issue Mar 22, 2024
fix hyprwm#5189

add surface destroy listener to remove itself from map

Signed-off-by: Joshua Su <i@joshua.su>
@FUFSoB
Copy link
Contributor

FUFSoB commented Mar 22, 2024

Patch does fix original repro steps, but does not fix it if on step 2 you open two footclient instances.

@vaxerski
Copy link
Member

I've debugged that - it seems like case 2 is a wlr bug? Anyways it looks unrelated to this so I'll commit the patch.

vaxerski added a commit that referenced this issue Mar 22, 2024
@vaxerski
Copy link
Member

it's not a wlr bug - it's a regression from #5147 that I am unable to track down why it happens.

@vaxerski
Copy link
Member

found it. Will post a patch soon. Very poor wlroots design

@vaxerski
Copy link
Member

should be done.

@moetayuko
Copy link

There's still something wrong. I can't use IME in Firefox textboxes, and the workaround is to move focus to another window and move back. The process must be repeated once the textbox loses focus (e.g. mouse click on a link).

@vaxerski
Copy link
Member

vaxerski commented Mar 24, 2024

I use firefox daily and have never encountered that. Repro steps? (also always try updating first)

@moetayuko
Copy link

I use firefox daily and have never encountered that. Repro steps? (also always try updating first)

Just upgraded to acf15e5 but still reproducible. I use fcitx5 and set ctrl+shift as the switching combo:

  1. Launch Firefox
  2. focus any textbox (the built-in address bar or one on the webpage) and press ctrl+shift, it may or may not respond depending on the initial window state
  3. (if step2 responded) click anywhere else to unfocus from the textbox, then click the textbox to focus again, ctrl+shift will no longer respond and IME won't be activated
  4. move the cursor to focus on any other application window, then move back to Firefox, you should be able to activate the IME now
  5. repeat step4 once the textbox lost focus

@sungyoonc
Copy link
Contributor

@moetayuko Can you try ae52b7f?

@moetayuko
Copy link

@moetayuko Can you try ae52b7f?

It works, thanks for the fix.

lisuke pushed a commit to lisuke/Hyprland that referenced this issue Apr 15, 2024
lisuke pushed a commit to lisuke/Hyprland that referenced this issue Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants