Bug 1217076 - virt-viewer crashes when it's started through spice-xpi
Summary: virt-viewer crashes when it's started through spice-xpi
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: virt-viewer
Version: 22
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Daniel Berrangé
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:6adab58ced8cfb115fb0e7d5ce9...
: 1220899 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-29 13:54 UTC by Erik van Pienbroek
Modified: 2015-06-21 00:30 UTC (History)
12 users (show)

Fixed In Version: spice-xpi-2.8.90-7.fc22
Clone Of:
Environment:
Last Closed: 2015-06-21 00:30:59 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (27.50 KB, text/plain)
2015-04-29 13:54 UTC, Erik van Pienbroek
no flags Details
File: build_ids (5.73 KB, text/plain)
2015-04-29 13:54 UTC, Erik van Pienbroek
no flags Details
File: cgroup (190 bytes, text/plain)
2015-04-29 13:54 UTC, Erik van Pienbroek
no flags Details
File: core_backtrace (1.57 KB, text/plain)
2015-04-29 13:54 UTC, Erik van Pienbroek
no flags Details
File: dso_list (13.28 KB, text/plain)
2015-04-29 13:54 UTC, Erik van Pienbroek
no flags Details
File: environ (2.68 KB, text/plain)
2015-04-29 13:54 UTC, Erik van Pienbroek
no flags Details
File: limits (1.29 KB, text/plain)
2015-04-29 13:54 UTC, Erik van Pienbroek
no flags Details
File: maps (62.60 KB, text/plain)
2015-04-29 13:54 UTC, Erik van Pienbroek
no flags Details
File: mountinfo (3.97 KB, text/plain)
2015-04-29 13:54 UTC, Erik van Pienbroek
no flags Details
File: namespaces (85 bytes, text/plain)
2015-04-29 13:54 UTC, Erik van Pienbroek
no flags Details
File: open_fds (185 bytes, text/plain)
2015-04-29 13:54 UTC, Erik van Pienbroek
no flags Details
File: proc_pid_status (976 bytes, text/plain)
2015-04-29 13:54 UTC, Erik van Pienbroek
no flags Details
File: var_log_messages (682 bytes, text/plain)
2015-04-29 13:54 UTC, Erik van Pienbroek
no flags Details

Description Erik van Pienbroek 2015-04-29 13:54:39 UTC
Description of problem:
The crash happens when I try to start a spice session from the RHEV-M webinterface

Version-Release number of selected component:
virt-viewer-2.0-1.fc22

Additional info:
reporter:       libreport-2.5.1
backtrace_rating: 4
cmdline:        remote-viewer --spice-controller
crash_function: _g_log_abort
executable:     /usr/bin/remote-viewer
global_pid:     13537
kernel:         4.0.0-1.fc22.x86_64
runlevel:       N 5
type:           CCpp
uid:            1000

Truncated backtrace:
Thread no. 1 (4 frames)
 #0 _g_log_abort at gmessages.c:315
 #3 do_pre_parse_initialization at gtkmain.c:644
 #4 pre_parse_hook at gtkmain.c:752
 #5 g_option_context_parse at goption.c:1925

Comment 1 Erik van Pienbroek 2015-04-29 13:54:43 UTC
Created attachment 1020190 [details]
File: backtrace

Comment 2 Erik van Pienbroek 2015-04-29 13:54:44 UTC
Created attachment 1020191 [details]
File: build_ids

Comment 3 Erik van Pienbroek 2015-04-29 13:54:45 UTC
Created attachment 1020192 [details]
File: cgroup

Comment 4 Erik van Pienbroek 2015-04-29 13:54:46 UTC
Created attachment 1020193 [details]
File: core_backtrace

Comment 5 Erik van Pienbroek 2015-04-29 13:54:48 UTC
Created attachment 1020194 [details]
File: dso_list

Comment 6 Erik van Pienbroek 2015-04-29 13:54:49 UTC
Created attachment 1020195 [details]
File: environ

Comment 7 Erik van Pienbroek 2015-04-29 13:54:50 UTC
Created attachment 1020196 [details]
File: limits

