Opened 16 years ago

Closed 15 years ago

Last modified 15 years ago

#19510 closed defect (fixed)

dbus-daemon crashes (KERN_PROTECTION_FAILURE)

Reported by: vinc17@… Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version: 1.7.1
Keywords: Cc: stephane.chomat@…, macports@…
Port: dbus

Description

With dbus @1.2.12_5, dbus-daemon crashes when I run Liferea from the X11 application menu. No problem with dbus @1.2.12_4.

Date/Time:      2009-05-02 02:40:53.420 +0200
OS Version:     10.4.11 (Build 8S165)
Report Version: 4

Command: dbus-daemon
Path:    /opt/local/bin/dbus-daemon
Parent:  dbus-launch [18313]

Version: ??? (???)

PID:    18314
Thread: 0

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000000

Thread 0 Crashed:
0   dbus-daemon 	0x00044fa0 _dbus_server_new_for_launchd + 32
1   dbus-daemon 	0x000402e8 _dbus_server_listen_platform_specific + 664
2   dbus-daemon 	0x00030778 dbus_server_listen + 392
3   dbus-daemon 	0x0000552c bus_context_new + 588
4   dbus-daemon 	0x00016a18 main + 1528
5   dbus-daemon 	0x000026cc _start + 760
6   dbus-daemon 	0x000023d0 start + 48

Thread 0 crashed with PPC Thread State 64:
  srr0: 0x0000000000044fa0 srr1: 0x100000000200d030                        vrsave: 0x0000000000000000
    cr: 0x48008222          xer: 0x0000000020000000   lr: 0x0000000000044fa0  ctr: 0x000000000000001f
    r0: 0x0000000000044fa0   r1: 0x00000000bffff600   r2: 0x000000000000005f   r3: 0x0000000000000000
    r4: 0x00000000a0010260   r5: 0xfffffffffefefeff   r6: 0xffffffff80808080   r7: 0x0000000000000000
    r8: 0x0000000000000000   r9: 0x0000000000000001  r10: 0x000000000000001f  r11: 0x00000000bffffaac
   r12: 0x0000000090002d68  r13: 0x0000000000000000  r14: 0x0000000000046434  r15: 0x0000000000046434
   r16: 0x0000000000046434  r17: 0x00000000bffff754  r18: 0x0000000000000000  r19: 0x0000000000050604
   r20: 0x0000000000300df0  r21: 0x0000000000051508  r22: 0x0000000000000000  r23: 0x0000000000000000
   r24: 0x0000000000000000  r25: 0x00000000bffff748  r26: 0x00000000bffff764  r27: 0x00000000bffff764
   r28: 0x0000000000000000  r29: 0x000000000004f670  r30: 0x000000000004f668  r31: 0x0000000000044f90

Binary Images Description:
    0x1000 -    0x50fff dbus-daemon 	/opt/local/bin/dbus-daemon
   0x63000 -    0x81fff libexpat.1.dylib 	/opt/local/lib/libexpat.1.dylib
0x8fe00000 - 0x8fe52fff dyld 46.16	/usr/lib/dyld
0x90000000 - 0x901bcfff libSystem.B.dylib 	/usr/lib/libSystem.B.dylib
0x90214000 - 0x90219fff libmathCommon.A.dylib 	/usr/lib/system/libmathCommon.A.dylib
0x91433000 - 0x9143efff libgcc_s.1.dylib 	/usr/lib/libgcc_s.1.dylib

