Dear Maintainer,
I tried to track down the segfault and I guess it is related to
the usage of "-shared" when linking wminput [1].
Therefore, I guess, the resulting wminput binary is build like
a shared object instead of an executable.

A binary built without "-shared" shows a version info with "--version".

Kind regards,
Bernhard


[1] 
https://salsa.debian.org/georgesk/cwiid/-/commit/bd0f4c89556dbaed72e3082c5273b986cd47c35a#748fb62c420a28ecccff1a9a6c92a29a7dc3f4eb_19_18

# Bullseye/testing amd64 qemu VM 2020-10-10


apt update
apt dist-upgrade


apt install systemd-coredump mc htop quilt fakeroot gdb rr wminput 
wminput-dbgsym
apt build-dep wminput




mkdir /home/benutzer/source/wminput/orig -p
cd    /home/benutzer/source/wminput/orig
apt source wminput
cd








benutzer@debian:~$ wminput --version
Speicherzugriffsfehler (Speicherabzug geschrieben)


root@debian:~# journalctl -e
...
Okt 10 13:43:51 debian kernel: wminput[2343]: segfault at 2 ip 0000000000000002 
sp 00007fff69ea69c8 error 14 in wminput[7f3fa2bff000+7000]
Okt 10 13:43:51 debian kernel: Code: Bad RIP value.
Okt 10 13:43:51 debian systemd[1]: Created slice 
system-systemd\x2dcoredump.slice.
Okt 10 13:43:51 debian systemd[1]: Started Process Core Dump (PID 2344/UID 0).
Okt 10 13:43:52 debian systemd-coredump[2345]: Process 2343 (wminput) of user 
1000 dumped core.
                                               
                                               Stack trace of thread 2343:
                                               #0  0x0000000000000002 n/a (n/a 
+ 0x0)
Okt 10 13:43:52 debian systemd[1]: systemd-coredump@0-2344-0.service: Succeeded.


root@debian:~# coredumpctl list
TIME                            PID   UID   GID SIG COREFILE  EXE
Sat 2020-10-10 13:43:52 CEST   2343  1000  1000  11 present   /usr/bin/wminput


root@debian:~# coredumpctl gdb 2343
           PID: 2343 (wminput)
           UID: 1000 (benutzer)
           GID: 1000 (benutzer)
        Signal: 11 (SEGV)
     Timestamp: Sat 2020-10-10 13:43:51 CEST (1min 18s ago)
  Command Line: wminput --version
    Executable: /usr/bin/wminput
 Control Group: /user.slice/user-1000.slice/session-3.scope
          Unit: session-3.scope
         Slice: user-1000.slice
       Session: 3
     Owner UID: 1000 (benutzer)
       Boot ID: 14e01e6856a647e78081573d2c4ee54d
    Machine ID: 33f18f39d2a9438eb75b0ed52848afcd
      Hostname: debian
       Storage: 
/var/lib/systemd/coredump/core.wminput.1000.14e01e6856a647e78081573d2c4ee54d.2343.1602330231000000.zst
       Message: Process 2343 (wminput) of user 1000 dumped core.
                
                Stack trace of thread 2343:
                #0  0x0000000000000002 n/a (n/a + 0x0)

GNU gdb (Debian 9.2-1) 9.2
Copyright (C) 2020 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 /usr/bin/wminput...
(No debugging symbols found in /usr/bin/wminput)
[New LWP 2343]
Core was generated by `wminput --version'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000000002 in ?? ()
(gdb) bt
#0  0x0000000000000002 in ?? ()
#1  0x00007fff69ea8868 in ?? ()
#2  0x00007fff69ea8870 in ?? ()
#3  0x0000000000000000 in ?? ()







benutzer@debian:~$ rr wminput --version
rr: Saving execution to trace directory 
`/home/benutzer/.local/share/rr/wminput-0'.
Speicherzugriffsfehler



benutzer@debian:~$ rr replay /home/benutzer/.local/share/rr/wminput-0
GNU gdb (Debian 9.2-1) 9.2
Copyright (C) 2020 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 /usr/bin/wminput...
Reading symbols from 
/usr/lib/debug/.build-id/83/0f5a5b55af2a7278f125c2ffcb446e9a7f16a3.debug...
Really redefine built-in command "restart"? (y or n) [answered Y; input not 
from terminal]
Remote debugging using 127.0.0.1:2876
0x00007f1d9495d9a0 in deregister_tm_clones ()
(rr) display/i $pc
1: x/i $pc
=> 0x7f1d9495d9a0 <deregister_tm_clones>:       lea    0x148a1(%rip),%rdi       
 # 0x7f1d94972248
(rr) stepi
0x00007f1d9495d9a7 in deregister_tm_clones ()
1: x/i $pc
=> 0x7f1d9495d9a7 <deregister_tm_clones+7>:     lea    0x1489a(%rip),%rax       
 # 0x7f1d94972248
(rr) 
0x00007f1d9495d9ae in deregister_tm_clones ()
1: x/i $pc
=> 0x7f1d9495d9ae <deregister_tm_clones+14>:    cmp    %rdi,%rax
(rr) 
0x00007f1d9495d9b1 in deregister_tm_clones ()
1: x/i $pc
=> 0x7f1d9495d9b1 <deregister_tm_clones+17>:    je     0x7f1d9495d9c8 
<deregister_tm_clones+40>
(rr) 
0x00007f1d9495d9c8 in deregister_tm_clones ()
1: x/i $pc
=> 0x7f1d9495d9c8 <deregister_tm_clones+40>:    retq   
(rr) 
0x0000000000000002 in ?? ()
1: x/i $pc
=> 0x2: <error: Cannot access memory at address 0x2>












cd wminput
gcc -g -Wall -W -DHAVE_CONFIG_H 
-I/home/benutzer/source/wminput/try1/cwiid-0.6.91/common/include -fPIC 
-I../libcwiid -DWMINPUT_CONFIG_DIR=\"/etc/cwiid/wminput\" 
-DCWIID_PLUGINS_DIR=\"/usr/lib/cwiid/plugins\" -I/usr/include/python3.8   -c -o 
main.o main.c
gcc -o wminput main.o conf.o c_plugin.o uinput.o action_enum.o util.o 
py_plugin.o parser.o lexer.o -L../libcwiid -rdynamic -shared -lcwiid -ldl 
-lbluetooth -lpython3.8 -lpthread

Why "-shared" ?









https://salsa.debian.org/georgesk/cwiid/-/commit/bd0f4c89556dbaed72e3082c5273b986cd47c35a#748fb62c420a28ecccff1a9a6c92a29a7dc3f4eb_19_18



With "-shared":
    $ file wminput/wminput 
    wminput/wminput: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), 
dynamically linked, BuildID[sha1]=82241b257dbbcb3d2a05cb2afacc6bc84af0ef75, 
with debug_info, not stripped


Without "-shared":
    $ file wminput/wminput 
    wminput/wminput: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), 
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, 
BuildID[sha1]=8f201f9fcd7d39885021b0cef0c56ac70b3fa78a, for GNU/Linux 3.2.0, 
with debug_info, not stripped

Reply via email to