Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set display to null for race condition #2032

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

zlice
Copy link
Contributor

@zlice zlice commented Sep 11, 2024

Checklist

  • I have described the changes
  • I have linked to any relevant GitHub issues, if applicable
  • Documentation in doc/ has been updated
  • All new code is licensed under GPLv3

Description

Per #1939 there is some kind of race condition when starting X11 after conky 1.21 where it will not show up on desktop or in ps aux.

https://github.com/dunst-project/dunst/blob/master/src/x11/x.c#L499 looks to be the source of some code which now sets display to NULL for some type of race condition in X11. Xlibint.h allows for building on Void Linux but needs min/max undefined. closes #1939

Without Xlibint.h it errors out, though Caellian didn't need it to build I think.

/usr/bin/g++ -D_LARGEFILE64_SOURCE -D_POSIX_C_SOURCE=200809L -I/builddir/conky-1.21.4/3rdparty/toluapp/include -I/builddir/conky-1.21.4/build -I/usr/include/freetype2 -I/usr/include/lua5.3 -I/usr/include/libxml2 -I/builddir/conky-1.21.4/3rdparty/Vc -I/builddir/conky-1.21.4/build/src -I/builddir/conky-1.21.4/build/data -DNDEBUG -fstack-clash-protection -D_FORTIFY_SOURCE=2 -mtune=generic -O2    -ffile-prefix-map=/builddir/conky-1.21.4/build=. -std=c++17 -Werror -MD -MT src/CMakeFiles/conky_core.dir/x11.cc.o -MF src/CMakeFiles/conky_core.dir/x11.cc.o.d -o src/CMakeFiles/conky_core.dir/x11.cc.o -c /builddir/conky-1.21.4/src/x11.cc
/builddir/conky-1.21.4/src/x11.cc: In function 'void update_x11_resource_db(bool)':
/builddir/conky-1.21.4/src/x11.cc:317:12: error: invalid use of incomplete type 'Display'
  317 |     display->db = NULL; // should be new or deleted
      |            ^~
In file included from /builddir/conky-1.21.4/src/x11.h:37,
                 from /builddir/conky-1.21.4/src/x11.cc:33:
/usr/include/X11/Xlib.h:251:8: note: forward declaration of 'Display'
  251 | struct _XDisplay;               /* Forward declare before use for C++ */
      |        ^~~~~~~~~

https://github.com/dunst-project/dunst/blob/master/src/x11/x.c#L499
looks to be the source of some code which now sets display to NULL
for some type of race condition in X11. Xlibint.h allows for building
on Void Linux but needs min/max undefined. closes brndnmtthws#1939
Copy link

netlify bot commented Sep 11, 2024

Deploy Preview for conkyweb canceled.

Name Link
🔨 Latest commit c6b1400
🔍 Latest deploy log https://app.netlify.com/sites/conkyweb/deploys/66e2020f7372b8000803aabd

@github-actions github-actions bot added sources PR modifies project sources display: x11 Issue related to X11 backend labels Sep 11, 2024
@Caellian Caellian self-requested a review September 13, 2024 09:16
Comment on lines +36 to +38
#include <X11/Xlibint.h>
#undef min
#undef max
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required on Void Linux - Author stated in related issue (#1939) the code doesn't compile without this include.

Comment on lines +320 to +321
// https://github.com/dunst-project/dunst/blob/master/src/x11/x.c#L499
display->db = NULL; // should be new or deleted
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dunst does this so it looks ok to me.

@brndnmtthws brndnmtthws added the bug Bug report or bug fix PR label Sep 13, 2024
@brndnmtthws brndnmtthws merged commit 875c1af into brndnmtthws:main Sep 13, 2024
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report or bug fix PR display: x11 Issue related to X11 backend sources PR modifies project sources
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: conky 1.21. does not start consistently
3 participants