Bug 1057971

Summary: Bug: XLIB_SKIP_ARGB_VISUALS crashes KDE applications
Product: [openSUSE] openSUSE Tumbleweed Reporter: Tristan Miller <psychonaut>
Component: KDE Workspace (Plasma)Assignee: Fabian Vogt <fabian>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: alarrosa, fvogt, mlin, psychonaut, werner
Version: Current   
Target Milestone: Current   
Hardware: x86-64   
OS: openSUSE Factory   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Tristan Miller 2017-09-10 09:46:31 UTC
The openSUSE package of Emacs installs a custom wrapper script, named emacs.sh before installation. This wrapper script sets the environment variable XLIB_SKIP_ARGB_VISUALS.  When Emacs is invoked through this wrapper in Plasma 5, and then used to launch KDE applications such as Okular or KWrite, then those applications segfault as soon as a pull-down menu is invoked.

This is probably a bug in KDE and/or Qt.  See the upstream KDE report: <https://bugs.kde.org/show_bug.cgi?id=384540>

Until that bug is fixed, a workaround might be for openSUSE's distribution of Emacs to stop setting this environment variable.  Is there an important reason why it is being set?  That is, is it supposed to be working around some other critical bug?
Comment 1 Dr. Werner Fink 2017-09-13 07:31:31 UTC
(In reply to Tristan Miller from comment #0)

> 
> Until that bug is fixed, a workaround might be for openSUSE's distribution
> of Emacs to stop setting this environment variable.  Is there an important
> reason why it is being set?  That is, is it supposed to be working around
> some other critical bug?

You are aware that there is a reason *why* XLIB_SKIP_ARGB_VISUALS is set here?
Otherewise the gtk based GNU Emacs might crash randomly

You might use

  export EMACS_TOOLKIT=x11

as this avoids gtk based GNU Emacs and hence also XLIB_SKIP_ARGB_VISUALS
Comment 2 Tristan Miller 2017-09-13 08:32:57 UTC
(In reply to Dr. Werner Fink from comment #1)
> You are aware that there is a reason *why* XLIB_SKIP_ARGB_VISUALS is set
> here?

No, that's why I asked why it is set.

> Otherewise the gtk based GNU Emacs might crash randomly

That seems like a good reason.

> You might use
> 
>   export EMACS_TOOLKIT=x11
> 
> as this avoids gtk based GNU Emacs and hence also XLIB_SKIP_ARGB_VISUALS

I am using what is (for me) a better workaround, which is to have AUCTeX invoke KDE applications with "env -u XLIB_SKIP_ARGB_VISUALS".

Incidentally, the KDE folks have now determined that this is a bug in Qt where a null pointer gets dereferenced.  They have already submitted a patch to Qt: https://codereview.qt-project.org/#/c/205268/
Comment 3 Dr. Werner Fink 2017-09-13 08:39:30 UTC
Is there a bug against Qt on openSUSE and if so for which version ... Leap 42.2/42.3, Tumbleweed
Comment 4 Tristan Miller 2017-09-13 09:42:27 UTC
Not that I am aware of, though I could create one if you'd like.
Comment 5 Dr. Werner Fink 2017-09-13 09:49:12 UTC
(In reply to Tristan Miller from comment #4)
> Not that I am aware of, though I could create one if you'd like.

It is enough to remove "editors/emacs: " from subject and reasign this to the Qt maintainers as well as to set the correct hardware and distribution
Comment 6 Tristan Miller 2017-09-13 10:01:50 UTC
(In reply to Dr. Werner Fink from comment #5)
> It is enough to remove "editors/emacs: " from subject and reasign this to
> the Qt maintainers as well as to set the correct hardware and distribution

Reproducible for me with both Leap 42.3 and Tumbleweed on x86_64.  I've changed the assignee to the address OBS gives for bugs reported against libqt5-qtbase package.
Comment 7 Fabian Vogt 2017-09-13 12:44:09 UTC
(In reply to Tristan Miller from comment #6)
> (In reply to Dr. Werner Fink from comment #5)
> > It is enough to remove "editors/emacs: " from subject and reasign this to
> > the Qt maintainers as well as to set the correct hardware and distribution
> 
> Reproducible for me with both Leap 42.3 and Tumbleweed on x86_64.  I've
> changed the assignee to the address OBS gives for bugs reported against
> libqt5-qtbase package.

Fix prepared for TW (sr#525847), do you need it for Leap 42.3 as well?
That would need to go through SLE as Qt 5.6 is a SLE package.
Comment 8 Tristan Miller 2017-09-13 12:52:46 UTC
(In reply to Fabian Vogt from comment #7)
> Fix prepared for TW (sr#525847)

Thank you!

> do you need it for Leap 42.3 as well?
> That would need to go through SLE as Qt 5.6 is a SLE package.

I can reproduce the problem on Leap 42.3, so a fix there would be appreciated.
Comment 9 Fabian Vogt 2017-09-13 12:56:42 UTC
(In reply to Tristan Miller from comment #8)
> (In reply to Fabian Vogt from comment #7)
> > Fix prepared for TW (sr#525847)
> 
> Thank you!

The sr is accepted, if possible could you confirm that the fix works
on TW? Adding KDE:Qt5 (and dup'ing to it) should be enough.

> > do you need it for Leap 42.3 as well?
> > That would need to go through SLE as Qt 5.6 is a SLE package.
> 
> I can reproduce the problem on Leap 42.3, so a fix there would be
> appreciated.

Ok, CCing the SLE Qt maintainers.
Comment 10 Tristan Miller 2017-09-13 19:02:52 UTC
(In reply to Fabian Vogt from comment #9)
> The sr is accepted, if possible could you confirm that the fix works
> on TW? Adding KDE:Qt5 (and dup'ing to it) should be enough.

Doesn't seem to have made its way into the packages in <http://download.opensuse.org/repositories/KDE:/Qt5/openSUSE_Factory/x86_64/> yet -- the most recent timestamps there are from 19 hours ago.  I'll keep checking back.
Comment 11 Tristan Miller 2017-09-14 20:27:11 UTC
I installed today's Tumbleweed packages from KDE:/Qt5 and can no longer reproduce the issue.
Comment 12 Bernhard Wiedemann 2017-10-28 16:04:10 UTC
This is an autogenerated message for OBS integration:
This bug (1057971) was mentioned in
https://build.opensuse.org/request/show/537327 Factory / libqt5-qtbase
Comment 13 Fabian Vogt 2017-12-24 14:59:42 UTC
Patch landed a while ago.
Comment 19 Swamp Workflow Management 2018-10-05 16:16:18 UTC
SUSE-RU-2018:3030-1: An update that has two recommended fixes can now be installed.

Category: recommended (low)
Bug References: 1057971,1108889
CVE References: 
Sources used:
SUSE Linux Enterprise Software Development Kit 12-SP3 (src):    libqt5-qtbase-5.6.2-6.12.1
SUSE Linux Enterprise Server 12-SP3 (src):    libqt5-qtbase-5.6.2-6.12.1
SUSE Linux Enterprise Desktop 12-SP3 (src):    libqt5-qtbase-5.6.2-6.12.1
Comment 20 Swamp Workflow Management 2018-10-06 16:13:08 UTC
openSUSE-RU-2018:3058-1: An update that has two recommended fixes can now be installed.

Category: recommended (low)
Bug References: 1057971,1108889
CVE References: 
Sources used:
openSUSE Leap 42.3 (src):    libqt5-qtbase-5.6.2-7.3.1