jordansissel / xdotool

fake keyboard/mouse input, window management, and more
Other
3.28k stars 321 forks source link

Segmentation Fault when running xdotool with specific parameters #474

Open Perlover opened 1 month ago

Perlover commented 1 month ago

I compiled the latest master branch from source on Ubuntu 22.04. The commit I used is: f61ed0e32123c73c0e429f6adecc421fe4383e00.

When I run the following command, it crashes with a core dump:

xdotool selectwindow windowactivate --sync type $'fdisk /dev/nvme0n1\n'

Here are the libraries I installed for a compiling from sources:

sudo apt install libx11-dev libxtst-dev libxi-dev libxkbcommon-dev libxinerama-dev

I'm attaching the Segmentation Fault log to help fix the bug. Thank you for your attention and respect.

$ coredumpctl dump 110610
           PID: 110610 (xdotool)
           UID: 1000 (user)
           GID: 1000 (user)
        Signal: 11 (SEGV)
     Timestamp: Fri 2024-10-11 09:35:07 CEST (2min 51s ago)
  Command Line: xdotool selectwindow windowactivate --sync type $'fdisk /dev/nvme0n1\n'
    Executable: /usr/bin/xdotool
 Control Group: /user.slice/user-1000.slice/user@1000.service/app.slice/app-org.gnome.Terminal.slice/vte-spawn-0bbc458d-ae60-4db5-bbba-78bf5f2ab17c.scope
          Unit: user@1000.service
     User Unit: vte-spawn-0bbc458d-ae60-4db5-bbba-78bf5f2ab17c.scope
         Slice: user-1000.slice
     Owner UID: 1000 (user)
      Hostname: user-comp
       Storage: /var/lib/systemd/coredump/core.xdotool.1000.fe0c8fef86c94557aa4d9c811d89291f.110610.1728632107000000.zst (present)
     Disk Size: 92.1K
       Message: Process 110610 (xdotool) of user 1000 dumped core.

                Found module linux-vdso.so.1 with build-id: 9e059cbd8aed3f74f06828a2211aea12df2a5a77
                Found module libXfixes.so.3 with build-id: a9c550a40b8154a3b4b5e2ac182bb50c013c3f18
                Found module libXrender.so.1 with build-id: 7ccbfa4c24e93c42fa50dd2e42fa277630f9650c
                Found module libXcursor.so.1 with build-id: d936a5db46d8babb0f2cc490df36b6b18a16d8aa
                Found module libmd.so.0 with build-id: cd2d2f71b3967ebde30e2aa43b8eb63339020c06
                Found module libbsd.so.0 with build-id: 9a6c72469251e2feb63e175ef5cb944ce6e00df3
                Found module libXdmcp.so.6 with build-id: 6b60f99504aa1d3999ea02a14366d1a39d6c5dcf
                Found module libXau.so.6 with build-id: 7089b383cacbfc1760634a3be19a923e51fe3315
                Found module libXext.so.6 with build-id: 9fb1880e02dfa11a8c39cd1a170109de08302059
                Found module libxcb.so.1 with build-id: 1bef862a339557aa16c34c7a4b27f8f3aea90517
                Found module ld-linux-x86-64.so.2 with build-id: 4186944c50f8a32b47d74931e3f512b811813b64
                Found module libxkbcommon.so.0 with build-id: a4b17d939092101dc8f6b2a1d70eaf1fddb2dd51
                Found module libXinerama.so.1 with build-id: 9823bebfa26a681265db4aeb09abf44deec38401
                Found module libXtst.so.6 with build-id: ba729667b51a90cf9453f98024bfa44ca25758b7
                Found module libc.so.6 with build-id: 490fef8403240c91833978d494d39e537409b92e
                Found module librt.so.1 with build-id: fa3a0740c79389792000620954a14ee7c2126aa0
                Found module libX11.so.6 with build-id: 37a5d7bbb78e3a99ea8376a7c80ea0c62fe06494
                Found module libm.so.6 with build-id: a508ec5d8bf12fb7fd08204e0f87518e5cd0b102
                Found module libxdo.so.3 with build-id: 9711aaf3d6e3cd59eed97c0de63e65cec0374e90
                Found module xdotool with build-id: 1ae5fb4cfd7a0f71b42db58cd40b760aa0918438
                Stack trace of thread 110610:
                #0  0x0000759e920f8b08 XCreateGC (libX11.so.6 + 0x1eb08)
                #1  0x0000759e91dd2edd XcursorImageLoadCursor (libXcursor.so.1 + 0x3edd)
                #2  0x0000759e91dd3955 XcursorImagesLoadCursor (libXcursor.so.1 + 0x4955)
                #3  0x0000759e91dd5b2d XcursorTryShapeCursor (libXcursor.so.1 + 0x6b2d)
                #4  0x0000759e920f7125 XCreateGlyphCursor (libX11.so.6 + 0x1d125)
                #5  0x0000759e920fbd5e XCreateFontCursor (libX11.so.6 + 0x21d5e)
                #6  0x0000759e923090b8 xdo_select_window_with_click (libxdo.so.3 + 0x80b8)
                #7  0x000058a599a0a4d3 n/a (xdotool + 0xa4d3)
                #8  0x000058a599a043fd n/a (xdotool + 0x43fd)
                #9  0x000058a599a04ce0 n/a (xdotool + 0x4ce0)
                #10 0x0000759e91e29d90 __libc_start_call_main (libc.so.6 + 0x29d90)
                #11 0x0000759e91e29e40 __libc_start_main_impl (libc.so.6 + 0x29e40)
                #12 0x000058a599a03d4a n/a (xdotool + 0x3d4a)