hal-device-manager does not start

Bug #13535 reported by Joseph S.
8
Affects Status Importance Assigned to Milestone
hal (Ubuntu)
Fix Released
Medium
Michael Vogt

Bug Description

After installing all available updates in Hoary (32bit), the Device Manager
fails to start. Here's the output:

$ hal-device-manager
Traceback (most recent call last):
  File "/usr/bin/hal-device-manager", line 18, in ?
    DeviceManager()
  File "/usr/share/hal/device-manager/DeviceManager.py", line 88, in __init__
    self.add_device_signal_recv (name);
  File "/usr/share/hal/device-manager/DeviceManager.py", line 99, in
add_device_signal_recv
    udi)
  File "/usr/lib/python2.4/site-packages/dbus.py", line 93, in add_signal_receiver
    dbus_bindings.bus_add_match(self._connection, match_rule)
  File "dbus_bindings.pyx", line 1516, in dbus_bindings.bus_add_match
dbus_bindings.DBusException: Connection ":1.17" is not allowed to add more match
rules (increase limits in configuration file if required)

The hardware is:
Asus A8N-SLI
Athlon64 3200+
1GB RAM
GeForce 6600GT PCIex

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport.

I can't reproduce the problem here with my up-to-date hoary. Does it happens
alaways for you? Or only sometimes? If only sometimes, are are any steps that
need to be taken to reproduce the problem?

Thanks,
 Michael

Revision history for this message
Joseph S. (titaniumangel) wrote :

It always happens since the update, no special steps are necessary. When it's
run, an empty window appears for a second and then immediately disappears. When
executed from a terminal, the pasted output is displayed. I've just tried it
again and noticed that the number after Connection in the last line keeps
increasing on each failed attempt to run. I'm not sure if that means anything.
Is there any other info I could provide to help track down the problem?

Here's the output again with the different number ('Connection ":1.22"'):

$ hal-device-manager
Traceback (most recent call last):
  File "/usr/bin/hal-device-manager", line 18, in ?
    DeviceManager()
  File "/usr/share/hal/device-manager/DeviceManager.py", line 88, in __init__
    self.add_device_signal_recv (name);
  File "/usr/share/hal/device-manager/DeviceManager.py", line 99, in
add_device_signal_recv
    udi)
  File "/usr/lib/python2.4/site-packages/dbus.py", line 93, in add_signal_receiver
    dbus_bindings.bus_add_match(self._connection, match_rule)
  File "dbus_bindings.pyx", line 1516, in dbus_bindings.bus_add_match
dbus_bindings.DBusException: Connection ":1.22" is not allowed to add more match
rules (increase limits in configuration file if required)

Revision history for this message
Joseph S. (titaniumangel) wrote :

Commenting out line 99 in DeviceManager.py (self.bus.add_signal_receiver())
bypasses the problem. It starts and seems to work, although almost all devices
are still unknown. As I'm not familiar with the internals and don't know what
that line does (other than that it does something with every device), I can't
really judge what this means.

Revision history for this message
Michael Vogt (mvo) wrote :

I researched a bit about the problem. Here are two discussions what caused the
problem:
http://lists.freedesktop.org/archives/hal/2004-August/000735.html
http://lists.freedesktop.org/pipermail/dbus/2004-August/001499.html

Essentially it looks like a problem with dbus that has a too low limit for the
devices. I'll see if we can't increase this limit somewhat.

Revision history for this message
Michael Vogt (mvo) wrote :

Increasing the limit seems to be the way to go here:
Adding:

 <limit name="max_match_rules_per_connection">512</limit>

to /etc/dbus-1/system.conf should do the tick. We should probably make this the
default.

Revision history for this message
Michael Vogt (mvo) wrote :

I put updated packages to:

http://people.ubuntu.com/~mvo/review/hal/

if you run on i386, please test them and tell me if it works for you with the
update.

Cheers,
 Michael

Revision history for this message
Joseph S. (titaniumangel) wrote :

That certainly looks like the solution but, having not used APT before, I'm not
sure how to install the package from the address you posted. If I have to add a
line to sources.list, what is the exact syntax? Or should it be installed in
another way?

Thanks.

Revision history for this message
Michael Vogt (mvo) wrote :

(In reply to comment #7)
> That certainly looks like the solution but, having not used APT before, I'm not
> sure how to install the package from the address you posted. If I have to add a
> line to sources.list, what is the exact syntax? Or should it be installed in
> another way?

I'm sorry for not being clear in my description.

Please install it using the following commands from a terminal:
$ wget http://people.ubuntu.com/~mvo/review/hal/hal_0.4.7-1ubuntu10_i386.deb
$ sudo dpkg -i hal_0.4.7-1ubuntu10_i386.deb

then you can run:
$ hal-device-manager

Cheers,
 Michael

Revision history for this message
Michael Vogt (mvo) wrote :

This problem should be fixed with the upload of hal 0.4.7-1ubuntu10. Please
reopen this bug if you still have problems.

Cheers,
 Michael

Revision history for this message
Joseph S. (titaniumangel) wrote :

That didn't seem to help, but even after installing the new version, system.conf
does not contain the <limit> line. Should it?

~/hal$ sudo dpkg -i hal_0.4.7-1ubuntu10_i386.deb
(Reading database ... 86197 files and directories currently installed.)
Preparing to replace hal 0.4.7-1ubuntu9 (using hal_0.4.7-1ubuntu10_i386.deb) ...
Unpacking replacement hal ...
Setting up hal (0.4.7-1ubuntu10) ...
 * Stopping Hardware abstraction layer:
             [ ok ]
 * Stopping system message bus:
             [ ok ]
 * Starting system message bus:
             [ ok ]
 * Starting Hardware abstraction layer:
             [ ok ]

~/hal$ hal-device-manager
Traceback (most recent call last):
  File "/usr/bin/hal-device-manager", line 18, in ?
    DeviceManager()
  File "/usr/share/hal/device-manager/DeviceManager.py", line 88, in __init__
    self.add_device_signal_recv (name);
  File "/usr/share/hal/device-manager/DeviceManager.py", line 99, in
add_device_signal_recv
    udi)
  File "/usr/lib/python2.4/site-packages/dbus.py", line 93, in add_signal_receiver
    dbus_bindings.bus_add_match(self._connection, match_rule)
  File "dbus_bindings.pyx", line 1516, in dbus_bindings.bus_add_match
dbus_bindings.DBusException: Connection ":1.4" is not allowed to add more match
rules (increase limits in configuration file if required)

Revision history for this message
Michael Vogt (mvo) wrote :

(In reply to comment #10)
> That didn't seem to help, but even after installing the new version, system.conf
> does not contain the <limit> line. Should it?

I moved the limit to /etc/dbus-1/system.d/hal.conf and set it to 512 matchers.
Do you see it there? Does it help if you increase this value even more (you need
to restart dbus after changing the file with "sudo /etc/init.d/dbus-1 restart").

Thanks,
 Michael

Revision history for this message
Michael Vogt (mvo) wrote :

I uploaded hal 0.4.7-1ubuntu11 that adds the configureation to
/etc/dbus-1/system.d/hal.conf (for real this time). Please test and tell me if
it works for you.

Cheers,
 Michael

Revision history for this message
Joseph S. (titaniumangel) wrote :

Sorry, I didn't know how to apply the patch, but managed to extract the change
logs. I manually applied hal-dbus_max_match_rules_per_connection.diff, but it
still doesn't work.

$ cat /etc/dbus-1/system.d/hal.conf
<!DOCTYPE busconfig PUBLIC
 "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>

  <!-- This configuration file specifies the required security policies
       for the HAL to work. -->

  <!-- Only root or user hal can own the HAL service -->
  <policy user="hal">
    <allow own="org.freedesktop.Hal"/>
  </policy>
  <policy user="root">
    <allow own="org.freedesktop.Hal"/>
  </policy>

  <limit name="max_match_rules_per_connection">512</limit>

  <!-- Allow anyone to invoke methods on the Manager and Device interfaces -->
  <policy context="default">
    <allow send_interface="org.freedesktop.Hal.Manager"/>
    <allow send_interface="org.freedesktop.Hal.Device"/>

    <allow receive_interface="org.freedesktop.Hal.Manager"
           receive_sender="org.freedesktop.Hal"/>
    <allow receive_interface="org.freedesktop.Hal.Device"
           receive_sender="org.freedesktop.Hal"/>
  </policy>

</busconfig>

Revision history for this message
Michael Vogt (mvo) wrote :

(In reply to comment #13)
> Sorry, I didn't know how to apply the patch, but managed to extract the change
> logs. I manually applied hal-dbus_max_match_rules_per_connection.diff, but it
> still doesn't work
[snip]

The config looks good. Did you do a:
$ sudo /etc/init.d/dbus-1 restart

so that the config was reloaded?

I have a test-system with that problem and this line fixed (and restarting dbus-1)
fixed the problem there.

Thanks,
 Michael

Revision history for this message
Joseph S. (titaniumangel) wrote :

No, I didn't restart it, sorry. After doing so, it worked just fine. Thank you
for your patience.

Best regards,
Joe

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.