hald-0.5.9.1 segfaults on serial device check.

Natanael Copa natanael.copa at gmail.com
Tue Jul 24 16:45:17 PDT 2007


Kernel is 64bit linux-2.6.21 on a Dell optiplex 745.

Here is output when running it in gdb:

13:02:29.255 [I] hald_runner.c:108: runner_server_message_handler:
destination=(null) obj_path=/org/freedesktop/HalRunner
interface=org.freedesktop.HalRunner method=StartedProcessExited
13:02:29.255 [I] hald_runner.c:123: Previously started process with pid 22035
exited
13:02:29.255 [I] hald.c:83: in addon_terminated for
udi=/org/freedesktop/Hal/devices/usb_device_413c_2003_noserial_if0_logicaldev_input
13:02:29.255 [E] device.c:1622: In hal_device_inc_num_ready_addons for
udi=/org/freedesktop/Hal/devices/usb_device_413c_2003_noserial_if0_logicaldev_input
but all addons are already ready!
13:02:29.255 [I] hald_dbus.c:4711: ************************
13:02:29.255 [I] hald_dbus.c:4712: Client to local_server was disconnected for
6ffc50
13:02:29.255 [I] hald_dbus.c:4713: ************************
13:02:29.255 [I] hald_dbus.c:4752: ***************************
13:02:29.255 [I] hald_dbus.c:4753: ********* unregistered 6ffc50
13:02:29.255 [I] hald_dbus.c:4754: ***************************
!  full path is '/usr/libexec/hald-probe-serial', program_dir is '/usr/libexec'
13:02:29.255 [D] hald_dbus.c:3090: udi=/org/freedesktop/Hal/devices/computer
13:02:29.255 [I] hald_dbus.c:3116: AddonIsReady on udi
'/org/freedesktop/Hal/devices/computer'
[22040]: 13:02:29.256 [D] probe-serial.c:70: Checking if /dev/ttyS3 is actually
present
[22040]: 13:02:29.256 [E] probe-serial.c:85: serial port /dev/ttyS3 seems not
to exist
/usr/libexec/hald-probe-serial exited
13:02:29.256 [I] device.c:3238: entering; exit_type=0, return_code=1
13:02:29.256 [I] coldplug.c:213: pool_num_freed = 176 (of 821)
13:02:29.256 [I] hotplug.c:134: /sys/devices/pnp0/00:07/ttyS0 is a device
(subsystem)
13:02:29.256 [I] osspec.c:892: hal_util_find_known_parent:
'/sys/devices/pnp0/00:07/ttyS0'->'/sys/devices/pnp0/00:07'
13:02:29.256 [I] device.c:3319: add_dev: subsys=tty
sysfs_path=/sys/devices/pnp0/00:07/ttyS0 dev= parent_dev=0x0070afa0

Program received signal SIGSEGV, Segmentation fault.
0x0000000000425178 in serial_get_prober (d=0x6fe2a0) at device.c:1228
1228            if (!strncmp(hal_device_property_get_string (d,
"linux.device_file"), "/dev/ttyS", 9))


The backtrace:
(gdb) bt
#0  0x0000000000425178 in serial_get_prober (d=0x6fe2a0) at device.c:1228
#1  0x00000000004296b1 in dev_callouts_preprobing_done (d=0x6fe2a0, 
    userdata1=0x2b5c96d5e9b8, userdata2=0x54b0c0) at device.c:3295
#2  0x000000000040806c in hal_util_callout_device_preprobe (d=0x6fe2a0, 
    callback=0x4295c5 <dev_callouts_preprobing_done>, 
    userdata1=0x2b5c96d5e9b8, userdata2=0x54b0c0) at util.c:1065
#3  0x00000000004298d2 in hotplug_event_begin_add_dev (
    subsystem=0x2b5c96d5e9d0 "tty", 
    sysfs_path=0x2b5c96d5ead0 "/sys/devices/pnp0/00:07/ttyS0", 
    device_file=0x2b5c96d5ecd0 "", parent_dev=0x70afa0, 
    parent_path=0x701ed0 "/sys/devices/pnp0/00:07", end_token=0x2b5c96d5e9b8)
    at device.c:3364
#4  0x0000000000420174 in hotplug_event_begin_sysfs (
    hotplug_event=0x2b5c96d5e9b8) at hotplug.c:160
#5  0x0000000000420410 in hotplug_event_begin (hotplug_event=0x2b5c96d5e9b8)
    at hotplug.c:262
#6  0x0000000000420536 in hotplug_event_process_queue () at hotplug.c:324
#7  0x000000000040a255 in process_reply (m=0x5576a0, hb=0x701ed0)
    at hald_runner.c:678
#8  0x000000000040a289 in call_notify (pending=0x702140, user_data=0x701ed0)
    at hald_runner.c:689
#9  0x00002b5c963010fa in ?? () from /usr/lib/libdbus-1.so.3
#10 0x00002b5c963027e1 in dbus_connection_dispatch ()
   from /usr/lib/libdbus-1.so.3
#11 0x00002b5c95effc95 in ?? () from /usr/lib/libdbus-glib-1.so.2
#12 0x00002b5c96183633 in g_main_context_dispatch ()
   from /usr/lib/libglib-2.0.so.0
#13 0x00002b5c9618647d in ?? () from /usr/lib/libglib-2.0.so.0
#14 0x00002b5c96186766 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#15 0x0000000000412147 in main (argc=3, argv=0x7fff14ccef48) at hald.c:660

The problem is that serial_get_prober() dont check if
hal_device_property_get_string() returns NULL or not.

Patch is attatched.

Originally posted here:
https://bugs.gentoo.org/show_bug.cgi?id=183516

Thanks!

Natanael Copa

PS. I'm not on mailing list so please CC me if anybody care to answer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_serial_dev_str.patch
Type: text/x-patch
Size: 603 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20070724/de4bae84/attachment.bin 


More information about the hal mailing list