Model: PowerMac7,3, BootROM 5.2.4f1, 2 processors, PowerPC G5  (3.1), 2.7 GHz, 1.5 GB
Graphics: ATI Radeon 9650, ATY,RV351, AGP, 256 MB
Memory Module: DIMM0/J11, 256 MB, DDR SDRAM, PC3200U-30330
Memory Module: DIMM1/J12, 256 MB, DDR SDRAM, PC3200U-30330
Memory Module: DIMM2/J13, 512 MB, DDR SDRAM, PC3200U-30330
Memory Module: DIMM3/J14, 512 MB, DDR SDRAM, PC3200U-30330
Network Service: Ethernet intégré, Ethernet, en0
PCI Card: AlchemyTV, tv-card, SLOT-3
Serial ATA Device: Maxtor 6B250S0, 233.76 GB
Parallel ATA Device: PIONEER DVD-RW  DVR-109
USB Device: Keyboard Hub, Apple, Inc., Up to 480 Mb/sec, 500 mA
USB Device: USB-PS/2 Optical Mouse, Logitech, Up to 1.5 Mb/sec, 100 mA
USB Device: Apple Keyboard, Apple, Inc, Up to 1.5 Mb/sec, 100 mA

Attachments (2)

org.freedesktop.dbus-session.plist (652 bytes) - added by vinc17@… 16 years ago.
Launch Agent on Tiger
org.freedesktop.dbus-system.plist (442 bytes) - added by vinc17@… 16 years ago.
Launch Daemon on Tiger

Download all attachments as: .zip

Change History (47)

comment:1 Changed 16 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Status: newassigned

What variants did you install dbus with?
Did you use launchctl to enable dbus-daemon on startup?

comment:2 in reply to:  1 ; Changed 16 years ago by vinc17@…

Replying to mcalhoun@…:

What variants did you install dbus with?

No variants.

Did you use launchctl to enable dbus-daemon on startup?

Yes. However I wonder what "startup" means just after a dbus upgrade (it seems that the old dbus-daemon that was started before the upgrade is still running).

comment:3 in reply to:  2 Changed 16 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to vinc17@…:

Replying to mcalhoun@…:

Did you use launchctl to enable dbus-daemon on startup?

Yes. However I wonder what "startup" means just after a dbus upgrade (it seems that the old dbus-daemon that was started before the upgrade is still running).

Does the problem remain after restarting your machine?

comment:4 Changed 16 years ago by treaves@…

I have this issue too. The only thing I could do to work around was to deactivate 1.2.12_5 and to activate 1.2.12_4.

comment:5 in reply to:  4 Changed 16 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to treaves@…:

I have this issue too. The only thing I could do to work around was to deactivate 1.2.12_5 and to activate 1.2.12_4.

Since I can not reproduce this error, I may need your help to track down the problem.

How did you produce this error?

In one of the previous posts, it was suggested that perhaps an old dbus-daemon process might be at fault.
After restarting, does the problem persist?

comment:6 Changed 16 years ago by treaves@…

The problem persisted even after restart. It would crash for me when I ran gnucash. Gnucash would start, and complain about not being able to read or save preferences. Opening the console showed the crash, witht he crash log being written too. I updated my MacPorts install, which updated gnucash, and that had no effect.

There were no dbus process running. Executing dbus from the command line would crash as well. Once I de-activated the new on, and re-activated the old one, I could run it manually, and gnucash once again started it automatically.

comment:7 in reply to:  6 Changed 16 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to treaves@…:

The problem persisted even after restart. It would crash for me when I ran gnucash. Gnucash would start, and complain about not being able to read or save preferences. Opening the console showed the crash, witht he crash log being written too. I updated my MacPorts install, which updated gnucash, and that had no effect.

There were no dbus process running. Executing dbus from the command line would crash as well. Once I de-activated the new on, and re-activated the old one, I could run it manually, and gnucash once again started it automatically.

Since I can not reproduce this, we may have to try a few things before we find the solution.

Could you please post the contents of
/Library/LaunchAgents/org.freedesktop.dbus-session.plist
and
/Library/LaunchDaemons/org.freedesktop.dbus-system.plist

comment:8 Changed 16 years ago by treaves@…

No launch deamon exists for either version. There is a difference in the launch agent for the two versions: for _4

<key>OnDemand</key> <false />

for _5

<key>OnDemand</key> <true />

<key>Disabled</key> <true/>

I'll play with this to see if a modified plist for _5 will work. The full files are below.

_4 version: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-AppleDTD PLIST 1.0EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict>

