kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
23.94k stars 968 forks source link

Occasionally exit abnormally #4743

Closed electricface closed 2 years ago

electricface commented 2 years ago

Describe the bug Occasionally exit abnormally

To Reproduce Steps to reproduce the behavior:

  1. use fcitx5 as input method.
  2. set env GLFW_IM_MODULE=ibus, then run kitty.
  3. use it for a while, found it exited abnormally.
  4. See error

    
    del1@del-PC:~$ coredumpctl debug 9205
    Hint: You are currently not seeing messages from other users and the system.
      Users in groups 'adm', 'systemd-journal' can see all messages.
      Pass -q to turn off this notice.
           PID: 9205 (kitty)
           UID: 1000 (del1)
           GID: 1000 (del)
        Signal: 6 (ABRT)
     Timestamp: Thu 2022-02-24 09:06:34 CST (20min ago)
    Command Line: kitty --title Kitty Terminal
    Executable: /home/del0/.local/kitty.app/bin/kitty
    Control Group: /user.slice/user-1000.slice/session-2.scope
          Unit: session-2.scope
         Slice: user-1000.slice
       Session: 2
     Owner UID: 1000 (del1)
       Boot ID: 996ca4c225ce44a0ba8fa6f78766b909
    Machine ID: 16d5a2c815b04d9d952d99d475d088bd
      Hostname: del-PC
       Storage: /var/lib/systemd/coredump/core.kitty.1000.996ca4c225ce44a0ba8fa6f78766b909.9205.1645664794000000.lz4
       Message: Process 9205 (kitty) of user 1000 dumped core.
    
                Stack trace of thread 9205:
                #0  0x00007fe1974978eb __GI_raise (libc.so.6)
                #1  0x00007fe197482535 __GI_abort (libc.so.6)
                #2  0x00007fe1917a9d5d _dbus_abort (libdbus-1.so.3)
                #3  0x00007fe1917cb950 _dbus_warn_check_failed (libdbus-1.so.3)
                #4  0x00007fe1917bb6b1 dbus_message_new_method_call (libdbus-1.so.3)
                #5  0x00007fe191de4b8b n/a (/home/del0/.local/kitty.app/lib/kitty-extensions/kitty.glfw-x11.so)

GNU gdb (Uos 8.2.1.1-1+security) 8.2.1 Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/.

