hyprwm / hyprpicker

A wlroots-compatible Wayland color picker that does not suck.
BSD 3-Clause "New" or "Revised" License
670 stars 30 forks source link

hyprpicker command returns: segmentation fault (core dumped) #48

Closed RiQuY closed 9 months ago

RiQuY commented 9 months ago

Description

hyprpicker commands returns this message to the console when executing it:

segmentation fault (core dumped) 

System info

OS: openSUSE Tumbleweed x86_64 Kernel: 6.6.1-1-default Shell: bash 5.2.15 Resolution: 2560x1440 DE: Hyprland Terminal: kitty CPU: AMD Ryzen 7 1700X (16) @ 3.400GHz GPU: AMD ATI Radeon RX 5600 OEM/5600 XT / 5700/5700 XT Memory: 7453MiB / 32016MiB

hyprland version (from zypper): 0.32.3-1.1 hyprpicker version (from build.opensuse.org/home:smolsheep): 0.2.0-2.4

Log/core dump info

gdb /usr/bin/hyprpicker

GNU gdb (GDB; openSUSE Tumbleweed) 13.2
Copyright (C) 2023 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-suse-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://bugs.opensuse.org/>.
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/hyprpicker...

This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.opensuse.org/>
Enable debuginfod for this session? (y or [n]) n
Debuginfod has been disabled.
To make this setting permanent, add 'set debuginfod enabled off' to .gdbinit.
(No debugging symbols found in /usr/bin/hyprpicker)
(gdb) run
Starting program: /usr/bin/hyprpicker 
Missing separate debuginfos, use: zypper install hyprpicker-debuginfo-0.2.0-2.4.x86_64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x000055555555e693 in CHyprpicker::recheckACK() ()
corecoredumpctl info /usr/bin/hyprpickerdumpctl info /usr/bin/hyprpicker

           PID: 30777 (hyprpicker)
           UID: 1000 (ricardo)
           GID: 1000 (ricardo)
        Signal: 11 (SEGV)
     Timestamp: Fri 2023-11-17 23:46:37 CET (9min ago)
  Command Line: hyprpicker
    Executable: /usr/bin/hyprpicker
 Control Group: /user.slice/user-1000.slice/session-3.scope
          Unit: session-3.scope
         Slice: user-1000.slice
       Session: 3
     Owner UID: 1000 (ricardo)
       Boot ID: 1f3422e6568c4d98bace3b9927a621d7
    Machine ID: 7705050f974844688d71b678d48a076b
      Hostname: localhost.localdomain
       Storage: /var/lib/systemd/coredump/core.hyprpicker.1000.1f3422e6568c4d98bace3b9927a621d7.30777.1700261197000000.zst (present)
  Size on Disk: 139.6K
       Message: Process 30777 (hyprpicker) of user 1000 dumped core.

                Stack trace of thread 30777:
                #0  0x0000564d55e7f693 _ZN11CHyprpicker10recheckACKEv (hyprpicker + 0xa693)
                #1  0x00007f1fee0c6962 n/a (libffi.so.8 + 0x7962)
                #2  0x00007f1fee0c32df n/a (libffi.so.8 + 0x42df)
                #3  0x00007f1fee0c5f26 ffi_call (libffi.so.8 + 0x6f26)
                #4  0x00007f1fee278a23 n/a (libwayland-client.so.0 + 0x7a23)
                #5  0x00007f1fee279203 n/a (libwayland-client.so.0 + 0x8203)
                #6  0x00007f1fee279494 wl_display_dispatch_queue_pending (libwayland-client.so.0 + 0x8494)
                #7  0x00007f1fee27bf8f wl_display_roundtrip_queue (libwayland-client.so.0 + 0xaf8f)
                #8  0x0000564d55e7d8f9 _ZN11CHyprpicker4initEv (hyprpicker + 0x88f9)
                #9  0x0000564d55e7ab3d main (hyprpicker + 0x5b3d)
                #10 0x00007f1feda281b0 __libc_start_call_main (libc.so.6 + 0x281b0)
                #11 0x00007f1feda28279 __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x28279)
                #12 0x0000564d55e7ac25 _start (hyprpicker + 0x5c25)
                ELF object binary architecture: AMD x86-64
vaxerski commented 9 months ago

can you try from head? b6130e3901ed5c6d423f168705929e555608d870 fixed this IIRC.

RiQuY commented 9 months ago

Sorry if this sounds dumb but because I downloaded a pre-built package from the openSUSE build service I don't know how to build this properly or if I'm missing dependencies.

To build the package to be able to answer you question I did the following:

git clone https://github.com/hyprwm/hyprpicker.git
cd hyprpicker
make all

And I got this output:

make clear
make[1]: Entering directory '/media/Almacen/Programas/hyprpicker'
rm -rf build
rm -f *.o *-protocol.h *-protocol.c
make[1]: Leaving directory '/media/Almacen/Programas/hyprpicker'
make protocols
make[1]: Entering directory '/media/Almacen/Programas/hyprpicker'
/usr/bin/wayland-scanner private-code \
    protocols/wlr-layer-shell-unstable-v1.xml wlr-layer-shell-unstable-v1-protocol.c