<key>Label</key> <string>org.freedesktop.dbus-session</string>

<key>ServiceIPC</key> <true/>

<!-- bug in 10.4's launchd - on-demand loading does not work --> <key>OnDemand</key> <false />

<key>ProgramArguments</key> <array>

<string>/opt/local/bin/dbus-daemon</string> <string>--nofork</string> <string>--session</string>

</array>

<key>Sockets</key> <dict>

<key>unix_domain_listener</key> <dict>

<key>SecureSocketWithKey</key> <string>DBUS_LAUNCHD_SESSION_BUS_SOCKET</string>

</dict>

</dict>

</dict> </plist>

_5 version: ?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-AppleDTD PLIST 1.0EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict>

<key>Label</key> <string>org.freedesktop.dbus-session</string>

<key>ServiceIPC</key> <true/>

<!-- bug in 10.4's launchd - on-demand loading does not work --> <key>OnDemand</key> <true />

<key>Disabled</key> <true/>

<key>ProgramArguments</key> <array>

<string>/opt/local/bin/dbus-daemon</string> <string>--nofork</string> <string>--session</string>

</array>

<key>Sockets</key> <dict>

<key>unix_domain_listener</key> <dict>

<key>SecureSocketWithKey</key> <string>DBUS_LAUNCHD_SESSION_BUS_SOCKET</string>

</dict>

</dict>

</dict> </plist>

comment:9 Changed 16 years ago by treaves@…

So, if the plist for _5 is modified to that of_4, then _5 works. The defect would then appear to be the plist file.

comment:10 in reply to:  9 Changed 16 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to treaves@…:

So, if the plist for _5 is modified to that of_4, then _5 works. The defect would then appear to be the plist file.

Thanks for tracking this down.
If you don't mind, I would like to narrow down which of the differences is causing the problem.

<key>OnDemand</key> <true /> should only be the case on Leopard (it is know to fail on Tiger).
Can you confirm you are using Leopard?

At the end of the dbus install process, there is a message which outlines how to enable the startup scripts using launchctl.
This should have changed <key>Disabled</key> <true/>.
Can you confirm that you applied launchctl?

comment:11 Changed 16 years ago by treaves@…

I am indeed using Leopard. As to the second question, this was an upgrade on an existing system. It worked fine before the upgrade, and running the 'port upgrade' didn't ask me to run anything when it finished.

comment:12 in reply to:  11 Changed 16 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to treaves@…:

I am indeed using Leopard. As to the second question, this was an upgrade on an existing system. It worked fine before the upgrade, and running the 'port upgrade' didn't ask me to run anything when it finished.

In an initial installation, the startup items are disabled (only because that is how MacPorts startup works).
If there is already an enabled startup, the script should not disable it (as it now does).

Just so I can confirm that we have the problem, could you run the following on the latest version (_5) of dbus.

sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
sudo launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist

and see if it works.

comment:13 Changed 16 years ago by treaves@…

There is not anything in LaunchDaemons.

Unfortunately, it's a little different from above. Deactivating and then activating - to get a 'clean' _5 - works. In other words, I can not re-create the crashes. So it seems the act of deactivating _5, activating _4, then reversing it did something. Could something have been left over after the upgrade process to _5 that left things in a bad state? And the activating/deactivating cleaned it up?

At the moment, it works (even with the original _5 plist file).

comment:14 in reply to:  13 Changed 16 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to treaves@…:

There is not anything in LaunchDaemons.

Unfortunately, it's a little different from above. Deactivating and then activating - to get a 'clean' _5 - works. In other words, I can not re-create the crashes. So it seems the act of deactivating _5, activating _4, then reversing it did something. Could something have been left over after the upgrade process to _5 that left things in a bad state? And the activating/deactivating cleaned it up?

At the moment, it works (even with the original _5 plist file).