Comment 8 Erik van Pienbroek 2015-04-29 13:54:51 UTC
Created attachment 1020197 [details]
File: maps

Comment 9 Erik van Pienbroek 2015-04-29 13:54:53 UTC
Created attachment 1020198 [details]
File: mountinfo

Comment 10 Erik van Pienbroek 2015-04-29 13:54:54 UTC
Created attachment 1020199 [details]
File: namespaces

Comment 11 Erik van Pienbroek 2015-04-29 13:54:55 UTC
Created attachment 1020200 [details]
File: open_fds

Comment 12 Erik van Pienbroek 2015-04-29 13:54:56 UTC
Created attachment 1020201 [details]
File: proc_pid_status

Comment 13 Erik van Pienbroek 2015-04-29 13:54:57 UTC
Created attachment 1020202 [details]
File: var_log_messages

Comment 14 Erik van Pienbroek 2015-04-29 13:56:02 UTC
The console shows this error message:
(remote-viewer:13700): Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

Comment 15 Christophe Fergeau 2015-04-29 14:09:30 UTC
I assume this happens too if you start remote-viewer manually from a terminal? (just type 'remote-viewer').
does 'ldd /usr/bin/remote-viewer |grep gtk' show it linking with both gtk2 and gtk3 ?

Comment 16 Christophe Fergeau 2015-04-29 14:10:51 UTC
Ah, the backtrace shows that something is indeed bringing gtk2 in :(  /usr/lib64/libcacard.so.0.0.0 caused issues in the past, dunno if it's the culprit this time

Comment 17 Erik van Pienbroek 2015-04-29 14:13:19 UTC
When I execute remote-viewer manually or indicate in the RHEV-M webinterface that the native client should be used (instead of the browser plugin) it works fine. It seems to be limited to the XPI plugin

$ ldd /usr/bin/remote-viewer |grep gtk
	libgtk-vnc-2.0.so.0 => /lib64/libgtk-vnc-2.0.so.0 (0x00007f01aa2b0000)
	libspice-client-gtk-3.0.so.4 => /lib64/libspice-client-gtk-3.0.so.4 (0x00007f01a93e3000)
	libgtk-3.so.0 => /lib64/libgtk-3.so.0 (0x00007f01a8af9000)

This is on Fedora 22 btw

Comment 18 Christophe Fergeau 2015-04-29 15:03:50 UTC
What does 'update-alternatives --display spice-xpi-client' point to? Is it (a symlink to) /usr/bin/remote-viewer or something else?

Comment 19 Erik van Pienbroek 2015-04-29 15:08:12 UTC
$ ls -al /usr/libexec/spice-xpi-client
lrwxrwxrwx. 1 root root 34 21 mrt 19:04 /usr/libexec/spice-xpi-client -> /etc/alternatives/spice-xpi-client

$ alternatives --config spice-xpi-client

Er is 1 programma die 'spice-xpi-client' levert.

  Selectie    Commando
-----------------------------------------------
*+ 1           /usr/libexec/spice-xpi-client-remote-viewer

<enter> om de huidige selectie te bewaren[+], of type een selectie nummer: ^C

Comment 20 Christophe Fergeau 2015-04-29 15:25:11 UTC
(LC_ALL=C before the command could be helpful though it does not matter much here).
What is /usr/libexec/spice-xpi-client-remote-viewer pointing to or what is it running? I'm trying to make sure this is actually running /usr/bin/remote-viewer and not something else.

Comment 21 Erik van Pienbroek 2015-04-29 15:27:20 UTC
$ ls -la /usr/libexec/spice-xpi-client-remote-viewer
-rwxr-xr-x. 1 root root 214 12 jan 19:17 /usr/libexec/spice-xpi-client-remote-viewer
$ rpm --query --whatprovides /usr/libexec/spice-xpi-client-remote-viewer
virt-viewer-2.0-1.fc22.x86_64

Thus the xpi-client points to virt-viewer instead of remote-viewer

Comment 22 Erik van Pienbroek 2015-04-29 15:28:54 UTC
Scratch that last comment, /usr/libexec/spice-xpi-client-remote-viewer is a shell script (provided by the virt-viewer package) which calls remote-viewer

Comment 23 Christophe Fergeau 2015-04-29 15:33:37 UTC
This is what I was about to mention. As the shell script is running 'remote-viewer' and not '/usr/bin/remote-viewer', do you have another remote-viewer binary anywhere else on your system?

Comment 24 Erik van Pienbroek 2015-04-29 15:36:35 UTC
# find / -name remote-viewer 2> /dev/null
/usr/bin/remote-viewer

I also verified my bash profile and there is no alias set named 'remote-viewer'

Comment 25 Erik van Pienbroek 2015-04-29 15:45:24 UTC
I just tried to diff the list of loaded libraries mentioned here in the dso_list file with a list generated by running remote-viewer normally (using lsof). In this diff I noticed that the library libmozgtk2.so also gets loaded when using the XPI plugin. This library (/usr/lib64/firefox/libmozgtk2.so) pulls in GTK2 so that might explain the error

Comment 26 Christophe Fergeau 2015-04-30 19:19:33 UTC
Yup, it does explain the error. Adding "unset LD_PRELOAD" at the beginning of /usr/libexec/spice-xpi-client fixes the crash.

Comment 27 Erik van Pienbroek 2015-04-30 20:42:50 UTC
Nice catch, the environ file which is attached to this bug indeed contains a LD_PRELOAD=/usr/lib64/firefox/libmozgtk2.so. This isn't something I have set myself so I guess it is firefox itself which is to blame here. My guess is that other GTK3 based XPI plugins will be affected by this as well.

We could work around it for now by adding an 'unset LD_PRELOAD' to the /usr/libexec/spice-xpi-client script but that sounds more like a hack to me than the right solution. Perhaps we should reassign this bug to the firefox product so we can found out their opinion on this?

Comment 28 Christophe Fergeau 2015-04-30 20:49:15 UTC
Hmm the situation seems complicated/ugly http://emilio.pozuelo.org/posts/75 This seems to be done on purpose, in which case unsetting LD_PRELOAD in our wrapper script may be the best fix.

Comment 29 Erik van Pienbroek 2015-04-30 21:13:46 UTC
From what I understand from that blog posting is that the LD_PRELOAD override is only needed for starting up the plugin-container itself. If that really is the case then the plugin-container itself should also sanitize/clean up the environment before loading/spawning the requested plugin in question (spice-xpi in this case).

Comment 30 Christophe Fergeau 2015-05-13 20:44:54 UTC
*** Bug 1220899 has been marked as a duplicate of this bug. ***

Comment 31 Martin Stransky 2015-05-18 18:59:38 UTC
There's no support of GTK3 based XPI plugins (actually you don't use XPI plugin but NPAPI plugin). The NPAPI supports Gtk2 only.

Comment 32 Christophe Fergeau 2015-05-19 08:17:52 UTC
The plugin itself is not linking with gtk+. It however starts a new process (using g_spawn_async() from glib), and this process happens to be using gtk3. The environment our plugin inherited from plugin-container contains some LD_PRELOAD hack in order to be able the gtk2 flash plugin with gtk3 firefox, and it's this LD_PRELOAD which interacts badly with the process we are trying to spawn.

Comment 33 Christophe Fergeau 2015-05-28 14:16:56 UTC
I sent http://lists.freedesktop.org/archives/spice-devel/2015-May/020003.html upstream.

Comment 34 Fedora Update System 2015-06-09 19:26:30 UTC
spice-xpi-2.8.90-7.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/spice-xpi-2.8.90-7.fc22

Comment 35 Fedora Update System 2015-06-11 18:32:28 UTC
Package spice-xpi-2.8.90-7.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing spice-xpi-2.8.90-7.fc22'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-9757/spice-xpi-2.8.90-7.fc22
then log in and leave karma (feedback).

Comment 36 Fedora Update System 2015-06-21 00:30:59 UTC
spice-xpi-2.8.90-7.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.