Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
New version Conky segfault at boot using Gnome
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Tout
n00b
n00b


Joined: 18 Jul 2020
Posts: 48

PostPosted: Fri Oct 11, 2024 11:34 am    Post subject: New version Conky segfault at boot using Gnome Reply with quote

Hi!

After updating conky, I noticed that conky is not starting at boot anymore. When looking at syslog, I see a segfault is occuring.

I have two instances of conky starting at boot. So for 3 boots I got this:

Code:
Oct 11 10:23:50 main kernel: conky[3708]: segfault at 10 ip 00007f389c981424 sp 00007ffd490c8cd8 error 4 in libc.so.6[7f389c916000+148000] likely on CPU 5 (core 5, socket 0)
Oct 11 10:23:50 main kernel: conky[3698]: segfault at 10 ip 00007f980905f424 sp 00007ffe62afc248 error 4 in libc.so.6[7f9808ff4000+148000] likely on CPU 10 (core 2, socket 0)
Oct 11 10:57:03 main kernel: conky[3679]: segfault at 10 ip 00007fd5c871b424 sp 00007fff3cfd83d8 error 4 in libc.so.6[7fd5c86b0000+148000] likely on CPU 6 (core 6, socket 0)
Oct 11 10:57:04 main kernel: conky[3669]: segfault at 10 ip 00007f8d89f05424 sp 00007ffd23630158 error 4 in libc.so.6[7f8d89e9a000+148000] likely on CPU 10 (core 2, socket 0)
Oct 11 11:16:44 main kernel: conky[4769]: segfault at 10 ip 00007f0f3a23e424 sp 00007ffd65640ed8 error 4 in libc.so.6[7f0f3a1d3000+148000] likely on CPU 4 (core 4, socket 0)
Oct 11 11:16:44 main kernel: conky[4762]: segfault at 10 ip 00007f1715727424 sp 00007ffe6fb446f8 error 4 in libc.so.6[7f17156bc000+148000] likely on CPU 0 (core 0, socket 0)


Reverting to the old version of conky, it does not occur.

New version being: 1.21.7
Old version is: 1.19.8

When using the new version, I do not get any error when starting it AFTER boot. No segfaults occurring.

I use gnome and autostart conky with an autostart config. Trying to add a delay did not work, cause I don't know how to configure that correctly. The internet is giving me spread info on if that is still working in gnome autostart.
Code:
~/.config/autostart $ cat conky.desktop
[Desktop Entry]
Type=Application
Name=Conky
Exec=conky
X-GNOME-Autostart-Delay=120


Two questions:

1) Can I further investigate what is going wrong besides the syslog entry?

2) Is there a correct way of delaying in autostart? My current workaround is masking the new version. There could be an alternative workaround to delay start, but not sure if it will help. It might, because starting conky from prompt works once system is running.

Any help appreciated.
Back to top
View user's profile Send private message
Weezer
n00b
n00b


Joined: 19 Apr 2024
Posts: 22

PostPosted: Sun Oct 13, 2024 9:25 am    Post subject: Re: New version Conky segfault at boot using Gnome Reply with quote

Tout wrote:

2) Is there a correct way of delaying in autostart? My current workaround is masking the new version. There could be an alternative workaround to delay start, but not sure if it will help. It might, because starting conky from prompt works once system is running.



I don't use Gnome, but I would try nuking the XDG-GNOME-Autostart-Delay line in the .desktop file and doiing something like:

Exec=sleep 120 && conky

or if that is the wrong context try;

Exec=bash -c "sleep 120 && conky"

I doubt you need a two minute delay but you can whittle that down after you get it working.

I autostart my conky and do it a bit different but this should work (untested as I use window managers), or get you going in the right direction.

:)
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22512

PostPosted: Sun Oct 13, 2024 2:50 pm    Post subject: Reply with quote

Can you obtain a core file for the faulting conky? Can you find a way to reproduce it that does not require a reboot for every attempt?
Back to top
View user's profile Send private message
Tout
n00b
n00b


Joined: 18 Jul 2020
Posts: 48

PostPosted: Sun Oct 13, 2024 7:06 pm    Post subject: Re: New version Conky segfault at boot using Gnome Reply with quote

Quote:
I don't use Gnome, but I would try nuking the XDG-GNOME-Autostart-Delay line in the .desktop file and doiing something like:

Exec=sleep 120 && conky

or if that is the wrong context try;

Exec=bash -c "sleep 120 && conky"

I doubt you need a two minute delay but you can whittle that down after you get it working.

I autostart my conky and do it a bit different but this should work (untested as I use window managers), or get you going in the right direction.

:)


Yes!! The Exec=bash -c "sleep 60 && conky" worked. Not the first one. I guess it needs to be ran in the same bash command.

So very nice, I have a work around running the latest version. Now I can research further for the root cause. Thanks!!
Back to top
View user's profile Send private message
Tout
n00b
n00b


Joined: 18 Jul 2020
Posts: 48

PostPosted: Sun Oct 13, 2024 7:31 pm    Post subject: Reply with quote

