brndnmtthws / conky

Light-weight system monitor for X, Wayland (sort of), and other things, too
https://conky.cc
GNU General Public License v3.0
7.27k stars 620 forks source link

[Bug]: Coredump with Wayland #1497

Closed muellerjoel closed 1 year ago

muellerjoel commented 1 year ago

What happened?

  1. BUILD WITH WAYLAND SUPPORT

Maintainer: mrdotx klassiker@gmx.de

Contributor: Hendrik Schick hendrik@hndrkk.sh

Contributor: Mark Wagie

Contributor: Amanoel Dawod

Contributor: Beini bane@iki.fi

Contributor: Levente Polyak <anthraxx[at]archlinux[dot]org>

Contributor: Gaetan Bisson bisson@archlinux.org

Contributor: Giovanni Scafora giovanni@archlinux.org

Contributor: James Rayner james@archlinux.org

Contributor: Partha Chowdhury kira.laucas@gmail.com

_pkgname=conky pkgname=conky-git pkgver=1.19.0.r3.gdf16eeab pkgrel=1 pkgdesc='Lightweight system monitor for X' url='https://github.com/brndnmtthws/conky' license=('BSD' 'GPL') arch=('x86_64') makedepends=( 'cmake' 'docbook2x' 'docbook-xsl' 'man-db' 'git' 'catch2' 'pandoc' 'python-yaml' 'python-jinja' )env -u DISPLAY conky -c /home/morta/.conkyrc --display=:0 & [1] 84842 [morta@lapt0p conky-git]$ conky: desktop window (49f) is root window conky: window type - desktop conky: drawing to created window (0xa00002) conky: drawing to double buffer conky: unknown variable '$' sh: line 1: checkupdates: command not found sh: line 1: auracle: command not found % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 36 100 36 0 0 730 0 --:--:-- --:--:-- --:--:-- 734 ** Pango:ERROR:../pango/pango/pangofc-fontmap.c:2801:font_description_from_pattern: assertion failed: (res == FcResultMatch) Bail out! Pango:ERROR:../pango/pango/pangofc-fontmap.c:2801:font_description_from_pattern: assertion failed: (res == FcResultMatch) depends=( 'glibc' 'glib2' 'lua' 'wireless_tools' 'libxdamage' 'libxinerama' 'libxft' 'imlib2' 'libxml2' 'libpulse' 'libxnvctrl' 'systemd-libs' 'ncurses' 'curl' 'libncursesw.so' 'libXNVCtrl.so' 'libsystemd.so' 'libpulse.so' 'libcurl.so' ) provides=('conky') conflicts=('conky') source=('git+https://github.com/brndnmtthws/conky.git') sha256sums=('SKIP')

pkgver() { cd "$_pkgname" git describe --long --tags | sed 's/^v//;s/([^-]*-g)/r\1/;s/-/./g' }

prepare() { cd "$_pkgname"

# Unbundle catch2 to fix build with glibc 2.35
rm -r tests/catch2
ln -s /usr/include/catch2 tests

}

