Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 810061 - media-gfx/kuickshow-0.10.2 on wayland segfaults at kuickshow.cpp:1253 (getX11Display/getX11Screen calls)
Summary: media-gfx/kuickshow-0.10.2 on wayland segfaults at kuickshow.cpp:1253 (getX11...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Christian Gerloff
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-24 17:44 UTC by Duncan
Modified: 2022-04-02 12:53 UTC (History)
1 user (show)

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


Attachments
debug code to narrow down the cause of the bug (file_810061.txt,735 bytes, patch)
2021-08-25 10:03 UTC, Christian Gerloff
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Duncan 2021-08-24 17:44:38 UTC
So I've been running on plasma-wayland by default for many months (>1 year?) now, but kuickshow hasn't been merged until now.  FWIW gwenview's my primary image viewer but I usually keep a second one around, which was the gtk2-based gimv until it was recently tree-cleaned due to dead upstream and no gtk3 port.  So I was looking for a replacement and since I run plasma anyway, I was happy to see kuickview (which I fuzzily remember from the kde3/4 era) still around.

Kuickview merged fine but it wouldn't run, segfaulting before ever opening a window, and gdb wasn't particularly helpful initially due to stripped debug info.  Fortunately it's a trivial build and a bit of debug-rebuilding later I had this:

Thread 1 "kuickshow" received signal SIGSEGV, Segmentation fault.
0x00007ffff7f649dd in KuickShow::initImlibParams (this=0x5555555a4e30, idata=0x555555618070, par=0x7fffffffd860) at ../kuickshow-0.10.2/src/kuickshow.cpp:1253

In the source that's...

1247 void KuickShow::initImlibParams( ImData *idata, ImlibInitParams *par )
1248 {
...
1253     Visual* defaultvis = DefaultVisual(getX11Display(), getX11Screen());


Again, I'm on (plasma/kwin-)wayland, but of course xwayland is running to provide legacy X compatibility (and yes the DISPLAY var is set appropriately, double-checked in the gdb-suspended kuickshow env and it's there).  Unfortunately that doesn't appear to be enough in this case.


Double-unfortunately, checking gentoo's kuickshow bug history I saw the old (IIRC) 2017 bug where it was temporarily treecleaned due to dead upstream, and a current equery meta suggests upstream's still dead, so with qt6/kde-frameworks6 around the corner, while the package probably still works on xorg[1] for the moment I'm guessing it's pretty much a dead-package-running...

Fortunately for me kuickshow being a newly merged package I was trying to run, it's not like I've a workflow embedding it or something.  So if you just want to WONTFIX the bug I'm fine with it.  But as I had the investigative work already done and didn't see anything like this bug filed yet, I thought I'd file it to give you (and other users on or switching to wayland) a heads-up in any case, and since it's a really small build, with the also small imlib being the only dep I didn't already have merged, if you want to try fixing it I'm up for testing patches. =:^)

(I guess I'll try a gtk option now.  There seem to be several available to try.  Hopefully I'll find something gtk3 and wayland-native...)

---
[1] I so seldom start plasma on X that it tends to be bit-rotted when I do.  Plasma on xorg has been black-screening on me (but the purple gentoo-theme cursor loads so I can see xorg is running, and apparently at least some of the autostart apps run too as when I quit and restart in wayland it's obvious they ran in xorg, I just can't /see/ anything in xorg but that colorful pointer on an otherwise black screen) for I guess a couple months now, but it hasn't been a priority "because wayland".  Of course part of the problem there could be that I'm running the live-git-9999 frameworks and plasma from the gentoo/kde project overlay, tho I'd have expected it to be fixed by now if that was the entire story, but I've not bothered investigating further.  Anyway, xorg is broken ATM and I don't know when/if it'll work again, so I can't test kuickshow there.
Comment 1 Christian Gerloff 2021-08-25 10:03:19 UTC
Created attachment 735935 [details, diff]
debug code to narrow down the cause of the bug
Comment 2 Christian Gerloff 2021-08-25 10:04:53 UTC
Thank you for the bug report and the initial analysis!

I'm going to set up a Wayland environment to try and replicate this error. Wayland has never worked for me in the past (in a similar way to what you experience when trying to start xorg/plasma), so I couldn't test KuickShow with it.
It does work fine in xorg/plasma. It is my primary image viewer and I'm using it quite often.

The error looks like either something is returning a null pointer or an unexpected value caused an invalid memory access (getX11Screen() / QDesktopWidget->screenNumber(...) could return -1, but the code doesn't test for it...)

If you have the time could you please add the following code in front of the line you identified and post its output? (I've attached a Gentoo user patch.)
+    printf("getX11Display() = %p\n", (void*) getX11Display());
+    printf("getX11Screen() = %d\n", getX11Screen());
+    printf("ScreenOfDisplay(...) = %p\n", (void*) ScreenOfDisplay(getX11Display(), getX11Screen()));
     Visual* defaultvis = DefaultVisual(getX11Display(), getX11Screen());

It should print something like this on startup:
getX11Display() = 0x55c465a6a300
getX11Screen() = 0
ScreenOfDisplay(...) = 0x55c465a6b890

Thank you!
Comment 3 Andreas Sturmlechner gentoo-dev 2022-04-02 12:53:47 UTC
ping, any progress here? Duncan, can you test the patch?