For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /home/del0/.local/kitty.app/bin/kitty...(no debugging symbols found)...done. [New LWP 9205] [New LWP 9206] [New LWP 9208] [New LWP 9207] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `kitty --title Kitty Terminal'. Program terminated with signal SIGABRT, Aborted.

0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50

50 ../sysdeps/unix/sysv/linux/raise.c: 没有那个文件或目录. [Current thread is 1 (Thread 0x7fe1972ce740 (LWP 9205))] (gdb) bt

0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50

1 0x00007fe197482535 in __GI_abort () at abort.c:79

2 0x00007fe1917a9d5d in _dbus_abort () at ../../../dbus/dbus-sysdeps.c:93

3 0x00007fe1917cb950 in _dbus_warn_check_failed (

format=format@entry=0x7fe1917dbce8 "arguments to %s() were incorrect, assertion \"%s\" failed in file %s line %d.\nThis is normally a bug in some application using the D-Bus library.\n") at ../../../dbus/dbus-internals.c:281

4 0x00007fe1917cc08a in _dbus_warn_return_if_fail (function=function@entry=0x7fe1917daa60 <__func__.5239> "dbus_message_new_method_call",

assertion=assertion@entry=0x7fe1917d6ca0 "path != NULL", file=file@entry=0x7fe1917d9f3d "../../../dbus/dbus-message.c", line=line@entry=1362) at ../../../dbus/dbus-internals.c:936

5 0x00007fe1917bb6b1 in dbus_message_new_method_call (destination=, path=, iface=, method=)

at ../../../dbus/dbus-message.c:1362

6 0x00007fe191de4b8b in ?? () from /home/del0/.local/kitty.app/lib/kitty-extensions/kitty.glfw-x11.so

7 0x00007fe191dd739f in glfwUpdateIMEState () from /home/del0/.local/kitty.app/lib/kitty-extensions/kitty.glfw-x11.so

8 0x00007fe194983438 in ?? () from /home/del0/.local/kitty.app/lib/kitty-extensions/kitty.fast_data_types.so

9 0x00007fe191dd0263 in ?? () from /home/del0/.local/kitty.app/lib/kitty-extensions/kitty.glfw-x11.so

10 0x00007fe191dea6c6 in ?? () from /home/del0/.local/kitty.app/lib/kitty-extensions/kitty.glfw-x11.so

11 0x00007fe191dd9f63 in glfwRunMainLoop () from /home/del0/.local/kitty.app/lib/kitty-extensions/kitty.glfw-x11.so

12 0x00007fe19496e368 in ?? () from /home/del0/.local/kitty.app/lib/kitty-extensions/kitty.fast_data_types.so

13 0x00007fe1977bdffd in ?? () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

14 0x00007fe197834098 in _PyEval_EvalFrameDefault () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

15 0x00007fe1977dcd39 in ?? () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

16 0x00007fe1977dd927 in _PyFunction_Vectorcall () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

17 0x00007fe197833dd9 in _PyEval_EvalFrameDefault () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

18 0x00007fe1977dcd39 in ?? () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

19 0x00007fe197830c68 in _PyObject_FastCallDictTstate () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

20 0x00007fe197831378 in _PyObject_Call_Prepend () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

21 0x00007fe19783148c in ?? () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

22 0x00007fe197777adf in _PyObject_MakeTpCall () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

23 0x00007fe197837ef2 in _PyEval_EvalFrameDefault () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

24 0x00007fe1977ddba3 in _PyFunction_Vectorcall () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

25 0x00007fe197833dd9 in _PyEval_EvalFrameDefault () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

26 0x00007fe1977ddba3 in _PyFunction_Vectorcall () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

27 0x00007fe197833dd9 in _PyEval_EvalFrameDefault () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

28 0x00007fe1977ddba3 in _PyFunction_Vectorcall () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

29 0x00007fe197833dd9 in _PyEval_EvalFrameDefault () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

30 0x00007fe1977dcd39 in ?? () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

31 0x00007fe1977dd772 in _PyEval_EvalCodeWithName () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

32 0x00007fe1977dd7c3 in PyEval_EvalCodeEx () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

33 0x00007fe1977dd7eb in PyEval_EvalCode () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

34 0x00007fe1978305ac in ?? () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

35 0x00007fe1977bd979 in ?? () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

36 0x00007fe197833dd9 in _PyEval_EvalFrameDefault () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

37 0x00007fe1977dcd39 in ?? () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

38 0x00007fe1977dd927 in _PyFunction_Vectorcall () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

39 0x00007fe197833dd9 in _PyEval_EvalFrameDefault () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

40 0x00007fe1977dcd39 in ?? () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

41 0x00007fe1977dd927 in _PyFunction_Vectorcall () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

42 0x00007fe1977b29ec in PyVectorcall_Call () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

43 0x00007fe1978993ba in ?? () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

44 0x00007fe1978a5cd8 in Py_RunMain () from /home/del0/.local/kitty.app/bin/../lib/libpython3.9.so.1.0

--Type for more, q to quit, c to continue without paging--

45 0x0000559b4e2f2c7e in main ()


**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment details**

Press Ctrl+Shift+F6 (cmd+option+comma on macOS) in kitty, to copy debug output about kitty and its configuration to the clipboard and paste it here.

kitty 0.24.2 created by Kovid Goyal Linux del-PC 4.19.0-amd64-desktop #5020 SMP Fri Jan 14 10:47:29 CST 2022 x86_64 UnionTech OS GNU/Linux 20 del-PC /dev/tty

DISTRIB_ID=uos DISTRIB_RELEASE=20 DISTRIB_DESCRIPTION="UnionTech OS 20" DISTRIB_CODENAME=eagle Running under: X11 Frozen: True Paths: kitty: /home/del0/.local/kitty.app/bin/kitty base dir: /home/del0/.local/kitty.app/lib/kitty extensions dir: /home/del0/.local/kitty.app/lib/kitty-extensions system shell: /bin/bash Loaded config files: /home/del0/.config/kitty/kitty.conf

Config options different from defaults: allow_remote_control y editor vim enabled_layouts ['splits', 'grid', 'horizontal', 'vertical', 'tall', 'fat', 'stack'] font_family Source Code Pro font_size 13.0 listen_on unix:${XDG_RUNTIME_DIR}/kitty shell /usr/bin/fish tab_bar_style slant visual_window_select_characters QWERTASDFGYUIOPHJKLZXCVBNM1234567890 Added shortcuts: alt+f > space → next_layout alt+f > , → set_tab_title alt+f > - → launch --location hsplit --cwd current alt+f > 0 → goto_tab 10 alt+f > 1 → goto_tab 1 alt+f > 2 → goto_tab 2 alt+f > 3 → goto_tab 3 alt+f > 4 → goto_tab 4 alt+f > 5 → goto_tab 5 alt+f > 6 → goto_tab 6 alt+f > 7 → goto_tab 7 alt+f > 8 → goto_tab 8 alt+f > 9 → goto_tab 9 alt+f > \ → launch --location vsplit --cwd current alt+f > c → new_tab alt+f > h → neighboring_window left alt+f > j → neighboring_window down alt+f > k → neighboring_window up alt+f > l → neighboring_window right alt+f > m > h → move_window left alt+f > m > j → move_window down alt+f > m > k → move_window up alt+f > m > l → move_window right alt+f > m > q → swap_with_window alt+f > n → next_tab alt+f > p → previous_tab alt+f > q → focus_visible_window alt+f > z → toggle_layout stack Colors: background #1b1d1e
color0 #1b1d1e
color1 #f92672
color10 #b6e354
color11 #feed6c
color12 #3f78ff
color13 #9e6ffe
color14 #23ced4
color15 #f8f8f2
color2 #4df740
color3 #f3fd21
color4 #2656d6
color5 #8c54fe
color6 #37c8b4
color7 #ccccc6
color8 #505354
color9 #ff5995
cursor #fc971e
foreground #f8f8f8
selection_background #edd400

Environment variable names seen by the kitty process: DBUS_SESSION_BUS_ADDRESS DESKTOP_SESSION DISPLAY GDMSESSION GIO_LAUNCHED_DESKTOP_FILE GIO_LAUNCHED_DESKTOP_FILE_PID GLFW_IM_MODULE GNOME_DESKTOP_SESSION_ID GPG_AGENT_INFO GTK_IM_MODULE HOME INPUT_METHOD KITTY_LISTEN_ON LANG LANGUAGE LOGNAME PATH PWD QT_DBL_CLICK_DIST QT_IM_MODULE QT_LINUX_ACCESSIBILITY_ALWAYS_ON QT_LOGGING_RULES QT_QPA_PLATFORM SHELL SHLVL SSH_AUTH_SOCK SSL_CERT_FILE USER XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_CURRENT_DESKTOP XDG_DATA_HOME XDG_GREETER_DATA_DIR XDG_RUNTIME_DIR XDG_SEAT XDG_SEAT_PATH XDG_SESSION_CLASS XDG_SESSION_DESKTOP XDG_SESSION_ID XDG_SESSION_PATH XDG_SESSION_TYPE XDG_VTNR XMODIFIERS YOZO_HOME



**Additional context**
Try to reproduce the problem with `kitty --config NONE` if you cannot then post a minimal kitty.conf that reproduces the problem. If the problem involves interaction with some other terminal program post a minimal config for that program to reproduce the problem as well.
sorry i didn't try
kovidgoyal commented 2 years ago

I am going to need a way to reproduce or at the very least a trace generated after building kitty with

make asan

https://sw.kovidgoyal.net/kitty/build/

When you have one fo those, post it here and I will re-open.

electricface commented 2 years ago

The bug occurs when restarting fcitx5,

dbus_message_new_method_call reports an error, path should not be null glfw_dbus_call_method_no_reply glfw_xkb_update_ime_state _glfwPlatformUpdateIMEState glfwUpdateIMEState update_ime_position_for_window

I have a simple fix: add code

   if (path == NULL)
     {
         return false;
    }

to the call_method function of glfw/dbus_glfw.c.

electricface commented 2 years ago

The bug occurs when restarting fcitx5,

dbus_message_new_method_call reports an error, path should not be null glfw_dbus_call_method_no_reply glfw_xkb_update_ime_state _glfwPlatformUpdateIMEState glfwUpdateIMEState update_ime_position_for_window

I have a simple fix: add code

   if (path == NULL)
     {
         return false;

to the call_method function of glfw/dbus_glfw.c.