build() { cd "$_pkgname"

cmake \
    -B build \
    -D CMAKE_BUILD_TYPE=Release \
    -D CMAKE_CXX_FLAGS="$CXXFLAGS -ffat-lto-objects" \
    -D MAINTAINER_MODE=ON \
    -D BUILD_DOCS=ON \
    -D BUILD_WLAN=ON \
    -D BUILD_XDBE=ON \
    -D BUILD_XSHAPE=ON \
    -D BUILD_IMLIB2=ON \
    -D BUILD_CURL=ON \
    -D BUILD_RSS=ON \
    -D BUILD_NVIDIA=ON \
    -D BUILD_WEATHER_METAR=ON \
    -D BUILD_PULSEAUDIO=ON \
    -D BUILD_JOURNAL=ON \
-D BUILD_WAYLAND=ON \
    -D CMAKE_INSTALL_PREFIX=/usr \
    -Wno-dev \
    -S.

make -C build

package() { cd "$_pkgname" make -C build DESTDIR="$pkgdir" install install -Dm644 COPYING -t "$pkgdir/usr/share/licenses/$_pkgname" install -Dm644 extras/vim/syntax/conkyrc.vim.j2 -t \ "$pkgdir"/usr/share/vim/vimfiles/syntax/ install -Dm644 extras/vim/ftdetect/conkyrc.vim -t \ "$pkgdir"/usr/share/vim/vimfiles/ftdetect/ }

  1. env -u DISPLAY conky -c /home/morta/.conkyrc --display=:0

3.[morta@lapt0p conky-git]$ env -u DISPLAY conky -c /home/morta/.conkyrc --display=:0 & [1] 85189 [morta@lapt0p conky-git]$ conky: desktop window (49f) is root window conky: window type - desktop conky: drawing to created window (0xa00002) conky: drawing to double buffer conky: unknown variable '$' sh: line 1: checkupdates: command not found sh: line 1: auracle: command not found % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 36 100 36 0 0 629 0 --:--:-- --:--:-- --:--:-- 642 ** Pango:ERROR:../pango/pango/pangofc-fontmap.c:2801:font_description_from_pattern: assertion failed: (res == FcResultMatch) Bail out! Pango:ERROR:../pango/pango/pangofc-fontmap.c:2801:font_description_from_pattern: assertion failed: (res == FcResultMatch)

  1. Ctr + C
  2. [1]+ Aborted (core dumped) env -u DISPLAY conky -c /home/morta/.conkyrc --display=:0

Version

conky 1.19.1_pre compiled 2023-04-10 for Linux x86_64

Which OS/distro are you seeing the problem on?

Arch Linux

Conky config

conky.config = {
    alignment = 'top_right',
    background = false,
    border_width = 1,
    cpu_avg_samples = 2,
    default_color = 'white',
    default_outline_color = 'white',
    default_shade_color = 'white',
    double_buffer = true,
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
    extra_newline = false,
    font = 'Noto Sans Mono:size=12',
    gap_x = 20,
    gap_y = 20,
    minimum_height = 5,
    minimum_width = 5,
    net_avg_samples = 2,
    no_buffers = true,
    out_to_console = false,
    out_to_ncurses = false,
    out_to_stderr = false,
    out_to_wayland = true,
    own_window = true,
    own_window_argb_value = 0,
    own_window_argb_visual = true,
    own_window_class = 'Conky',
    own_window_hints = 'undecorated,sticky,below,skip_taskbar,skip_pager',
    own_window_transparent = true,
    own_window_type = 'desktop',
    show_graph_range = false,
    show_graph_scale = false,
    stippled_borders = 0,
    update_interval = 2.0,
    uppercase = false,
    use_spacer = 'none',
    use_xft = true,
}

conky.text = [[${voffset 4}${color}${font :bold}Lenovo Thinkpad X1 Extreme${font}
$hr
${color grey}Hostname: ${color}$nodename
${color grey}OS      : ${color}$sysname $kernel $machine
${color grey}Uptime  : ${color}$uptime
${color grey}Battery : ${color}$battery ${voffset 3}${battery_bar}${voffset -3}
${voffset 8}${color}${font :size=14}CPU ${font} (Intel Core i5-8400H @2.5GHz)$hr
${voffset 4}${color grey}Core 0: ${color}${alignr}${freq_g 1} GHz  ${color grey}Temperature: ${color}${execi 30 sensors | grep "Core 0" | awk '{print $3}'}
${color grey}Core 1: ${color}${alignr}${freq_g 2} GHz  ${color grey}Temperature: ${color}${execi 30 sensors | grep "Core 1" | awk '{print $3}'}
${color grey}Core 2: ${color}${alignr}${freq_g 3} GHz  ${color grey}Temperature: ${color}${execi 30 sensors | grep "Core 0" | awk '{print $3}'}
${color grey}Core 4: ${color}${alignr}${freq_g 4} GHz  ${color grey}Temperature: ${color}${execi 30 sensors | grep "Core 1" | awk '{print $3}'}
${voffset 8}${color grey}Thread 1: ${color}${voffset 3}${cpubar cpu1}${voffset -3}
${color grey}Thread 2: ${color}${voffset 3}${cpubar cpu2}${voffset -3}
${color grey}Thread 3: ${color}${voffset 3}${cpubar cpu3}${voffset -3}
${color grey}Thread 4: ${color}${voffset 3}${cpubar cpu4}${voffset -3}
${color grey}Thread 5: ${color}${voffset 3}${cpubar cpu5}${voffset -3}
${color grey}Thread 6: ${color}${voffset 3}${cpubar cpu6}${voffset -3}
${color grey}Thread 7: ${color}${voffset 3}${cpubar cpu7}${voffset -3}
${color grey}Thread 8: ${color}${voffset 3}${cpubar cpu8}${voffset -3}
$
${voffset 4}${color grey}Process              CPU%   MEM%
${color}  ${top name 1} ${top cpu 1} ${top mem 1}
${color}  ${top name 2} ${top cpu 2} ${top mem 2}
${color}  ${top name 3} ${top cpu 3} ${top mem 3}
${voffset 6}${color}${font :size=14}RAM ${font}$hr
${voffset 4}${color grey}Memory usage: ${color}${memperc}% of ${memmax} ${voffset 3}${membar}${voffset -3}
${voffset 4}${color grey}Process              MEM%   CPU%
${color}  ${top_mem name 1} ${top_mem mem 1} ${top_mem cpu 1}
${color}  ${top_mem name 2} ${top_mem mem 2} ${top_mem cpu 2}
${color}  ${top_mem name 3} ${top_mem mem 3} ${top_mem cpu 3}
${voffset 6}${color}${font :size=14}DISK ${font}$hr
${voffset 4}${color grey}Local root: $color${fs_free /} ${goto 215}${color grey}/ ${color} ${fs_size /}${goto 335}${voffset 3}${fs_bar /}${voffset -3}
${color grey}Home    : ${color}${fs_free /home} ${goto 215}${color grey}/ ${color}${fs_size /home}${goto 335}${voffset 3}${fs_bar /home}${voffset -3}
#${color grey}Google    : ${color}${fs_free /home/username/Cloud/GoogleDrive} ${goto 215}${color grey}/ ${color}${fs_size /home/username/Cloud/GoogleDrive}${goto 335}${voffset 3}${fs_bar /home/username/Cloud/GoogleDrive}${voffset -3}
#${color grey}OneDrive  : $color${fs_free /home/username/Cloud/OneDrive-Private} ${goto 215}${color grey}/ ${color}${fs_size /home/username/Cloud/OneDrive-Private}${goto 335}${voffset 3}${fs_bar /home/username/Cloud/OneDrive-Private}${voffset -3}
#${color grey}Dropbox   : $color${fs_free /home/username/Cloud/Dropbox} ${goto 215}${color grey}/ ${color}${fs_size /home/username/Cloud/Dropbox}${goto 335}${voffset 3}${fs_bar /home/username/Cloud/Dropbox}${voffset -3}
#${color grey}Mega      : $color${fs_free /home/username/Cloud/Mega} ${goto 215}${color grey}/ ${color}${fs_size /home/username/Cloud/Mega}${goto 335}${voffset 3}${fs_bar /home/username/Cloud/Mega}${voffset -3}
${color grey}NAS     : $color${fs_free /home/backup} ${goto 215}${color grey}/ ${color}${fs_size /home/backup}${goto 335}${voffset 3}${fs_bar /home/backup}${voffset -3}
${voffset 4}${color grey}      Read: ${color}${diskio_read /dev/md0} ${goto 230}${color grey}Write: ${color}${diskio_read /dev/md0}
${voffset 6}${color}${font :size=14}NETWORK ${font}$hr
${if_existing /proc/net/route wlp0s20f3}\
${if_existing /proc/net/route enp0s31f6}\
${voffset 4}${color grey}Warning: ${color}Both Wi-Fi and wired network active!
${else}\
${voffset 4}${color grey}ESSID: ${color}${wireless_essid wlp0s20f3}${goto 240}${color grey}Quality: ${color}${wireless_link_qual_perc wlp0s20f3}%
${voffset 4}${color grey}  IP : ${color}${addr wlp0s20f3}${goto 240}${voffset 8}${color grey}Down:${goto 300}${color}${downspeed wlp0s20f3}
${voffset -8}${color grey}  Zt : ${color}${addr zerotierdevice}${goto 240}${voffset 8}${color grey}Up  :${goto 300}${color}${upspeed wlp0s20f3}
${voffset -8}${color grey}  GW : ${color}${gw_ip}
${color grey}  Pub: ${color}${texeci 30 ~/.config/conky/pubIP.sh}
${endif}\
${else}\
${if_existing /proc/net/route enp0s31f6}\
${voffset 4}${color grey}Wired network: ${color}Active
${voffset 4}${color grey}  IP : ${color}${addr enp0s31f6}${goto 240}${voffset 8}${color grey}Down:${goto 300}${color}${downspeed enp0s31f6}
${voffset -8}${color grey}  Zt : ${color}${addr zerotierdevice}${goto 240}${voffset 8}${color grey}Up  :${goto 300}${color}${upspeed enp0s31f6}
${voffset -8}${color grey}  GW : ${color}${gw_ip}
${color grey}  Pub: ${color}${texeci 30 ~/.config/conky/pubIP.sh}
${endif}\
${endif}\
${voffset 6}${color}${font :size=14}UPDATES ${font}$hr
${voffset 4}${color grey}      Arch: ${color}${execi 600 checkupdates | wc -l}${goto 230}${color grey}AUR: ${color}${execi 600 auracle outdated | wc -l}
]]

Stack trace

[morta@lapt0p conky-git]$ gdb conky
GNU gdb (GDB) 13.1
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 conky...
(No debugging symbols found in conky)
(gdb) run -c ~/.conkyrc
Starting program: /usr/bin/conky -c ~/.conkyrc
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
conky: desktop window (49f) is root window
conky: window type - desktop
conky: drawing to created window (0xa00002)
conky: drawing to double buffer
conky: unknown variable '$'
[New Thread 0x7ffff35ff6c0 (LWP 85407)]
[Thread 0x7ffff35ff6c0 (LWP 85407) exited]
[New Thread 0x7ffff35ff6c0 (LWP 85408)]
[New Thread 0x7ffff2dfe6c0 (LWP 85409)]
[Thread 0x7ffff35ff6c0 (LWP 85408) exited]
[New Thread 0x7ffff35ff6c0 (LWP 85410)]
[New Thread 0x7ffff24b26c0 (LWP 85411)]
[Thread 0x7ffff2dfe6c0 (LWP 85409) exited]
[Thread 0x7ffff35ff6c0 (LWP 85410) exited]
[Thread 0x7ffff24b26c0 (LWP 85411) exited]
[New Thread 0x7ffff24b26c0 (LWP 85412)]
[New Thread 0x7ffff35ff6c0 (LWP 85413)]
[Detaching after fork from child process 85414]
[New Thread 0x7ffff2dfe6c0 (LWP 85415)]
[Detaching after fork from child process 85416]
[New Thread 0x7ffff1cb16c0 (LWP 85417)]
[New Thread 0x7ffff14b06c0 (LWP 85418)]
[Detaching after fork from child process 85419]
[New Thread 0x7ffff0caf6c0 (LWP 85420)]
[New Thread 0x7fffe3fff6c0 (LWP 85421)]
[Detaching after fork from child process 85422]
[New Thread 0x7fffe37fe6c0 (LWP 85423)]
[New Thread 0x7fffe2ffd6c0 (LWP 85424)]
sh: line 1: auracle: command not found
[Detaching after fork from child process 85427]
sh: line 1: checkupdates: command not found
[New Thread 0x7fffe27fc6c0 (LWP 85429)]
[New Thread 0x7fffe1ffb6c0 (LWP 85434)]
[New Thread 0x7fffe17fa6c0 (LWP 85435)]
[New Thread 0x7fffe0ff96c0 (LWP 85436)]
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    36  100    36    0     0    390      0 --:--:-- --:--:-- --:--:--   395
**
Pango:ERROR:../pango/pango/pangofc-fontmap.c:2801:font_description_from_pattern: assertion failed: (res == FcResultMatch)
Bail out! Pango:ERROR:../pango/pango/pangofc-fontmap.c:2801:font_description_from_pattern: assertion failed: (res == FcResultMatch)

Thread 1 "conky" received signal SIGABRT, Aborted.
0x00007ffff70a08ec in ?? () from /usr/lib/libc.so.6
(gdb)

Relevant log output

No response

bi4k8 commented 1 year ago

It appears that this issue is caused by ${font :size=12}. We call pango_fc_font_description_from_pattern, which expects there to be a font family specified in the FcPattern it gets passed, which is parsed from the string in ${font}.

The crash itself can be avoided if we add an empty FAMILY object to the FcPattern; PR incoming.

muellerjoel commented 1 year ago

Thanks for your work!

muellerjoel commented 1 year ago

The Conky works now with latest git. The Processor-bars are shown but not how much percentage are used. Why?

razerraz commented 1 year ago

Got a

Thread 1 "conky" received signal SIGSEGV, Segmentation fault.
0x00007ffff7d2b9d4 in wl_proxy_get_version () from /usr/lib/libwayland-client.so.0

with almost the same environment

conky 1.19.3_pre compiled 2023-06-21 for Linux x86_64

Compiled in features:

System config file: /etc/conky/conky.conf
Package library path: /usr/lib/conky

 General:
  * math
  * hddtemp
  * portmon
  * IPv6
  * Curl
  * RSS
  * wireless
  * support for IBM/Lenovo notebooks
  * nvidia
  * builtin default configuration
  * old configuration syntax
  * Imlib2
  * OSS mixer support
  * apcupsd
  * iostats
  * ncurses
  * Internationalization support
  * PulseAudio

 Lua bindings:
  * Cairo
  * RSVG
 X11:
  * Xdamage extension
  * Xinerama extension (virtual display)
  * Xshape extension (click through)
  * XDBE (double buffer extension)
  * Xft
  * ARGB visual
  * Own window
  * Mouse evenets

 Music detection:
  * CMUS
  * MPD
  * MOC

 Default values:
  * Netdevice: eno1
  * Local configfile: $HOME/.conkyrc
  * Localedir: /usr/share/locale
  * Maximum netdevices: 256
  * Maximum text size: 16384
  * Size text buffer: 256