After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 533840 - BaconMessageConnection and D-Bus interaction
BaconMessageConnection and D-Bus interaction
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: General
0.23.x
Other All
: Normal minor
: ---
Assigned To: empathy-maint
empathy-maint
: 536319 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-05-19 11:06 UTC by Alban Crequy
Modified: 2008-06-02 21:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (915 bytes, patch)
2008-05-23 16:26 UTC, Xavier Claessens
committed Details | Review

Description Alban Crequy 2008-05-19 11:06:21 UTC
Please describe the problem:
I started Empathy, and dbus-daemon was not running. Empathy started dbus-daemon with fork-exec and dbus-daemon, as a child process, was inheriting the Empathy open files. Then Empathy segfaulted (unfortunately I don't have the core), and I restarted Empathy with the right "ulimit -c" setting. But dbus-daemon was still running with the /tmp/empathy.alice.4211518265 socket file opened. And Empathy was  blocked.

Steps to reproduce:
1. $ ssh -X testaccount@localhost
2. $ empathy
3. crash
4. $ empathy
5. blocked on BaconMessageConnection

Actual results:
Empathy blocked

Expected results:
Either print an error or work correctly

Does this happen every time?
Only tried 1 time

Other information:
0x00002ad872c2e3d0 in __connect_nocancel () from /lib/libpthread.so.0
(gdb) bt
  • #0 __connect_nocancel
    from /lib/libpthread.so.0
  • #1 try_client
    at bacon-message-connection.c line 278
  • #2 bacon_message_connection_new
    at bacon-message-connection.c line 310
  • #3 main
    at empathy.c line 400

$ lsof /tmp/empathy.alice.4211518265
COMMAND     PID  USER   FD   TYPE             DEVICE SIZE  NODE NAME
dbus-laun 15179 alice    4u  unix 0xffff81000148a3c0      53766 /tmp/empathy.alice.4211518265
dbus-daem 15180 alice    4u  unix 0xffff81000148a3c0      53766 /tmp/empathy.alice.4211518265

smcv said:
- We can use D-Bus instead of BaconMessageConnection for single-instance.
sjoerd said:
- The bacon stuff can set FD_CLOEXEC
- The dbus autolaunching should be more rigorous with closing fd's when forking
Comment 1 Xavier Claessens 2008-05-21 09:31:59 UTC
Added Bastien Nocera (the copyright holder of BaconMessageConnection) is CC so he could help on this bug.

I don't remember where I copied that module from, could be useful to fix that bug 'upstream' because IIRC that module will be used as basis for the future GUnique?
Comment 2 Bastien Nocera 2008-05-23 00:41:01 UTC
The code lives in libbacon in SVN. Let me know when you have a patch for review :)
Comment 3 Xavier Claessens 2008-05-23 16:26:59 UTC
Created attachment 111417 [details] [review]
Proposed patch

When trying to reproduce I get that:

1) I start empathy
2) bacon-connection creates a socket on /tmp/empathy.test.X
3) dbus-daemon is not running so empathy fork and exec dbus-daemon
4) I kill empathy
5) the socket is still owned by dbus-daemon
6) I restart empathy and it says it's already running so it quits

I made a patch to add FD_CLOEXEC flag on conn->fd. It fixes the problem.

Bastien > Could you review that patch and tell me if it's OK?
Comment 4 Bastien Nocera 2008-05-23 16:28:45 UTC
Looks fine to me, please commit to libbacon trunk, applications that have this problem can then update from there.
Comment 5 Xavier Claessens 2008-05-23 16:54:25 UTC
Done, thanks for the quick review :)

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 6 Xavier Claessens 2008-06-02 21:03:38 UTC
*** Bug 536319 has been marked as a duplicate of this bug. ***