I am at a loss to explain this behavior.
First, if no variants were used, then there should be a file /Library/LaunchDaemons/org.freedesktop.dbus-system.plist.
Second, I am not sure why the sequence of deactivating and activating would have a palliative effect.
Although I am glad everything seems to be working.

I will leave this ticket open for a day or so.
If no more problems are reported, I will close it.

comment:15 Changed 16 years ago by treaves@…

I've done a few re-installs of MacPorts, and never has dbus created a launch daemon; only a launch agent. I can't explain what I've seen either, but I wonder is what 'fixed' it for me works for others. Is the original reporter reading?

comment:16 Changed 16 years ago by vinc17@…

I still get the crash. I'm on Tiger. I'll attach the contents of the plist files of the _5 versions. But they both contain <key>OnDemand</key><false/>. I did the following:

  1. I killed the dbus process.
  2. I deactivated the _4 version.
  3. I activated the _5 version.
  4. I did:
    sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
    sudo launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
    
  5. I ran Liferea. I got a crash report for dbus-daemon.

Changed 16 years ago by vinc17@…

Launch Agent on Tiger

Changed 16 years ago by vinc17@…

Launch Daemon on Tiger

comment:17 Changed 16 years ago by vinc17@…

Also the crash occurs only when I start Liferea from the X11 menu. I do not get a crash if I start Liferea from an xterm.

comment:18 Changed 16 years ago by vinc17@…

I think I understand the condition. IIRC, X11 cleans up the environment, so that the DBUS_SESSION_BUS_ADDRESS environment variable (defined in my .profile) is no longer set in X11 and Liferea's start-up script runs dbus-launch. As a workaround, I can set DBUS_SESSION_BUS_ADDRESS in Liferea's start-up script.

Now, if I run dbus-launch form the command line, I can reproduce the crash. Probably just a minor bug since the user is not supposed to run dbus-launch, but in any case, there should not be a KERN_PROTECTION_FAILURE (the _4 version did not have this problem), but just an error message or something like that.

comment:19 in reply to:  18 Changed 16 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to vinc17@…:

I think I understand the condition. IIRC, X11 cleans up the environment, so that the DBUS_SESSION_BUS_ADDRESS environment variable (defined in my .profile) is no longer set in X11 and Liferea's start-up script runs dbus-launch. As a workaround, I can set DBUS_SESSION_BUS_ADDRESS in Liferea's start-up script.

Now, if I run dbus-launch form the command line, I can reproduce the crash. Probably just a minor bug since the user is not supposed to run dbus-launch, but in any case, there should not be a KERN_PROTECTION_FAILURE (the _4 version did not have this problem), but just an error message or something like that.

According to the original bug report, DBUS_SESSION_BUS_ADDRESS should no longer need to be set
but is used if it is set.

Does not setting DBUS_SESSION_BUS_ADDRESS anywhere solve your problem?

comment:20 Changed 16 years ago by vinc17@…

The crash occurs if DBUS_SESSION_BUS_ADDRESS is not set.

comment:21 in reply to:  20 Changed 15 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to vinc17@…:

The crash occurs if DBUS_SESSION_BUS_ADDRESS is not set.

I am at a loss to explain this behavior as well.

An earlier reporter said that dbus does not install /Library/LaunchDaemons/org.freedesktop.dbus-system.plist, but it does on my system.
I never set DBUS_SESSION_BUS_ADDRESS anywhere, but dbus works fine for me.

Since I can not reproduce any of these problems, I am nor sure how to proceed.
Any suggestions?

comment:22 Changed 15 years ago by stephane.chomat@…

I have this problem.

I run dbus with gdb and launchd_socket_path variable is null in file dbus-server-launchd.c line 76

Trace :

run with no break point
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
_dbus_server_new_for_launchd (launchd_env_var=0x0, error=0xbffff164) at dbus-server-launchd.c:76
76        if (*launchd_socket_path == '\0')
(gdb) stop

run with break point


(gdb) break dbus-server-launchd.c:76
Breakpoint 2 at 0x300fa: file dbus-server-launchd.c, line 76.
(gdb) stop
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /opt/local/bin/dbus-daemon --session --print-address
Re-enabling shared library breakpoint 2

Program received signal SIGTRAP, Trace/breakpoint trap.
0x8fe01010 in __dyld__dyld_start ()
(gdb) c
Continuing.
Re-enabling shared library breakpoint 2

Breakpoint 2, _dbus_server_new_for_launchd (launchd_env_var=0x0, error=0xbffff164) at dbus-server-launchd.c:76
76        if (*launchd_socket_path == '\0')
(gdb) print launchd_socket_path
$1 = 0x0

comment:23 Changed 15 years ago by stephane.chomat@…

Cc: stephane.chomat@… added

Cc Me!

comment:24 in reply to:  22 Changed 15 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to stephane.chomat@…:

I have this problem.

I run dbus with gdb and launchd_socket_path variable is null in file dbus-server-launchd.c line 76

Could you please confirm the following:

  • When you installed dbus, you followed the instructions and ran the program launchctl twice.
  • You do not set the variable DBUS_SESSION_BUS_ADDRESS anywhere.

If the answer is yes to both questions, try restarting your machine.

If you are still having problems, could you please tell what

launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET

returns.

comment:25 Changed 15 years ago by stephane.chomat@…

It's ok for me I restart my machine and it was ok

You can add a message in this function (line 76) if the variable is null, tell to run launchctl twice

comment:26 Changed 15 years ago by stephane.chomat@…

I restarted my computer and gconf does not work. It raises the same exception.

comment:27 in reply to:  26 Changed 15 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to stephane.chomat@…:

I restarted my computer and gconf does not work. It raises the same exception.

Could you please post the contents of
/Library/LaunchAgents/org.freedesktop.dbus-session.plist
and
/Library/LaunchDaemons/org.freedesktop.dbus-system.plist

comment:28 Changed 15 years ago by stephane.chomat@…

/Library/LaunchAgents/org.freedesktop.dbus-session.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Label</key>
        <string>org.freedesktop.dbus-session</string>
        <key>OnDemand</key>
        <true/>
        <key>ProgramArguments</key>
        <array>
                <string>/opt/local/bin/dbus-daemon</string>
                <string>--nofork</string>
                <string>--session</string>
        </array>
        <key>ServiceIPC</key>
        <true/>
        <key>Sockets</key>
        <dict>
                <key>unix_domain_listener</key>
                <dict>
                        <key>SecureSocketWithKey</key>
                        <string>DBUS_LAUNCHD_SESSION_BUS_SOCKET</string>
                </dict>
        </dict>
</dict>
</plist>

/Library/LaunchDaemons/org.freedesktop.dbus-system.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Label</key>
        <string>org.freedesktop.dbus-system</string>
        <key>OnDemand</key>
        <false/>
        <key>ProgramArguments</key>
        <array>
                <string>/opt/local/bin/dbus-daemon</string>
                <string>--system</string>
                <string>--nofork</string>
        </array>
</dict>
</plist>

comment:29 Changed 15 years ago by stephane.chomat@…

I have /Library/LaunchAgents/org.macports.dbus.plist

 $ more /Library/LaunchAgents/org.macports.dbus.plist 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Debug</key>
    <false/>
    <key>Label</key>
    <string>org.macports.dbus</string>
    <key>OnDemand</key>
    <false/>
    <key>ProgramArguments</key>
    <array>
        <string>/opt/local/bin/daemondo</string>
        <string>--label=dbus</string>
        <string>--start-cmd</string>
        <string>/opt/local/bin/dbus-daemon</string>
        <string>--session</string>
        <string>--nofork</string>
        <string>;</string>
        <string>--pid=exec</string>
    </array>
    <key>RunAtLoad</key>
    <false/>
</dict>
</plist>

I remove it and restart my computer and it works : no error and

$ launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET
/tmp/launch-gPhgAO/unix_domain_listener

with root user

$ ps xa | grep dbus
   62   ??  Ss     0:00.01 /opt/local/bin/dbus-daemon --system --nofork
$ launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET
$

comment:30 in reply to:  29 Changed 15 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to stephane.chomat@…:

I remove it and restart my computer and it works : no error and

If I understand correctly, after removing /Library/LaunchAgents/org.macports.dbus.plist, everything is working now?
If so, that is good news.

comment:31 Changed 15 years ago by stephane.chomat@…

Yes, everything is working now. gnucash is working. I restarted a second time my machine, everything is working.

comment:32 Changed 15 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: invalid
Status: assignedclosed

I think everyone who commented on this ticket has a working version now, so I will close this ticket.
If I am mistaken, please feel free to reopen.

comment:33 Changed 15 years ago by vinc17@…

Resolution: invalid
Status: closedreopened

The dbus @1.2.12_5 version has always crashed here.

comment:34 in reply to:  16 ; Changed 15 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to vinc17@…:

The dbus @1.2.12_5 version has always crashed here.

I thought everyone on this ticket had gotten it working.
Sorry if I was incorrect.

The problem on your system, as you noted in vinc17@…, is that DBUS_SESSION_BUS_ADDRESS is set in some instances but not others.
You must either ensure that DBUS_SESSION_BUS_ADDRESS is always set or never set.

To avoid DBUS_SESSION_BUS_ADDRESS altogether (which is probably the best solution), could you try:
Replying to vinc17@…:

I still get the crash. I'm on Tiger. I'll attach the contents of the plist files of the _5 versions. But they both contain <key>OnDemand</key><false/>. I did the following:

  1. I killed the dbus process.
  2. I deactivated the _4 version.
  3. I activated the _5 version.
  4. I did:
    sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
    sudo launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
    
  5. I ran Liferea. I got a crash report for dbus-daemon.
  1. Do not set DBUS_SESSION_BUS_ADDRESS anywhere.
  2. Make sure there is no /Library/LaunchAgents/org.macports.dbus.plist on your system.
  3. Restart you machine.

Let me know if it works.

comment:35 in reply to:  34 Changed 15 years ago by vinc17@…

Replying to mcalhoun@…:

The problem on your system, as you noted in vinc17@…, is that DBUS_SESSION_BUS_ADDRESS is set in some instances but not others.
You must either ensure that DBUS_SESSION_BUS_ADDRESS is always set or never set.

If this is an error, dbus-daemon should output an error message, not crash!

  1. Do not set DBUS_SESSION_BUS_ADDRESS anywhere.
  2. Make sure there is no /Library/LaunchAgents/org.macports.dbus.plist on your system.
  3. Restart you machine.

This doesn't work. I get errors like:

Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!

(liferea:1726): WARNING : Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details - 1: Failed to get connection to session: Not enough memory)

Why not enough memory?

Note that I did

sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
sudo launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist

but only the following is running:

root 1643 0.0 0.0 27940 708 ?? Ss 4:08AM 0:00.01 /opt/local/bin/dbus-daemon --nofork --session

comment:36 Changed 15 years ago by vinc17@…

And concerning gnucash:

Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!

comment:37 Changed 15 years ago by illogic-al@…

Resolution: fixed
Status: reopenedclosed

OK, I believe I have both stumbled across, and fixed vinc's problem, which was probably a simple copy/paste mistake. The command

 sudo launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist

Should really be

launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist

We've gone over this a bunch of times in other trac tickets as to why, but dbus for the user needs the user to start it. See r56579. vinc,

sudo port sync
sudo launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
sudo launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
sudo port uninstall dbus 
sudo port install dbus

Then follow the instructions at the end BEFORE you run any programs. Particularly this instruction

launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist

comment:38 in reply to:  37 Changed 15 years ago by illogic-al@…

See, even I fall pray to the subtle wiles of copy 'n' paste. Let's try this again (disregard the comment above, i.e. DO NOT FOLLOW)

OK, I believe I have both stumbled across, and fixed vinc's problem, which was probably a simple copy/paste mistake. The command

 sudo launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist

Should really be

launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist

We've gone over this a bunch of times in other trac tickets as to why. Briefly, dbus needs the user's permissions. See r56579. Vinc,

sudo port sync
sudo launchctl unload -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
sudo launchctl unload -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
sudo port uninstall dbus 
sudo port clean dbus
sudo port install dbus

Then follow the instructions at the end BEFORE you run any programs. Particularly this instruction

launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist

comment:39 Changed 15 years ago by iwilcox@…

Thanks illogic-al - this just helped me untwist my knickers over why my freshly installed 'meld' port wasn't working. Yet another user falling down the LaunchAgent/LaunchDaemon/sudo hole.

Could dbus-daemon (or its new MacPorts/launchd glue code) not handle the situation a little more gracefully than segging, though? Seems overkill for having been run as the wrong user.

comment:40 Changed 15 years ago by macports@…

I can reproduce the issue with clean install of MacPorts 1.8.0 and dbus @1.2.14_0 under 10.5.8.

As a new user of Mac, coming from linux I find macports very useful. Running Mac OS X 10.5.8 as updated automatically from Apple I downloaded MacPorts-1.8.0-10.5-Leopard.dmg, xcode313_2736_developerdvd.dmg, X11-2.4.0.dmg, installed all and performed port install gnome-games.

Failing to handle preferences I found troubles with dbus, but did not consider them critical and installed also gimp. This failed as well, and the dbus troubles become concerning. Found various threads mentioning the launchctl issues, but so far they did not help.

As next resort I removed all ports, rebooted and installed only dbus. Did this several times, and always end up with the same issue:

mac40:~ amk$ sudo port install -d dbus
--->  Computing dependencies for dbus
--->  Fetching dbus
--->  Verifying checksum(s) for dbus
--->  Extracting dbus
--->  Applying patches to dbus
--->  Configuring dbus
--->  Building dbus
--->  Staging dbus into destroot
--->  Installing dbus @1.2.14_0
--->  Activating dbus @1.2.14_0
#################################################################################################                                                               
# Startup items have been generated that will aid in                                                                                                            
# starting dbus with launchd. They are disabled                                                                                                                 
# by default. Execute the following command to start them,                                                                                                      
# and to cause it to launch at startup:                                                                                                                         
#                                                                                                                                                               
# sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist                                                                               
# launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist                                                                                    
##################################################################################################                                                              
--->  Cleaning dbus
mac40:~ amk$ sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
mac40:~ amk$ ps exauww | grep bus
messagebus 18915   0.0  0.0   600132    636   ??  Ss    9:33PM   0:00.00 /opt/local/bin/dbus-daemon --system --nofork
amk      18921   0.0  0.0   601748    324 s000  R+    9:33PM   0:00.00 grep bus
+MANPATH=/opt/local/share/man:/usr/share/man:/usr/local/share/man:/usr/X11/share/man TERM=xterm SHELL=/bin/bash SSH_CLIENT=192.168.1.102 58460 22
+SSH_TTY=/dev/ttys000 USER=amk SSH_AUTH_SOCK=/tmp/ssh-hMWFfWdU6e/agent.179 MAIL=/var/mail/amk
+PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin PWD=/Users/amk SHLVL=1 HOME=/Users/amk LOGNAME=amk
+SSH_CONNECTION=192.168.1.102 58460 192.168.1.104 22 _=/usr/bin/grep
mac40:~ amk$ launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
launchctl: CFURLWriteDataAndPropertiesToResource(/Library/LaunchAgents/org.freedesktop.dbus-session.plist) failed: -10
mac40:~ amk$
mac40:~ amk$ port installed
The following ports are currently installed:
  dbus @1.2.14_0 (active)
  expat @2.0.1_0 (active)
  pkgconfig @0.23_1 (active)

mac40:~ amk$ cat /Library/LaunchAgents/org.freedesktop.dbus-session.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Label</key>
        <string>org.freedesktop.dbus-session</string>

        <key>ServiceIPC</key>
        <true/>

        <!-- bug in 10.4's launchd - on-demand loading does not work -->
        <key>OnDemand</key>
        <true />

        <key>Disabled</key>
        <true/>

        <key>ProgramArguments</key>
        <array>
                <string>/opt/local/bin/dbus-daemon</string>
                <string>--nofork</string>
                <string>--session</string>
        </array>

        <key>Sockets</key>
        <dict>
                <key>unix_domain_listener</key>
                <dict>
                        <key>SecureSocketWithKey</key>
                        <string>DBUS_LAUNCHD_SESSION_BUS_SOCKET</string>
                </dict>
        </dict>
</dict>
</plist>

mac40:~ amk$ gdb /opt/local/bin/dbus-daemon
GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin"...Reading symbols for shared libraries .... done

(gdb) r --nofork --session
Starting program: /opt/local/bin/dbus-daemon --nofork --session
Reading symbols for shared libraries +++. done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x00030b9a in _dbus_server_new_for_launchd ()
(gdb) where
#0  0x00030b9a in _dbus_server_new_for_launchd ()                                                                                                               
#1  0x000319e5 in _dbus_server_listen_platform_specific ()                                                                                                      
#2  0x00030028 in dbus_server_listen ()                                                                                                                         
#3  0x000052e5 in bus_context_new ()                                                                                                                            
#4  0x0001681d in main ()                                                                                                                                       
(gdb)
mac40:~ amk$ uname -a
Darwin mac40.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386

All my googling ended up with users failing to run the daemons in correct order or as correct user, but I do not see what did I miss with the new install. An update above in this ticket contains /opt/local/bin/daemondo in the LaunchAgents file, but I relied on the file as delivered with the most recent port.

I resolved my problem by installing fink. Not really preferred because most stable ports have older version, including gimp. But older versions working are generally better than recent failing, I am sorry I need to stay with fink for now. The process was also not straightforward, gnome-games missed dependency on gstreamer0.10-plugins-good and I had to apply patch from http://trac.macports.org/ticket/18955 to get libsdl compiled. http://www.finkproject.org/ seems down at the moment, would report there as well.

Tried to reopen the issue as it is reproducible with recent versions of applicable items. Have no permission to change ticket fields, looks like I am a new user :-(

I believe I had also clean config files, although cannot confirm this for sure. It is possible my first install broke something (created user messagebus, some python bindings were missing) and uninstall did not clean it up completely. Still I would expect the port at least to report a problem in this area during install.

comment:41 Changed 15 years ago by macports@…

Cc: macports@… added

Cc Me!

comment:42 in reply to:  41 ; Changed 15 years ago by jp@…

I got the same issue. I even uninstalled ALL ports on my system, and reinstalled gimp (which needs dbus as a dependency). However the error remains. I suspect that this:

launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
launchctl: CFURLWriteDataAndPropertiesToResource(/Library/LaunchAgents/org.freedesktop.dbus-session.plist) failed: -10

might be the cause of the error.

comment:43 in reply to:  42 Changed 15 years ago by jp@…

I found sth out. If you ommit the -w flag while loading the session bus and set

<key>OnDemand</key>
        <true />

to

<key>OnDemand</key>
        <true />

the session bus is loaded. However, I use dbus @1.2.16_1 , so YMMV.

comment:44 Changed 15 years ago by jp@…

Of course I meant.

<key>OnDemand</key>
        <false />

In the second code example.

comment:45 Changed 15 years ago by jp@…

And that was wrong again. Its realy painful that there is no "edit" functionality here. What I really wanted to say is this (I hoe I get it right this time):

Change

<key>Disabled</key>
<true/>

to

<key>Disabled</key>
<false/>

in /Library/LaunchAgents/org.freedesktop.dbus-session.plist and then execute

launchctl load /Library/LaunchAgents/org.freedesktop.dbus-session.plist
Note: See TracTickets for help on using tickets.