ReimuNotMoe / ydotool

Generic command-line automation tool (no X!)
GNU Affero General Public License v3.0
1.52k stars 82 forks source link

segfault in ydotoold when it receives any command #260

Closed rexendevar closed 6 days ago

rexendevar commented 1 week ago
execve("/usr/bin/ydotool", ["ydotool", "key", "1"], 0x7ffe63e25fe0 /* 55 vars */) = 0
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffe91dbeee0) = -1 EINVAL (Invalid argument)
brk(NULL)                               = 0x29fa8000
brk(0x29fa8e00)                         = 0x29fa8e00
arch_prctl(ARCH_SET_FS, 0x29fa8400)     = 0
uname({sysname="Linux", nodename="FlynnsOldSurface", ...}) = 0
set_tid_address(0x29fa86d0)             = 4260
set_robust_list(0x29fa86e0, 24)         = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x455de0, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x4564d0}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x455e80, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x4564d0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
readlink("/proc/self/exe", "/usr/bin/ydotool", 4096) = 16
brk(0x29fc9e00)                         = 0x29fc9e00
brk(0x29fca000)                         = 0x29fca000
mprotect(0x645000, 53248, PROT_READ)    = 0
futex(0x65a03c, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x65a048, FUTEX_WAKE_PRIVATE, 2147483647) = 0
brk(0x29ff0000)                         = 0x29ff0000
socket(AF_UNIX, SOCK_STREAM, 0)         = 3
connect(3, {sa_family=AF_UNIX, sun_path="/tmp/.ydotool_socket"}, 110) = 0
write(2, "ydotool: notice: Using ydotoold "..., 40ydotool: notice: Using ydotoold backend
) = 40
clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=100000000}, NULL) = 0
sendto(3, "\1\0\2\0\1\0\0\0", 8, 0, NULL, 0) = -1 EPIPE (Broken pipe)
--- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER, si_pid=4260, si_uid=1000} ---
+++ killed by SIGPIPE +++
rexendevar commented 1 week ago

and from the other side:

execve("/usr/bin/ydotoold", ["ydotoold"], 0x7ffe8dca1d10 /* 55 vars */) = 0
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffde10c41e0) = -1 EINVAL (Invalid argument)
brk(NULL)                               = 0xe0ee000
brk(0xe0eee00)                          = 0xe0eee00
arch_prctl(ARCH_SET_FS, 0xe0ee400)      = 0
uname({sysname="Linux", nodename="FlynnsOldSurface", ...}) = 0
set_tid_address(0xe0ee6d0)              = 3657
set_robust_list(0xe0ee6e0, 24)          = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x40b1d0, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x40b8c0}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x40b270, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x40b8c0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
readlink("/proc/self/exe", "/usr/bin/ydotoold", 4096) = 17
brk(0xe10fe00)                          = 0xe10fe00
brk(0xe110000)                          = 0xe110000
mprotect(0x5d8000, 40960, PROT_READ)    = 0
futex(0x5e989c, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x5e98a8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
unlink("/tmp/.ydotool_socket")          = 0
socket(AF_UNIX, SOCK_STREAM, 0)         = 3
bind(3, {sa_family=AF_UNIX, sun_path="/tmp/.ydotool_socket"}, 110) = 0
listen(3, 16)                           = 0
chmod("/tmp/.ydotool_socket", 0600)     = 0
write(2, "ydotoold: ", 10ydotoold: )              = 10
write(2, "listening on socket ", 20listening on socket )    = 20
write(2, "/tmp/.ydotool_socket", 20/tmp/.ydotool_socket)    = 20
write(2, "\n", 1
)                       = 1
openat(AT_FDCWD, "/dev/uinput", O_WRONLY|O_NONBLOCK) = 4
ioctl(4, UI_SET_EVBIT, 0x1)             = 0
ioctl(4, UI_SET_EVBIT, 0x2)             = 0
.......
ioctl(4, UI_DEV_CREATE or USB_RAW_IOCTL_RUN, 0x7ffde10c3ed0) = 0
accept(3, NULL, NULL)                   = 5
write(2, "ydotoold: accepted client\n", 26ydotoold: accepted client
) = 26
mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x722539400000
mprotect(0x722539401000, 8388608, PROT_READ|PROT_WRITE) = 0
rt_sigprocmask(SIG_BLOCK, ~[], [], 8)   = 0
clone(child_stack=0x722539c00230, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[3663], tls=0x722539c00640, child_tidptr=0x722539c00910) = 3663
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=NULL} ---
+++ killed by SIGSEGV +++
Segmentation fault
rexendevar commented 1 week ago

ydotool works just fine WITHOUT ydotoold running. WITH ydotoold all it does is segfault. I need to be able to simulate the print screen key and I don't know that it's going to happen.

fuzzy7k commented 6 days ago

I was having the same problem with my distro packaged version. It is old enough that it does not have a -V flag to show what version it is. But, apt info showed version 0.1.8-3.

After downloading and building the source, it works from master. $ydotoold -V v1.0.4-33-gb0c5da3

rexendevar commented 6 days ago

yeah building it from source fixed it. my bad