Bug 1122128

Summary: Regression: GVariant encoding of array of doubles
Product: [Fedora] Fedora Reporter: Stef Walter <stefw>
Component: glib2Assignee: Matthias Clasen <mclasen>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: awilliam, lpoetter, mclasen, mitr, paul, pertusus, puiterwijk, rdieter, robatino, stefw, walters
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: AcceptedBlocker
Fixed In Version: glib2-2.41.2-2.fc21.x86_64 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-30 21:15:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1043119, 1091301    
Attachments:
Description Flags
Test case for DBus regression
none
Fedora glib2 build fix for the regression none

Description Stef Walter 2014-07-22 15:24:57 UTC
Description of problem:

Shortly after login cockpitd loses the connection to the session dbus-daemon, with a message like this in the journal:

Jul 22 16:49:26 jalisco.cube.lan cockpitd[9784]: Failed to acquire the name com.redhat.Cockpit on the session message bus
Jul 22 16:49:26 jalisco.cube.lan cockpitd[9784]: g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting.

Version-Release number of selected component (if applicable):

cockpit-0.16-1.fc21.x86_64

How reproducible:

Every time

Steps to Reproduce:
1. Install Fedora 21 Server
2. Log into Cockpit
3. List of servers on dashboard flickers, and disappears.

Comment 1 Stef Walter 2014-07-22 15:26:18 UTC
From mitr: (… and (setenforce 0) does show the post-login screen, and briefly a server icon in the list, but the server disappears immediately.  Adding “localhost” as a server then doesn’t work.)

https://bugzilla.redhat.com/show_bug.cgi?id=1121761#c2

Comment 2 Stef Walter 2014-07-22 15:41:11 UTC
Emitting the following DBus message from cockpitd causes it to get kicked off the session bus:

/com/redhat/Cockpit/CpuMonitor com.redhat.Cockpit.ResourceMonitor NewSample (int64 1406043367553044, [0.0, 8.0, 22.0, 0.0])

Comment 3 Stef Walter 2014-07-22 15:44:23 UTC
dbus-1.8.6-2.fc21.x86_64

Comment 4 Colin Walters 2014-07-22 15:47:20 UTC
I'd guess this is an issue with GDBus serialization.  I'm guessing not many projects use "ad".

Comment 5 Colin Walters 2014-07-22 16:09:10 UTC
Definitely broken, just try:

gdbus emit -y -o /blah -s com.example.Blah.Blah '@au [0, 42, 43, 57]'
^ works

gdbus emit -y -o /blah -s com.example.Blah.Blah '@ad [0.0, 42.42, 43.43, 57.9]'
^ fails

Comment 6 Colin Walters 2014-07-22 16:10:17 UTC
Maybe regression from https://bugzilla.gnome.org/show_bug.cgi?id=732754 ?

Comment 7 Stef Walter 2014-07-22 16:33:45 UTC
Created attachment 919962 [details]
Test case for DBus regression

Confirming that this is a dbus regression. The attached test case demonstrates this.

Bad behavior (using dbus-daemon from dbus-1.8.6-2.fc21.x86_64 along with dbus-monitor):

$ ./test-dbus-xad 
signal sender=org.freedesktop.DBus -> dest=(null destination) serial=25 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.10"
   string ""
   string ":1.10"
method call sender=:1.10 -> dest=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
sent: /path org.iface.Test.MySignal ([0.0, 8.0, 22.0, 0.0],)
signal sender=org.freedesktop.DBus -> dest=(null destination) serial=26 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.10"
   string ":1.10"
   string ""
g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting.
Terminated


Correct behavior (using dbus-daemon from dbus-1.6.12-8.fc20.x86_64 along with dbus-monitor):

$ ./test-dbus-xad 
signal sender=org.freedesktop.DBus -> dest=(null destination) serial=7 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.1"
   string ""
   string ":1.1"
method call sender=:1.1 -> dest=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
signal sender=:1.1 -> dest=(null destination) serial=2 path=/path; interface=org.iface.Test; member=MySignal
   int64 1406043367553044
   array [
      double 0
sent: /path org.iface.Test.MySignal (int64 1406043367553044, [0.0, 8.0, 22.0, 0.0])
      double 8
      double 22
      double 0
   ]
^C

Comment 8 Colin Walters 2014-07-22 16:37:49 UTC
Yep, confirmed reverting those patches fixes it.

Comment 9 Colin Walters 2014-07-22 16:43:14 UTC
Hmm.  I was testing with dbus-1.6.12-8.el7.x86_64 and glib2-2.40.0-1.el7.x86_64
 (works).

With glib2 from git, it fails.  When reverting the glib array fast path bits, it works again.

So the next thing to test is whether new dbus, but old glib works.

Comment 10 Stef Walter 2014-07-22 17:04:15 UTC
Yup you're right. glib regression

Works with: glib2-2.40.0-1.fc21.x86_64
Fails with: glib2-2.41.2-1.fc21.x86_64

Comment 11 Stef Walter 2014-07-22 19:35:55 UTC
Worked on a patch upstream: https://bugzilla.gnome.org/show_bug.cgi?id=732754

Comment 12 Stef Walter 2014-07-23 09:12:43 UTC
Scratch build with the patch: http://koji.fedoraproject.org/koji/taskinfo?taskID=7183810

Comment 13 Stef Walter 2014-07-23 09:23:51 UTC
Created attachment 920179 [details]
Fedora glib2 build fix for the regression

Here's a patch to the glib2 spec file and fedora build for f21 which fixes the issue.

Comment 14 Colin Walters 2014-07-23 13:37:32 UTC
Building for f21 and rawhide.

Comment 15 Stef Walter 2014-07-23 14:25:26 UTC
Upstream patch reviewed and pushed.

Comment 16 Adam Williamson 2014-07-23 16:21:09 UTC
Discussed at 2014-07-23 Alpha blocker review meeting: http://meetbot.fedoraproject.org/fedora-blocker-review/2014-07-23/f21-blocker-review.2014-07-23-15.59.log.txt . Accepted as a blocker per criterion "Unless explicitly specified otherwise, after system installation the Cockpit web management interface must be running and accessible on its default port (XX).", https://fedoraproject.org/wiki/Fedora_21_Alpha_Release_Criteria#Cockpit_management_interface .

Comment 17 Adam Williamson 2014-07-30 17:02:46 UTC
F21 is not gated via bodhi yet, so the fixed build is already in 'stable' - http://koji.fedoraproject.org/koji/buildinfo?buildID=547263 . Can someone please re-test and confirm this is now fixed? thanks.

Comment 18 Stef Walter 2014-07-30 20:31:37 UTC
Upstream has a better patch. The update does fix the symptom (cockpit not starting). So VERIFIED unless Colin or Matthias wants to pick up the better patch.

# rpm -q glib2
glib2-2.41.2-2.fc21.x86_64

Comment 19 Adam Williamson 2014-07-30 21:15:08 UTC
as long as the bug'd fixed i'd say we're good. the 'better patch' can be picked up down the road without downstream tracking needed.