Hu wrote:
Can you obtain a core file for the faulting conky? Can you find a way to reproduce it that does not require a reboot for every attempt?


I can't get conky to segfault after gnome is up and running. For example the work around with the delay makes conky run correctly without segfault.

Is there a way to debug more? The only thing where I look now is syslog. There I can find a few surrounding lines:

Code:
Oct 13 21:19:34 main dbus-daemon[1323]: [system] Successfully activated service 'org.freedesktop.UDisks2'
Oct 13 19:19:34 main rtkit-daemon[2407]: Successfully made thread 3012 of process 3012 owned by '1000' high priority at nice level -11.
Oct 13 19:19:34 main rtkit-daemon[2407]: Successfully made thread 3017 of process 3012 owned by '1000' RT at priority 20.
Oct 13 19:19:35 main rtkit-daemon[2407]: Successfully made thread 2955 of process 2955 owned by '1000' high priority at nice level -11.
Oct 13 19:19:35 main rtkit-daemon[2407]: Successfully made thread 3041 of process 2955 owned by '1000' RT at priority 20.
Oct 13 21:19:35 main kernel: [drm:drm_new_set_master] *ERROR* [nvidia-drm] [GPU ID 0x00000800] Failed to grab modeset ownership <not related>
Oct 13 21:19:37 main kernel: conky[2974]: segfault at 10 ip 00007f8c5403f424 sp 00007ffcaa096028 error 4 in libc.so.6[7f8c53fd4000+148000] likely on CPU 4 (core 4, socket 0)
Oct 13 21:19:37 main kernel: Code: <a lot of hex numbers here, which I stripped, cause I do not know if they identify anything>
Oct 13 21:19:37 main NetworkManager[1635]: <info>  [<I deleted info here>] agent-manager: agent[<I deleted info here>/org.gnome.Shell.NetworkAgent/1000]: agent registered


Where I can see my rtkit-daemon likes to travel back in time. But I think that should be ok, cause it seems to use UTC, and if I was a rtkit-daemon I would do the same.

Then I also see this nvidia-drm error, which seems to can occur. But does not seem related, cause the old version of conky works?

edit: I got rid of this by adding (so it is definitely not related)
Code:
nvidia-drm.modeset=1 nvidia-drm.fbdev=1
to the GRUB_CMDLINE_LINUX_DEFAULT= to my grub config


And finally after the segfault a related line I guess with some code of the kernel. Where I removed the hex numbers because I am too paranoid to put them here without knowing what it translates into.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22512

PostPosted: Sun Oct 13, 2024 7:46 pm    Post subject: Reply with quote

If it only crashes at startup, then obtaining a core file from a crash at startup, and diagnosing it later, would be the most expedient path.
Back to top
View user's profile Send private message
Tout
n00b
n00b


Joined: 18 Jul 2020
Posts: 48

PostPosted: Sun Oct 13, 2024 8:00 pm    Post subject: Reply with quote

Hu wrote:
If it only crashes at startup, then obtaining a core file from a crash at startup, and diagnosing it later, would be the most expedient path.

Thanks!! I managed a core dump by adding:
Code:
Exec=bash -c "ulimit -c unlimited && conky"

I will now investigate how to read the core dump.
Back to top
View user's profile Send private message
Tout
n00b
n00b


Joined: 18 Jul 2020
Posts: 48

PostPosted: Sun Oct 13, 2024 8:13 pm    Post subject: Reply with quote

Debugging the core dump by:

Code:
gdb /usr/bin/conky core


And printing the backtrace gives:

Code:
(gdb) bt
#0  0x00007f57caab0424 in pthread_mutex_lock () at /lib64/libc.so.6
#1  0x00007f57cb2f589f in XrmQGetResource () at /usr/lib64/libX11.so.6
#2  0x00007f57cb2f5a0d in XrmGetResource () at /usr/lib64/libX11.so.6
#3  0x0000563533c822ed in ??? ()
#4  0x0000563533c85a1b in ??? ()
#5  0x0000563533c85b67 in ??? ()
#6  0x0000563533c35a1b in ??? ()
#7  0x0000563533c1e8c1 in main ()


At least I am learning things again :)

So I guess the function XrmGetResource calls XrmQGetResource which calls pthread_mutex_lock. And that last one gives the segfault?

Edit: yes, the first lines when starting gdb say so:

Code:
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f57caab0424 in pthread_mutex_lock () from /lib64/libc.so.6
[Current thread is 1 (Thread 0x7f57ca01e940 (LWP 2950))]


So question is, what is my next step?

edit: I tried using vgdb which seems to be very nice, but since it occurs only during boot, not an option I guess
Back to top
View user's profile Send private message
netfab
Veteran
Veteran


Joined: 03 Mar 2005
Posts: 1954
Location: 127.0.0.1

PostPosted: Mon Oct 14, 2024 6:21 pm    Post subject: Reply with quote

Hi,

Please post your emerge --info.

Maybe a shot in the dark, but your problem sounds like this bug :
https://github.com/brndnmtthws/conky/issues/1939
This bug was closed but it seems that the patch was not yet released on the 1.21.x branch.

