Bug 486427 - haldaemon crashes if /dev/ttyS* does not exist
Summary: haldaemon crashes if /dev/ttyS* does not exist
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: hal
Version: 5.3
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: Richard Hughes
QA Contact: desktop-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-02-19 18:02 UTC by Niels de Vos
Modified: 2010-03-30 08:32 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-30 08:32:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
extra checks during detection of ttyS-devices (817 bytes, patch)
2009-02-19 18:02 UTC, Niels de Vos
no flags Details | Diff
backtrace with gdb on the crash (128.91 KB, text/plain)
2009-03-17 10:09 UTC, Niels de Vos
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0256 0 normal SHIPPED_LIVE hal bug fix update 2010-03-29 12:47:57 UTC

Description Niels de Vos 2009-02-19 18:02:50 UTC
Created attachment 332595 [details]
extra checks during detection of ttyS-devices

Description of problem:

The haldaemon crashes if /sys/class/tty/ttyS* exists but /dev/ttyS* has been removed/modified.


Version-Release number of selected component (if applicable):
hal-0.5.3.8-35.el5 (as released unmodified with CentOS-5.2)

How reproducible:
100%


Steps to Reproduce:
1. rm -f /dev/ttyS* (or only one of the ttyS-nodes)
2. service haldaemon restart


Actual results:
Starting HAL daemon: [FAILED]


Expected results:
Starting HAL daemon: [  OK  ]


Additional info:

Removing/modifying /dev/ttyS* devices is a common advice (i.e. http://lkml.org/lkml/2009/1/29/133) for users with lots of serial-ports. Some PCI-boards with serial-ports provide more than the actual physical ports. A board with support for 4-ports can actually have only 2-ports. If two or more of these PCI-boards are used, the numbering of the ttyS-devices makes no sense for common users.

Example:
PCI-board #1 provides:
  ttyS4 - labeled COM5 on the hardware
  ttyS5 - labeled COM6 on the hardware
  ttyS6 - not available
  ttyS7 - not available

PCI-board #2 provides:
  ttyS8 - labeled COM7 on the hardware
  ttyS9 - labeled COM8 on the hardware
  ttyS10 - not available
  ttyS11 - not available

With a custom script the serial-ports of these two PCI-boards are removed and created (mknod) again so that the label on the hardware matches the /dev/ttyS* node. /sys/class/tty still contains a complete reference to all the ttyS-devices. hald seems to get confused if devices are listed under /sys/class/tty but are missing under /dev.

Comment 1 Richard Hughes 2009-03-11 16:56:22 UTC
Could you please provide a backtrace (with debuginfo for hal) when this happens please.

Comment 2 Niels de Vos 2009-03-17 10:09:50 UTC
Created attachment 335496 [details]
backtrace with gdb on the crash

gdb and haldeamon started with following command:

script -f hald-gdb.log -c "gdb --args hald --daemon=no --verbose"

Comment 3 Richard Hughes 2009-03-17 15:42:30 UTC
Niels, if I built a test package, would you be able to install it and test a patch? It's a bit tricky to test on my local machine. If it's okay with you, I'll just spin a set of test rpms.

Comment 4 Niels de Vos 2009-03-17 15:46:46 UTC
(In reply to comment #3)
> Niels, if I built a test package, would you be able to install it and test a
> patch? It's a bit tricky to test on my local machine. If it's okay with you,
> I'll just spin a set of test rpms.  

Yes, that's fine.

Note that I'm testing on CentOS-5.2, so please no incompatible 5.3 RPMs.

Comment 5 Niels de Vos 2009-04-08 14:59:23 UTC
Just a note that the same bug is still there on 5.3 - hal-0.5.8.1-38.el5.

Are there any RPMs for testing already? CentOS-5.3 is out, so I'll be able to test any current release.

Thanks, Niels

Comment 6 Niels de Vos 2009-09-22 07:29:01 UTC
Uhm... the statements above are not really correct any more. As you'll notice my emailaddress changed and now I'm able to run tests on RHEL :)

Comment 7 Richard Hughes 2009-11-12 09:27:03 UTC
A tiny check to see if hal_device_property_get_string (d, "linux.device_file") is NULL would fix this. It would be a trivial two line patch.

Comment 11 Richard Hughes 2009-11-26 12:11:37 UTC
Built as http://brewweb.devel.redhat.com/brew/taskinfo?taskID=2106624

Comment 15 errata-xmlrpc 2010-03-30 08:32:48 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0256.html


Note You need to log in before you can comment on or make changes to this bug.