Bug 486427 - haldaemon crashes if /dev/ttyS* does not exist
haldaemon crashes if /dev/ttyS* does not exist
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: hal (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Richard Hughes
Depends On:
  Show dependency treegraph
Reported: 2009-02-19 13:02 EST by Niels de Vos
Modified: 2010-03-30 04:32 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-03-30 04:32:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0256 normal SHIPPED_LIVE hal bug fix update 2010-03-29 08:47:57 EDT

  None (edit)
Description Niels de Vos 2009-02-19 13:02:50 EST
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- (as released unmodified with CentOS-5.2)

How reproducible:

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.

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 12:56:22 EDT
Could you please provide a backtrace (with debuginfo for hal) when this happens please.
Comment 2 Niels de Vos 2009-03-17 06:09:50 EDT
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 11:42:30 EDT
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 11:46:46 EDT
(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 10:59:23 EDT
Just a note that the same bug is still there on 5.3 - hal-

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 03:29:01 EDT
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 04:27:03 EST
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 07:11:37 EST
Built as http://brewweb.devel.redhat.com/brew/taskinfo?taskID=2106624
Comment 15 errata-xmlrpc 2010-03-30 04:32:48 EDT
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.


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