You should try to build and run the conky live version to see if it fix your issue.
Or, if you cannot build the live version, you may try to use the /etc/portage/patches mechanism to apply this patch to conky-1.21.7.

After trying the live version, if the issue is still not fixed, then you should open an upstream bug.
Back to top
View user's profile Send private message
Tout
n00b
n00b


Joined: 18 Jul 2020
Posts: 48

PostPosted: Wed Oct 16, 2024 10:35 am    Post subject: Reply with quote

emerge --info:

Code:
Portage 3.0.65 (python 3.12.6-final-0, default/linux/amd64/23.0/split-usr/desktop/gnome, gcc-13, glibc-2.39-r6, 6.6.52-gentoo x86_64)
=================================================================
System uname: Linux-6.6.52-gentoo-x86_64-AMD_Ryzen_7_1700_Eight-Core_Processor-with-glibc2.39
KiB Mem:    32784980 total,  26344004 free
KiB Swap:   67108860 total,  67108860 free
Timestamp of repository gentoo: Wed, 16 Oct 2024 10:15:00 +0000
Head commit of repository gentoo: f7b547859f9279cffe166ae708a32054a53aa602
Timestamp of repository steam-overlay: Tue, 08 Oct 2024 15:50:59 +0000
Head commit of repository steam-overlay: 1dc5a0d57c688eacd472d714a0621b6c277a9385

sh bash 5.2_p37
ld GNU ld (Gentoo 2.42 p6) 2.42.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p37::gentoo
dev-build/autoconf:        2.13-r8::gentoo, 2.71-r7::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/cmake:           3.30.2::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.5.1::gentoo
dev-lang/perl:             5.40.0::gentoo
dev-lang/python:           3.11.10_p1::gentoo, 3.12.6_p4::gentoo
dev-lang/rust-bin:         1.80.1::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/openrc:           0.54.2::gentoo
sys-apps/sandbox:          2.39::gentoo
sys-devel/binutils:        2.42-r2::gentoo
sys-devel/binutils-config: 5.5.2::gentoo
sys-devel/gcc:             13.3.1_p20240614::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/llvm:            18.1.8-r1::gentoo
sys-kernel/linux-headers:  6.6-r1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.39-r6::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync1.de.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-extra-opts:
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24

steam-overlay
    location: /var/db/repos/steam-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/steam-overlay.git
    masters: gentoo
    volatile: False

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe"
GENTOO_MIRRORS="https://ftp.fau.de/gentoo"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="X a52 aac acl acpi alsa amd64 branding bzip2 cairo cdda cdr cet colord crypt dbus dri dts dvd dvdr eds elogind encode evo exif flac gdbm gif gnome gnome-keyring gnome-online-accounts gnome-shell gphoto2 gpm gstreamer gtk gui iconv icu introspection jpeg keyring kf6compat lcms libnotify libtirpc lm-sensors mad mng mp3 mp4 mpeg multilib nautilus ncurses networkmanager nls nvidia ogg opengl openmp pam pango pcre pdf png policykit ppds pulseaudio qml qt5 qt6 readline sdl seccomp sound spell split-usr ssl startup-notification svg sysprof test-rust tiff tracker truetype udev udisks unicode upower usb vaapi vdpau vorbis vulkan wayland wxwidgets x264 xattr xcb xft xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gcc_12" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres16" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" RUBY_TARGETS="ruby32" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, MAKEOPTS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Back to top
View user's profile Send private message
Tout
n00b
n00b


Joined: 18 Jul 2020
Posts: 48

PostPosted: Wed Oct 16, 2024 10:40 am    Post subject: Reply with quote

netfab wrote:
Hi,

Please post your emerge --info.

Maybe a shot in the dark, but your problem sounds like this bug :
https://github.com/brndnmtthws/conky/issues/1939
This bug was closed but it seems that the patch was not yet released on the 1.21.x branch.

You should try to build and run the conky live version to see if it fix your issue.
Or, if you cannot build the live version, you may try to use the /etc/portage/patches mechanism to apply this patch to conky-1.21.7.

After trying the live version, if the issue is still not fixed, then you should open an upstream bug.


Thanks for your input! Was not aware about live build for trying out things, nice info.

I've been looking at the bug, and it seems different. That occurs inconsistently, and mine is very consistent. Also it appears to occur elsewhere in the code I guess. Were mine is coming from the part where it is doing something with a thread if I look at the method name in gdb, pthread_mutex_lock

I couldn't get the live ebuild thing working. I got package.accept_keywords/conky with
Code:
app-admin/conky **
in it. But emerge --ask @live-rebuild does not trigger a rebuild of conky...
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22512

PostPosted: Wed Oct 16, 2024 1:03 pm    Post subject: Reply with quote

As I interpret the comment in /usr/share/portage/config/sets/portage.conf, that set applies to installed ebuilds with the live property set:
Code:
# Installed ebuilds with "live" property.
[live-rebuild]
Do you presently have installed a version of conky with that property? If not, then it will not be included in that set.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum