Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 799797 - x11-base/xorg-server-1.20.11-r1 and -9999 trigger an app-admin/conky-1.12.2 lua-cairo bug
Summary: x11-base/xorg-server-1.20.11-r1 and -9999 trigger an app-admin/conky-1.12.2 l...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Daniel Pielmeier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-02 03:07 UTC by Duncan
Modified: 2021-11-03 05:10 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info.txt,6.82 KB, text/plain)
2021-07-02 03:07 UTC, Duncan
Details
conky cpu good (conky-good.png,27.51 KB, image/png)
2021-08-16 18:14 UTC, Duncan
Details
conky cpu bad (conky-bad.png,25.84 KB, image/png)
2021-08-16 18:23 UTC, Duncan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Duncan 2021-07-02 03:07:07 UTC
Created attachment 720855 [details]
emerge --info

Short form: conky's lua-cairo drawn displays bug out with the new xwayland.  Lua-cairo scripted line-drawn graphs are area-filling instead of line.

This bug has several package dependencies.  Let's see if I can properly describe them.

1) app-admin/conky-1.12.2 is (and has been for some time) installed with the following USE flags:

[ebuild   R    ] app-admin/conky-1.12.2::gentoo  USE="X bundled-toluapp curl doc iconv lua-cairo math ncurses rss systemd truetype xinerama -apcupsd -cmus -hddtemp -ical -imlib -intel-backlight -iostats -ipv6 -irc -lua-imlib -lua-rsvg -moc -mpd -mysql -nano-syntax -nvidia -portmon -pulseaudio -thinkpad -vim-syntax -weather-metar -webserver -wifi -xmms2" LUA_SINGLE_TARGET="lua5-3" 0 KiB

1a) My conky config is *heavily* lua-scripted in ordered to be able to graph multiple components on a single graph (example user/nice/system/iowait y-axis cumulative-stacked with an independent core-frequency line-graph z-axis stacked on top, or multiple temp/fan/power line-graph components on a single graph).

The problem with the new xwayland is that all the line-graphs are area-filling instead of line, so the later drawn-ones obliterate the earlier-drawn ones!

2) x11-base/xwayland, either 21.1.1-r1 or 21.1.1.901 (which I unmasked to test once I found the problem with 21.1.1-r1), trigger the bug, while the bundled xwayland in xorg-server-1.20.11 (and previous versions) is fine.

[ebuild  N    *] x11-base/xwayland-21.1.1.901::gentoo  USE="-ipv6 -rpc (-selinux) -unwind -xcsecurity" VIDEO_CARDS="-nvidia" 0 KiB

3) While reverting to older unsplit x11-base/xorg-server-1.20.11 with bundled xwayland eliminated the problem, that left me wondering if it was the split itself that triggered the issue, or updates in the newly split xwayland since the unsplit xorg-server-1.20.11.

I even unmasked x11-base/xorg-server-9999 and dependencies (xorg-proto-9999, drivers) and tried it.  To my surprise, xorg-server-9999 isn't yet split -- most packages with a live-9999 version have their experiments done there first and I expected xorg-server-9999 to have been split first, but the xorg-server-9999 qmerge aborted with xwayland collisions.  So I diffed the ebuilds and sure enough, 9999 isn't split yet.  So I unmerged the split xwayland, and /then/ xorg-server-9999 would merge.

[ebuild   R   *] x11-base/xorg-server-9999:0/9999::gentoo  USE="systemd udev wayland xorg -debug -dmx -doc -elogind -ipv6 -kdrive -minimal (-selinux) -suid -test -unwind -xcsecurity -xephyr -xnest -xvfb" 0 KiB

The xorg-server-9999 bundled xwayland triggers the same bug, so the problem must be in code that's new to the split xwayland *and* the bundled xwayland in xorg-server-9999, but wasn't yet in the bundled xwayland in xorg-server-1.20.11.

4) In case it's xwayland plus some other components, tho they work fine with xwayland bundled in xorg-server-1.20.11, here's my mesa, graphics-hardware, etc, details:

