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.31k stars 620 forks source link

Conky segfaults with `out_to_x = false` after commit d97f4dfd8a4f395ef65abfd67d5a758aadb46042 #454

Closed vesath closed 6 years ago

vesath commented 6 years ago

Since commit d97f4dfd8a4f395ef65abfd67d5a758aadb46042 (Make mouse-through workable (#213)) conky segfaults when conkyrc contains out_to_x = false. Here's a minimal conkyrc to reproduce this issue:

conky.config = {
        out_to_console = true,
        out_to_x = false,
};

conky.text = [[ hi ]];

and here's the segfault backtrace:

#0  0x00007ffff6e2254d in XQueryExtension () from /usr/lib/libX11.so.6
#1  0x00007ffff6e160e2 in XInitExtension () from /usr/lib/libX11.so.6
#2  0x00007ffff6be538f in XextAddDisplay () from /usr/lib/libXext.so.6
#3  0x00007ffff6bdf878 in XShapeQueryVersion () from /usr/lib/libXext.so.6
#4  0x00005555555925ca in main_loop() ()
#5  0x00005555555823b4 in main ()

Prior to that commit there was no segfault and out_to_x = false worked as expected.

If this matters I'm running an up-to-date Arch Linux system.

dbriba commented 6 years ago

I test your conky and I have no segfault:

dominique@host-192-168-1-2 ~$ conky -c conky-test
 hi 
 hi 
 hi 
 hi 
^C hi 
conky: received SIGINT or SIGTERM to terminate. bye!
dominique@host-192-168-1-2 ~$
vesath commented 6 years ago

For the record my system has libxext 1.3.3 and libx11 1.6.5. Cheers.

jan0sch commented 6 years ago

I can confirm this crash using 1.10.7 on FreeBSD 11.1 with the same minimal config provided above.

% conky -c test-conky.cfg
zsh: segmentation fault  conky -c test-conky.cfg

Info from package:

conky-1.10.7
Name           : conky
Version        : 1.10.7
Installed on   : Tue Jan 23 07:19:25 2018 CET
Origin         : sysutils/conky
Architecture   : FreeBSD:11:amd64
Prefix         : /usr/local
Categories     : sysutils
Licenses       : 
Maintainer     : madpilot@FreeBSD.org
WWW            : https://github.com/brndnmtthws/conky
Comment        : Advanced, highly configurable system monitor for X11
Options        :
    APCUPSD        : off
    ARGB           : on
    CURL           : on
    DOCS           : on
    DOUBLE_BUFFER  : on
    EXAMPLES       : on
    IMLIB2         : on
    IPV6           : on
    LUA_CAIRO      : on
    LUA_IMLIB2     : on
    LUA_RSVG       : on
    METAR          : off
    MOC            : off
    MPD            : on
    NCURSES        : on
    RSS            : on
    X11            : on
    XFT            : on
    XINERAMA       : off
    XMMS2          : off
    XOAP           : off
Shared Libs required:
    libcurl.so.4
    libglib-2.0.so.0
    libgobject-2.0.so.0
    libXfixes.so.3
    libtolua++-5.1.so
    libncurses.so.6
    libX11.so.6
    libXext.so.6
    libcairo.so.2
    liblua-5.1.so
    libXft.so.2
    libxml2.so.2
    libICE.so.6
    libXdamage.so.1
    librsvg-2.so.2
    libintl.so.8
    libSM.so.6
    libtinfo.so.6
    libImlib2.so.1
    libgdk_pixbuf-2.0.so.0
    libgio-2.0.so.0
    libinotify.so.0
Shared Libs provided:
    libcairo_imlib2_helper.so
    librsvg.so
    libimlib2.so
    libcairo.so
Annotations    :
    FreeBSD_version: 1101001
    cpe            : cpe:2.3:a:conky:conky:1.10.7:::::freebsd11:x64
Flat size      : 730KiB
Description    :
Conky is an advanced, highly configurable system monitor for X

WWW: https://github.com/brndnmtthws/conky
brndnmtthws commented 6 years ago

Can someone try to grab the segfault in gdb?

brndnmtthws commented 6 years ago

If someone could test #455 that'd be 💯.

jan0sch commented 6 years ago

Still a segfault on my machine. :-(

Funny though if I change out_to_x = false to out_to_x = no it runs but also draws X output. Regarding the wiki I thought this would make no difference.

brndnmtthws commented 6 years ago

@jan0sch I messed up the patch. Can you fetch it and try again?

jan0sch commented 6 years ago

Still no luck. :-(

brndnmtthws commented 6 years ago

I'm not able to reproduce the segfault (on Linux at least). Can you provide a backtrace from GDB?

vesath commented 6 years ago

I posted a backtrace in the very first comment. If you would like one with debugging symbols enabled or something else, let me know.

brndnmtthws commented 6 years ago

I meant with all the debug info. I can't get that code to trigger at all with the sample config, so I don't really understand how it's segfaulting. But there could certainly be some peculiar platform difference.

jan0sch commented 6 years ago

Seems that I had the wrong binary flying around! I hereby confirm that the patch works and sorry for the inconvenience. 👍

vesath commented 6 years ago

That works for me too; thanks a lot!