Bug 151038 - kded crashes when /etc/fstab contains a mount point path which contains a dots '.'
Summary: kded crashes when /etc/fstab contains a mount point path which contains a dot...
Status: RESOLVED DUPLICATE of bug 140668
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kded (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 155069 155537 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-10-19 16:12 UTC by Xuân Baldauf
Modified: 2008-03-25 15:55 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xuân Baldauf 2007-10-19 16:12:36 UTC
Version:           KDE Daemon: $Id: kded.cpp 634204 2007-02-16 16:12:23Z lunakl $ (using KDE KDE 3.5.7)
Installed from:    SuSE RPMs
Compiler:          gcc (GCC) 4.2.1 (SUSE Linux) 
OS:                Linux

How to reproduce:
(1) Add this line to your "/etc/fstab":

//host/share			/mnt/some.thing				cifs	defaults	0	0

(2) Restart kded
(3) Insert a DVD into your DVD drive
(4) Press the "eject" button on the DVD drive.

Expected behaviour:
* DVD gets ejected


Actual behaviour:
* kded crashes with SIGABRT
* DVD does not get ejected (but a second attempt will succeed)


Analysis:

The dot '.' in the mount point path "/mnt/some.thing" is retained throughout HAL and DBUS. Within the kded process, the function "dbus_message_new_method_call" is called with parameter "/org/kde/mediamanager/fstab/hostsharemntsome.thing". This function effectivey calls function "_dbus_validate_path" in "dbus-marshall-validate.c", which checks each character of this path using the macro VALID_NAME_CHARACTER. This macro in turn is defined as

#define VALID_NAME_CHARACTER(c)                 \
  ( ((c) >= '0' && (c) <= '9') ||               \
    ((c) >= 'A' && (c) <= 'Z') ||               \
    ((c) >= 'a' && (c) <= 'z') ||               \
    ((c) == '_') )

Notably, this macro lacks the allowance for dots, thus, this check fails, thus function "_dbus_validate_path" returns false, thus assertions fail and the process receives SIGABRT. 


The corresponding output looks like:

"process 5044: arguments to dbus_message_new_method_call() were incorrect, assertion "_dbus_check_is_valid_path (path)" failed in file dbus-message.c line 1074.
This is normally a bug in some application using the D-Bus library.
  D-Bus not built with -rdynamic so unable to print a backtrace

Program received signal SIGABRT, Aborted."


The gdb backtrace at abort time looks like:

"#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7e768f5 in raise () from /lib/libc.so.6
#2  0xb7e781e1 in abort () from /lib/libc.so.6
#3  0xb6315f25 in _dbus_abort () at dbus-sysdeps.c:84
#4  0xb6311ec6 in _dbus_warn_check_failed (format=0xb631d920 "arguments to %s() were incorrect, assertion \"%s\" failed in file %s line %d.\nThis is normally a bug in some application using the D-Bus library.\n") at dbus-internals.c:283
#5  0xb6306c74 in dbus_message_new_method_call (destination=0xb633c92d "org.freedesktop.Hal", path=0x81ca190 "/org/kde/mediamanager/fstab/hostsharemntsome.thing", interface=0xb633c976 "org.freedesktop.Hal.Device", method=0xb633cc3c "GetPropertyString")
    at dbus-message.c:1071
#6  0xb63385ae in libhal_device_get_property_string (ctx=0x80d05b8, udi=0x6 <Address 0x6 out of bounds>, key=0xb6385fad "block.storage_device", error=0xbfd6617c) at libhal.c:1410
#7  0xb6375e26 in libhal_device_get_property_QString (ctx=0x80d05b8, udi=0x81ca190 "/org/kde/mediamanager/fstab/hostsharemntsome.thing", key=0xb6385fad "block.storage_device") at /usr/src/debug/kdebase-3.5.7/kioslave/media/mediamanager/halbackend.cpp:51
#8  0xb637dea1 in HALBackend::DeviceCondition (this=0x80d0568, udi=0x81596c0 "/org/freedesktop/Hal/devices/storage_model_DVD_RW_AD_7543A", condition=0x81e4784 "EjectPressed") at /usr/src/debug/kdebase-3.5.7/kioslave/media/mediamanager/halbackend.cpp:341
#9  0xb637dfee in HALBackend::hal_device_condition (ctx=0x80d05b8, udi=0x81596c0 "/org/freedesktop/Hal/devices/storage_model_DVD_RW_AD_7543A", condition_name=0x81e4784 "EjectPressed", message=0x81e4798 "")
    at /usr/src/debug/kdebase-3.5.7/kioslave/media/mediamanager/halbackend.cpp:792
#10 0xb633afba in filter_func (connection=0x816f9c0, message=0x8158158, user_data=0x80d05b8) at libhal.c:1093
#11 0xb62fb1a5 in dbus_connection_dispatch (connection=0x816f9c0) at dbus-connection.c:4267
#12 0xb632a783 in DBusQt::Connection::dispatchRead (this=0x816fa48) at /usr/src/debug/dbus-qt3-0.62/dbus-qt3/connection.cpp:119
#13 0xb632af05 in DBusQt::Connection::qt_invoke (this=0x816fa48, _id=8, _o=0xbfd66504) at /usr/src/debug/dbus-qt3-0.62/dbus-qt3/connection.moc:112
#14 0xb74478ad in QObject::activate_signal (this=0x816fc48, clist=0x816f4e0, o=0xbfd66504) at kernel/qobject.cpp:2356
#15 0xb744844d in QObject::activate_signal (this=0x816fc48, signal=2) at kernel/qobject.cpp:2325
#16 0xb632ba29 in DBusQt::Internal::Integrator::readReady (this=0x816fc48) at /usr/src/debug/dbus-qt3-0.62/dbus-qt3/integrator.moc:214
#17 0xb632ba8f in DBusQt::Internal::Integrator::slotRead (this=0x816fc48, fd=22) at /usr/src/debug/dbus-qt3-0.62/dbus-qt3/integrator.cpp:169
#18 0xb632bd62 in DBusQt::Internal::Integrator::qt_invoke (this=0x816fc48, _id=2, _o=0xbfd6660c) at /usr/src/debug/dbus-qt3-0.62/dbus-qt3/integrator.moc:233
#19 0xb74478ad in QObject::activate_signal (this=0x80d0608, clist=0x816f328, o=0xbfd6660c) at kernel/qobject.cpp:2356
#20 0xb7448350 in QObject::activate_signal (this=0x80d0608, signal=2, param=22) at kernel/qobject.cpp:2449
#21 0xb777c4a0 in QSocketNotifier::activated (this=0x80d0608, t0=22) at .moc/release-shared-mt/moc_qsocketnotifier.cpp:85
#22 0xb74653f0 in QSocketNotifier::event (this=0x80d0608, e=0xbfd668b8) at kernel/qsocketnotifier.cpp:258
#23 0xb73e90ac in QApplication::internalNotify (this=0xbfd66bf4, receiver=0x80d0608, e=0xbfd668b8) at kernel/qapplication.cpp:2636
#24 0xb73e9e96 in QApplication::notify (this=0xbfd66bf4, receiver=0x80d0608, e=0xbfd668b8) at kernel/qapplication.cpp:2359
#25 0xb7a93a52 in KApplication::notify () from /opt/kde3/lib/libkdecore.so.4
#26 0xb73dd521 in QEventLoop::activateSocketNotifiers (this=0x80a4bf0) at kernel/qapplication.h:520
#27 0xb7398236 in QEventLoop::processEvents (this=0x80a4bf0, flags=4) at kernel/qeventloop_x11.cpp:383
#28 0xb73ffc30 in QEventLoop::enterLoop (this=0x80a4bf0) at kernel/qeventloop.cpp:198
#29 0xb73ffac6 in QEventLoop::exec (this=0x80a4bf0) at kernel/qeventloop.cpp:145
#30 0xb73e8c1f in QApplication::exec (this=0xbfd66bf4) at kernel/qapplication.cpp:2759
#31 0xb7f8e3a8 in kdemain () from /opt/kde3/lib/libkdeinit_kded.so
#32 0x080484f2 in ?? ()
#33 0x00000001 in ?? ()
#34 0xbfd66e14 in ?? ()
#35 0xbfd66d88 in ?? ()
#36 0x08048529 in ?? ()
#37 0xb7fd4f60 in ?? () from /lib/ld-linux.so.2
#38 0xbfd66d90 in ?? ()
#39 0xbfd66de8 in ?? ()
#40 0xb7e62fe0 in __libc_start_main () from /lib/libc.so.6
Backtrace stopped: frame did not save the PC
"

I'm using the rpm packages of OpenSUSE 10.3, as follows:

notebook:~ # rpm -q dbus-1
dbus-1-1.0.2-59
notebook:~ # rpm -q hal
hal-0.5.9_git20070831-13
notebook:~ # rpm -q kdebase3
kdebase3-3.5.7-87
notebook:~ # 


I'm not sure whether kded itself is to be blamed. However, as kded uses other libraries, kded incorporates the other libraries as "own" and thus I ask the bug reviewer to open bug reports at these libraries once he|she knows which libraries to blame, if any.

Thank you!
Comment 1 David Faure 2007-10-19 16:33:24 UTC
Seems like a HAL bug then, right Kevin?
Comment 2 Kevin Ottens 2007-10-19 19:01:04 UTC
Le vendredi 19 octobre 2007, David Faure a écrit :
> Seems like a HAL bug then, right Kevin?


Since we use libhal the sanity checking should indeed be done there IMO. That 
said I'm not sure this library is maintained anymore... but that's another 
story.
Comment 3 Yury 2007-12-01 23:42:06 UTC
Hi there... This bug is still alive and annoying - nobody can use network paths and kde together normally) Hoping for the fastest solution... And thank you guys for such awesome work... everyone should be totally thankful for you)
Comment 4 Yury 2007-12-01 23:45:16 UTC
And also here are links for duplicates (as I can see)
http://bugs.kde.org/show_bug.cgi?id=140668
http://bugs.kde.org/show_bug.cgi?id=150757
http://bugs.kde.org/show_bug.cgi?id=143070
again thanks for attention
Comment 5 Maksim Orlovich 2008-01-12 17:53:51 UTC
*** Bug 155537 has been marked as a duplicate of this bug. ***
Comment 6 Maksim Orlovich 2008-01-12 17:54:21 UTC
*** Bug 155069 has been marked as a duplicate of this bug. ***
Comment 7 Maksim Orlovich 2008-01-12 17:58:04 UTC

*** This bug has been marked as a duplicate of 140668 ***