/usr/bin/wayland-scanner client-header \
    protocols/wlr-layer-shell-unstable-v1.xml wlr-layer-shell-unstable-v1-protocol.h
Package wlroots was not found in the pkg-config search path.
Perhaps you should add the directory containing `wlroots.pc'
to the PKG_CONFIG_PATH environment variable
Package 'wlroots', required by 'virtual:world', not found
cc -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement -I. -DWLR_USE_UNSTABLE -std=c99  -I/usr/include/wayland    -c -o wlr-layer-shell-unstable-v1-protocol.o wlr-layer-shell-unstable-v1-protocol.c
/usr/bin/wayland-scanner private-code \
    protocols/wlr-screencopy-unstable-v1.xml wlr-screencopy-unstable-v1-protocol.c
/usr/bin/wayland-scanner client-header \
    protocols/wlr-screencopy-unstable-v1.xml wlr-screencopy-unstable-v1-protocol.h
Package wlroots was not found in the pkg-config search path.
Perhaps you should add the directory containing `wlroots.pc'
to the PKG_CONFIG_PATH environment variable
Package 'wlroots', required by 'virtual:world', not found
cc -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement -I. -DWLR_USE_UNSTABLE -std=c99  -I/usr/include/wayland    -c -o wlr-screencopy-unstable-v1-protocol.o wlr-screencopy-unstable-v1-protocol.c
/usr/bin/wayland-scanner private-code \
    /stable/xdg-shell/xdg-shell.xml xdg-shell-protocol.c
Could not open input file: No such file or directory
make[1]: *** [Makefile:40: xdg-shell-protocol.c] Error 1
make[1]: Leaving directory '/media/Almacen/Programas/hyprpicker'
make: *** [Makefile:61: all] Error 2
vaxerski commented 9 months ago

Package wlroots was not found in the pkg-config search path.

errors are quite clear, missing wlroots

RiQuY commented 9 months ago

It works, I had to install this deps wlroots-devel wayland-protocols-devel ninja cairo-devel pango-devel libjpeg8-devel Mesa-libGLESv3-devel but the program was able to build and open. It printed the HEX value of the pixel I selected on the console.

So the problem was that your last commit is still not saved in a new release?

vaxerski commented 9 months ago

it's after the latest release. Yes.

vaxerski commented 9 months ago

closing as already fixed

devansh08 commented 9 months ago

@vaxerski , I'm still getting a SIGSEGV error with the latest code. Cloned the repo and ran make all to build the binary. Getting this error:

./build/hyprpicker
fish: Job 1, './build/hyprpicker' terminated by signal SIGSEGV (Address boundary error)

Some debug logs (do let me know if anything else would help): GDB:

gdb ./build/hyprpicker
GNU gdb (GDB) 13.2
Copyright (C) 2023 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://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 ./build/hyprpicker...
(gdb) run
Starting program: /home/devansh/Temp/hyprpicker/build/hyprpicker

This GDB supports auto-downloading debuginfo from the following URLs:
<https://debuginfod.archlinux.org>
Enable debuginfod for this session? (y or [n]) n
Debuginfod has been disabled.
To make this setting permanent, add 'set debuginfod enabled off' to .gdbinit.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7f499d4 in wl_proxy_get_version () from /usr/lib/libwayland-client.so.0

Coredumpctl:

PID: 37147 (hyprpicker)
UID: 1000 (devansh)
GID: 1000 (devansh)
Signal: 11 (SEGV)
Timestamp: Thu 2023-11-23 18:54:16 IST (4min 10s ago)
Command Line: ./build/hyprpicker
Executable: /home/devansh/Temp/hyprpicker/build/hyprpicker
Control Group: /user.slice/user-1000.slice/user@1000.service/app.slice/app-konsole-7d7f6a4c402a480e84c39ac96f0e575a.scope
Unit: user@1000.service
User Unit: app-konsole-7d7f6a4c402a480e84c39ac96f0e575a.scope
Slice: user-1000.slice
Owner UID: 1000 (devansh)
Boot ID: 260197b5e909474bbc005fe694afec5f
Machine ID: d96bafd23c124394af4d86ced7c59e74
Hostname: arch
Storage: /var/lib/systemd/coredump/core.hyprpicker.1000.260197b5e909474bbc005fe694afec5f.37147.1700745856000000.zst (present)
Size on Disk: 227.1K
Message: Process 37147 (hyprpicker) of user 1000 dumped core.

Stack trace of thread 37147:
#0  0x00007fe54154f9d4 wl_proxy_get_version (libwayland-client.so.0 + 0x79d4)
#1  0x00005559efefe9be n/a (/home/devansh/Temp/hyprpicker/build/hyprpicker + 0x79be)
ELF object binary architecture: AMD x86-64

Running this on Arch Linux KDE Wayland.