[ebuild   R    ] media-libs/mesa-21.1.3::gentoo  USE="X dri3 egl gallium gbm gles2 llvm lm-sensors vaapi vulkan wayland zstd -classic -d3d9 -debug -gles1 -opencl -osmesa (-selinux) -test -unwind -valgrind -vdpau -vulkan-overlay -xa -xvmc -zink" VIDEO_CARDS="radeonsi (-freedreno) -i915 -i965 -intel -iris (-lima) -nouveau (-panfrost) -r100 -r200 -r300 -r600 -radeon (-v3d) (-vc4) -virgl (-vivante) -vmware" 0 KiB

[ebuild   R    ] x11-libs/libdrm-2.4.106::gentoo  USE="libkms -valgrind" VIDEO_CARDS="amdgpu radeon (-exynos) (-freedreno) -intel -nouveau (-omap) (-tegra) (-vc4) (-vivante) -vmware" 0 KiB

[ebuild   R   *] x11-drivers/xf86-video-amdgpu-9999::gentoo  USE="udev" 0 KiB
(was 19.1.0 before I tried xorg-server-9999)

[ebuild   R    ] dev-libs/wayland-1.19.0::gentoo  USE="-doc" 0 KiB

[ebuild   R    ] sys-devel/llvm-12.0.0:12::gentoo  USE="gold ncurses xml -debug -doc -exegesis -libedit -libffi -test -xar -z3" LLVM_TARGETS="AMDGPU (X86) -AArch64 -ARC -ARM -AVR -BPF (-CSKY) -Hexagon -Lanai -MSP430 -Mips -NVPTX -PowerPC -RISCV -Sparc -SystemZ -VE -WebAssembly -XCore" 7 KiB

Kernel 5.13.0 (built from mainline git)

dmesg says:
[drm] initializing kernel modesetting (POLARIS11 0x1002:0x67EF 0x1458:0x22DD 0xCF).

... which the X log (when I run X instead of wayland, which is seldom these days) says is: AMDGPU(0): Chipset: "AMD Radeon (TM) RX 460 Graphics" (ChipID = 0x67ef)

The wayland compositor is kwin, in a kde-plasma session.  It's live-9999 frameworks/plasma from the gentoo/kde overlay.
Comment 1 Duncan 2021-07-02 03:29:23 UTC
Forgot to mention.  plasma/kwin/X seems to be broken ATM (not /too/ unexpected as I'm running -9999 kde and I'm usually in plasma/wayland so X could be broken for weeks and I'd likely not know it) and I see the splash and the cursor, but black-screen otherwise (tho starting plasma/wayland again restores some apps I tried to start in X with hotkeys and couldn't see, so it's running, just not displaying properly), so I can't see whether the live-9999 xorg-server session has the same bug or not, but I suspect it's in the xwayland code anyway and thus wouldn't show up in normal X, because it's in the split xwayland with xorg-server-1.20.11-r1, but not in the bundled xwayland in 1.20.11(-r0).
Comment 2 Duncan 2021-07-03 21:14:59 UTC
With xorg-server-9999 installed I tried to figure out what commits corresponded to xorg-server-1.20.11 and xwayland-21.1.1, in ordered to try to bisect, but the local xorg-server-9999 git wasn't seeing the xwayland tag IDs as displayed on upstream's gitlab, so I'm going to need some help with that, I think.

I've also thought about just doing a straight bisect on xorg-server from 1.20.11 (assuming I can find /its/ git IDs locally!), but of course that'd be a far longer bisect as it'd include a lot of unrelated stuff.

For now I'm reverted to xorg-server-1.20.11 with the bundled xwayland...
Comment 3 Duncan 2021-07-10 11:40:28 UTC
Today I upgraded to xorg-server-1.20.12 (and with it of course back to split xwayland), llvm-12.0.1 and mesa-21.1.4.  No fix. =:^(

After those upgrades I even tried rebuilding cairo(-1.16.0-r4), lua(-5.3.6-r2) and conky(-1.12.2), in that order, and rebooted to clear out potentially running old libs.  Still no fix. =:^(

The gentoo git log suggests xorg-server-9999 is now split xwayland, so I think I'll try that with a bisect.
Comment 4 Duncan 2021-07-10 13:02:17 UTC
@x11:  Seems upstream xorg does branches but not (consistent) release tagging.  Thus, I have the xorg-server-1.20.0 branch, but no tags for 1.20.10, 1.20.11, 1.20.12, etc.

Any reasonable way to get commits corresponding to xorg-server releases?

Also, any guidelines for git xorg-server in terms of when I need to rebuild the drivers (xf86-input-libinput and xf86-video-amdgpu) and xorg-proto?
Comment 5 Duncan 2021-07-10 13:48:44 UTC
In hindsight now that xorg-server-9999 has xwayland split, attempting to bisect xorg-server back to EGIT_OVERRIDE_COMMIT_DATE_XORG_SERVER=2020-01-01 was bad logic and bound to fail.

What I need is an x11-base/xwayland-9999 to bisect, bug #801478.
Comment 6 Duncan 2021-07-11 13:29:38 UTC
Looking at the xwayland ebuilds, before trying to create a -9999, the low-hanging-fruit was simply changing the ebuild name to match any of the available upstream release tarballs.

I tried them all, 21.0.99.901 pre-release and 21.1.0 release, both older than in-tree, and the newer 21.1.2, not yet in-tree (when I tried) altho a pre-release was.

All demonstrated the same problem.

Still don't know where the xorg-server-1.20.11 bundled xwayland falls in comparison, but it worked, while the not-yet-unbundled-when-tested xorg-server-9999 exhibited the bug, so I figured it had to be in something added since xorg-server-1.20.11.  However, with all the split xwaylands back to the first upstream-separate-release 21.0.99.901 failing, I'm now wondering if it's something different in the build system, maybe meson (used for split-xwayland) vs. whatever-before?  Did (then-still-xwayland-bundled) xorg-server-9999 switch to meson since 1.20.11?  That could explain why it failed with the same bug as the split versions did.
Comment 7 Duncan 2021-08-16 18:14:55 UTC
Created attachment 733318 [details]
conky cpu good

Conky on kwin-wayland with xorg-server-1.20.13-r1 (with xwayland-21.1.2-r2) still exhibits the problem.  

I'm attaching screenshots.  This one is my conky cpu instance with a normal display, with xorg-server-1.20.11 using bundled xwayland.

Six cores so six reports.  For the text, label left, usage right:

Top/white: core-number/overall percentage
Second/cyan: user
Middle/green: nice
Forth/yellow: system (includes iowait/irq/sirq)
Last/white: frequency in MHz

The graph is similarly color-coded.  Here there's no niced and little system usage so it's mostly cyan/user in the cumulative graph, with the white verticals drawn over-top the cumulative graph displaying the dynamic frequency spikes of the conservative governor.
Comment 8 Duncan 2021-08-16 18:23:58 UTC
Created attachment 733321 [details]
conky cpu bad

This is the bad snapshot.  The numbers are still displayed correctly but the graphs are not.  What should be the frequency line-graph drawn over the cumulative activity graph is just a big white rectangle apparently extending to the height of the maximum graphed value.  It's obliterating the cumulative cpu activity percentage graph it's drawn over.
Comment 9 Duncan 2021-08-16 19:04:22 UTC
The lua-cairo drawing code, based on the conky-wiki, lua and cairo documentation.  In particular the "cr" usage is from the conky-wiki. It's not explained but I've guessed it's "cairo resource". (The wiki and my code also use "cs", which in context is a bit more transparently "cairo surface".) jed is/are my initials, used here for namespacing.

-- setting up the line width, color and starting point
cairo_set_line_width(jed.conky.window.cairo.cr, width)
cairo_set_source_rgba(jed.conky.window.cairo.cr, jed.conky.window.color.convert(color))
cairo_move_to(jed.conky.window.cairo.cr, beginx, beginy)

-- this is called repeatedly to draw a segment
-- from the current point to the given point
cairo_line_to(jed.conky.window.cairo.cr, endx, endy)

-- this is called to finish/paint/stroke the drawn line
cairo_stroke(jed.conky.window.cairo.cr)


Somehow the unbundled xwayland isn't drawing that correctly and is drawing big rectangular blocks instead of line graphs.
Comment 10 Matt Turner gentoo-dev 2021-08-28 01:48:52 UTC
(In reply to Duncan from comment #4)
> @x11:  Seems upstream xorg does branches but not (consistent) release
> tagging.  Thus, I have the xorg-server-1.20.0 branch, but no tags for
> 1.20.10, 1.20.11, 1.20.12, etc.
> 
> Any reasonable way to get commits corresponding to xorg-server releases?

I don't know what you're talking about. There most certainly are tags for the releases, as I made them. E.g.:

https://cgit.freedesktop.org/xorg/xserver/tag/?h=xorg-server-1.20.10
https://cgit.freedesktop.org/xorg/xserver/tag/?h=xorg-server-1.20.11
https://cgit.freedesktop.org/xorg/xserver/tag/?h=xorg-server-1.20.12
https://cgit.freedesktop.org/xorg/xserver/tag/?h=xorg-server-1.20.13
Comment 11 Duncan 2021-10-06 08:50:36 UTC
Update:

xorg-server-1.20.13-r1 and xwayland-21.1.2-r2 (and conky-1.12.2 still) still exhibit the bug.

I may have to go back to xorg-server-1.20.11 with bundled xwayland again, but I intend to try Don O's xwayland patch from bug #801478 to create an xwayland-9999 and play around with EGIT_COMMIT a bit first, regressing it to see if I can get any split xwayland to work.
Comment 12 Duncan 2021-10-06 10:20:01 UTC
(In reply to Matt Turner from comment #10)
> (In reply to Duncan from comment #4)
> > 
> > @x11: Any reasonable way to get commits corresponding to xorg-server releases?

> There most certainly are tags for the releases, as I made them. E.g.:

> https://cgit.freedesktop.org/xorg/xserver/tag/?h=xorg-server-1.20.13

Thanks for confirming.

I couldn't see them originally, either at gitlab.freedesktop.org or locally.  I figured out I needed EGIT_CLONE_TYPE=mirror for local (I had it set single).  Not sure what happened for the web interface but I see them there too, now.  Probably bad git/website foo here for that as well as I'm used to dealing with kde and similar single-product-per-repo and find the xorg-upstream combined repo rather overwhelming.
Comment 13 Duncan 2021-10-06 14:00:52 UTC
Well, tried split-xwayland back to upstream commit 4709d24f8 from Feb 14, 2020, with the same broken-conky result.  Somewhere between there and Jan 6 (also 2020) won't build against current deps any longer, but if it wasn't working on Feb 14 of 2020, it wouldn't appear to be the xwayland code.

Meanwhile, the xwayland-bundled version of xorg-server-1.20.11 works.  That tag was in April of 2021, over a year beyond the above xwayland date.
Comment 14 Duncan 2021-10-08 02:42:24 UTC
Today I merged and configured weston as a backup wayland compositor, in ordered to see if the bug might be kwin-specific.

The bug remained running conky (on xwayland) on weston, so it's not kwin-compositor specific.

Everything's pointing to a difference in the way xwayland builds when it's bundled with xorg-server, in which case conky run on it works fine, and when xwayland is unbundled into its own ebuild, in which case conky exhibits the bug.
Comment 15 Duncan 2021-11-03 05:10:13 UTC
Setting RESOLVED, OBSOLETE since I don't really know what fixed it, but /something/ in the last set of updates (from Oct 26-28) seems to have done so. =:^)

FWIW, now running:
mesa-21.2.2 (built Oct 17 but I /think/ it was still occurring with it)
conky-1.12.2 (unchanged)
xwayland-21.1.2.901 (likely something in this)
wayland-1.19.0
(And from today, upstream linux kernel v5.15.0 from live-git, tho I first noticed that conky was graphing correctly a bit earlier with something just passed -rc7.)

Plus live-git for most kde packages I have merged. (Unlikely to be updates there as the problem occurred running conky on xwayland on weston, see the previous comment, as well.)

(With weston as a backup wayland compositor (I'm running kwin live-git after all), after sorting my USE=X packages, putting the ones that still needed it in package.use, and toggling to global USE=-X, I was able to unmerge xorg-server and a few xorg-specific deps entirely, as xorg hadn't been working for some time anyway and wayland has been reasonable for me for over a year now.  Weston may be a bit bare-bones but it works, and that makes it perfect as a low-deps backup compositor! =:^)