Bug 102086 - "The process for the media protocol died unexpectedly." - open unmounted cd/dvd in new window from kicker media applet
Summary: "The process for the media protocol died unexpectedly." - open unmounted cd/d...
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: media (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Kevin Ottens
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-21 14:17 UTC by Ruben Jenster
Modified: 2005-04-28 14:58 UTC (History)
1 user (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 Ruben Jenster 2005-03-21 14:17:48 UTC
Version:            (using KDE KDE 3.4.0)
Installed from:    Gentoo Packages
Compiler:          3.4.3 
OS:                Linux

When trying to open a unmounted cd/dvd from the media applet in the kicker with the menu option "Open in New Windows" I get a popup message "The process for the media protocol died unexpectedly." 
Anyway the media seemed to get mounted. When I execute "Open in New Window" a second time after closing the popup message and the stalled mount window the konqueror is openend an shows up the contend of the cd/dvd as expected.

Regards 

Ruben
Comment 1 Ruben Jenster 2005-03-21 14:45:32 UTC
I must correct: This does not only apply for mounting from the kicker applet but also when mounting from konqueror services.
Comment 2 Ruben Jenster 2005-03-22 18:23:41 UTC
Im (un)happy to see that I'm not the only one having this problem.
http://forums.gentoo.org/viewtopic-t-312047-highlight-.html
Please tell me if this is a general bug. 
So I know where to look for.

Regards 

Ruben
Comment 3 Kevin Ottens 2005-03-22 18:36:04 UTC
I have hard time reproducing this one to be honest...

Could you answer those simple questions:
1) Do you use HAL? And if it's the case please give me the HAL, and DBUS versions you use.
2) Do you have pmount installed? Does installing/removing it changes something?

Moreover I'd be glad if you could give me more output. Please check that your KDE install is done with debug output activated. If that's the case please follow those instructions:
1) Login in your KDE 3.4 session
2) Open a konsole
3) execute "killall kded"
4) launch "kded &"
5) launch "kdeinit &"
6) launch "konqueror"

From the opened konqueror window, try to reproduce the bug and give me the debug output starting just before the mount action is requested.

I know it's maybe lot of work, but since I can't reproduce it here, please help me. ;-)

Thanks in advance.
Comment 4 Ruben Jenster 2005-03-22 20:13:36 UTC
Installing pmount solves this problem!
Thanks for your help.

Regards 

Ruben
Comment 5 Kevin Ottens 2005-03-22 22:34:13 UTC
Reopening it... It mustn't not die when pmount is not installed.
That's clearly a bug, it must be solved.
Comment 6 Kevin Ottens 2005-03-22 22:52:29 UTC
I still can't reproduce it... even with pmount uninstalled.
Could you give me your fstab content? And your HAL+DBUS versions (if you use them)?
Comment 7 Ruben Jenster 2005-03-22 23:08:51 UTC
I first compiled whole kde on hal-0.4.5 and dbus-0.23. After recognizing this problem I installed hal-0.4.7 and dbus 0.23.4 and remerged the kioslaves part of kdebase.

# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/hda1                               none            swap            sw                              0 0
/dev/hda5                               /               reiser4         defaults                        0 1
/dev/hda6                               /home           reiser4         defaults                        0 2
/dev/hdb1                               /mnt/hdb1       reiser4         noauto,user                     0 2
none                                    /proc           proc            defaults                        0 0
none                                    /dev/shm        tmpfs           defaults                        0 0
/dev/hdd                /media/cdrecorder       auto    user,exec,noauto,managed 0 0
/dev/hdc                /media/cdrecorder1      auto    user,exec,noauto,managed 0 0
Comment 8 Kevin Ottens 2005-03-25 23:24:34 UTC
I still can't reproduce it... I tried with and without pmount.
Really weird.
Comment 9 Mathijs Kwik 2005-04-01 19:08:03 UTC
I have the same problem, also on gentoo.
I disabled fstab-sync in hal and I don't have pmount installed.
I have a entry in my /etc/fstab saying:
/dev/hdd /mnt/cdrom auto user,noauto 0 0
when I just type mount /mnt/cdrom it mounts and is accessible through file://mnt/cdrom
hald and dbus are running and the moment I insert a CD (but don't mount it yet) it shows up on my desktop (and in media://)
so far so good.
clicking the icon even mounts the cd (also good, since it is in fstab I don't need fstab-sync or pmount)
but then the process dies and I can't access the cd through media://
only through file://mnt/cdrom

in my .xsession-errors I get these:
when inserting cd:
libhal.c 911 : Error sending msg: No property info.category on device with id /org/freedesktop/Hal/devices/ide_1_1

when clicking the cd-icon:
Launched ok, pid = 2380
sh: line 1: pmount: command not found
QWidget: Cannot create a QWidget when no GUI is being used
kioslave: ####### CRASH ###### protocol = media pid = 2381 signal = 11
kio (KIOConnection): ERROR: Header read failed, errno=104
kio (KIOConnection): ERROR: Header has invalid size (-1)
when closing konqueror media://hdd
kio (KDirWatch): WARNING: KDirWatch::removeDir can't handle '/hdd'

I'm using hal 0.4.5 and dbus 0.23

any suggestions/help?
Comment 10 Kevin Ottens 2005-04-02 14:46:14 UTC
I still can't reproduce this one... It really seems to be linked to
pmount being available or not. Please try to install it, and then uninstall it.
If it works when pmount is here, but crash when it's not here, I'll prepare
a patch for you so that I can have more debug output.

I'm waiting news from you and your aknowledge to reopen it...

Comment 11 Ruben Jenster 2005-04-02 15:30:48 UTC
I made a new clean install on my laptop:
with pmount it works 
without pmount it doesn't work [ same behaviour as before ] 

Nothing has changed. I have tried all version of hal and dbus everytime the same behaviour.

Regards 

Ruben
Comment 12 Mathijs Kwik 2005-04-02 16:36:37 UTC
And I installed pmount but the problem is still there.
Like I already said, the problem is not about mounting, the mounting itself works with pmount, fstab-sync, and with a static entry in fstab.
in all 3 cases the cd appears on my desktop when it gets inserted.
when I click it, it gets mounted, but the media:// protocol dies.
when I click it again, the same happens.
The medium gets mounted and is accessible through file://media
So I'm pretty sure the problem lies in the media-protocol-handler itself, rather than in the mount-method.

I will rebuild parts of kde with debug-output now so I'll post the messages soon.
Comment 13 Mathijs Kwik 2005-04-03 18:11:47 UTC
Here I have some debug output.
Like I said before, the problem seems not to be mount-related. I've tried pmount, fstab-sync and just a plain entry in fstab... in all cases the behaviour is the same. on inserting a cd, the icon appears. when I click it, it mounts ok, but then the media kioslave dies.

I hope this helps:

kded: HALBackend::hal_property_modified /org/freedesktop/Hal/devices/block_22_64 -- block.have_scanned
kded: HALBackend::hal_device_added /org/freedesktop/Hal/devices/block_KNOPPIX
kded: MediaList::findById(/org/freedesktop/Hal/devices/block_KNOPPIX)
kded: HALBackend::setVolumeProperties for /org/freedesktop/Hal/devices/block_KNOPPIX
libhal.c 911 : Error sending msg: No property info.category on device with id /org/freedesktop/Hal/devices/ide_1_1
kded: MediaList::addMedium(@/org/freedesktop/Hal/devices/block_KNOPPIX)
kded: MediaList emits mediumAdded(/org/freedesktop/Hal/devices/block_KNOPPIX, hdd)
kded: MediaManager::slotMediumAdded: hdd
kded: MediaDirNotify::toMediaURL(media:/)
kded: MediaList::list()
kded: KURL()
kded: RemoteDirNotify::FilesAdded
kded: RemoteDirNotify::toRemoteURL(media:/)
kded: result => KURL()
kio (KDirListerCache): [virtual void KDirListerCache::FilesAdded(const KURL&)] media:/
kio (KDirListerCache): [void KDirListerCache::updateDirectory(const KURL&)] media:/
kio (KDirListerCache): [void KDirListerCache::updateDirectory(const KURL&)] Killed = false
kio (KDirListerCache): [void KDirListerCache::updateDirectory(const KURL&)] update started in media:/
kio_media: MediaProtocol::listDir: media:/
kio_media: MediaImpl::listMedia
kded: MediaList::list()
kio_media: MediaProtocol::createMedium
kio_media: url = media:/hda1, mime = media/hdd_unmounted
kio_media: MediaProtocol::createMedium
kio_media: url = media:/hdc3, mime = media/hdd_mounted
kio (KIOJob): stat file:///mnt/data
kio_file: FileProtocol::stat details=2
kio_media: MediaProtocol::createMedium
kio_media: url = media:/hdd, mime = media/cdwriter_unmounted
kio (KDirListerCache): [void KDirListerCache::slotUpdateResult(KIO::Job*)] finished update media:/
kio (KTrader): query for ThumbCreator : returning 7 offers
kio (KTrader): query for ThumbCreator : returning 7 offers
kio (KLauncher): KLauncher: Got start_service_by_desktop_path('/usr/kde/3.4/share/applications/kde/kfmclient_dir.desktop', ...)
kdeinit: Got EXT_EXEC 'kfmclient' from launcher.
Could not load library! Trying exec....
kio (KLauncher): kfmclient (pid 2152) up and running.
DCOP: register 'anonymous-2152' -> number of clients is now 10
kio (KSycoca): Trying to open ksycoca from /tmp/kdecache-troxx/ksycoca
kio (KTrader): query for inode/directory, KParts/ReadOnlyPart : returning 8 offers
kdeinit: Got SHELL 'konqueror' from socket.
DCOP: unregister 'anonymous-2152'
kdeinit: PID 2152 terminated.
Could not load library! Trying exec....
kdeinit: PID 2154 terminated.
DCOP: register 'konqueror-2155' -> number of clients is now 10
Launched ok, pid = 2155
kio (KSycoca): Trying to open ksycoca from /tmp/kdecache-troxx/ksycoca
kio (KTrader): query for KURIFilter/Plugin : returning 4 offers
kio (KTrader): query for Browser/View : returning 17 offers
kparts: MainWindow::createGUI, part=(nil)  
kio (KTrader): query for Browser/View, KParts/ReadOnlyPart : returning 17 offers
kdeui (KDockWidget): : KDockWidget::setHeader
kdeui (KDockWidget): KDockWidgetHeader::showUndockButton(true)
kdeui (KDockWidget): KDockWidgetHeader::showUndockButton(false)
kio (KTrader): query for inode/directory, Application : returning 0 offers
kio (KTrader): query for inode/directory, KParts/ReadOnlyPart : returning 8 offers
kparts: found KParts Plugin : /usr/kde/3.4/share/apps/konqiconview/kpartplugins/kremoteencodingplugin.rc
kparts: found KParts Plugin : /usr/kde/3.4/share/apps/konqiconview/kpartplugins/kshellcmdplugin.rc
kparts: load plugin 
kparts: load plugin 
kio (KTrader): query for ThumbCreator : returning 7 offers
kio (KDirLister): +KDirLister
kio (KDirListerCache): +KDirListerCache
kio (KDirWatch): Available methods: Stat, FAM, DNotify
kparts: 0x8101c88 emitting activePartChanged 0x823ad18
kparts: MainWindow::createGUI, part=0x823ad18 KonqKfmIconView 
kio (KDirLister): [virtual bool KDirLister::openURL(const KURL&, bool, bool)] media:/hdd keep=false reload=false
kio (KDirListerCache): [void KDirListerCache::listDir(KDirLister*, const KURL&, bool, bool)] 0x8275398 url=media:/hdd keep=false reload=false
kio (KDirListerCache): [void KDirListerCache::stop(KDirLister*)] lister: 0x8275398
kio (KDirListerCache): [void KDirListerCache::forgetDirs(KDirLister*)] 0x8275398
kio (KTrader): query for ThumbCreator : returning 7 offers
kio (KTrader): query for ThumbCreator : returning 7 offers
kio (KDirListerCache): listDir: Entry not in cache or reloaded: media:/hdd
konqueror: KMultiTabBarTab::updateState(): setting text to an empty QString***************
konqueror: KMultiTabBarTab::updateState(): setting text to an empty QString***************
konqueror: KMultiTabBarTab::updateState(): setting text to an empty QString***************
konqueror: KMultiTabBarTab::updateState(): setting text to an empty QString***************
konqueror: KMultiTabBarTab::updateState(): setting text to an empty QString***************
konqueror: KMultiTabBarTab::updateState(): setting text to an empty QString***************
kdeui (KDockWidget): : KDockWidget::setHeader
kdeui (KDockWidget): KDockWidgetHeader::showUndockButton(true)
kio (KDirLister): +KDirLister
kio (KDirLister): [virtual bool KDirLister::openURL(const KURL&, bool, bool)] file:///home/troxx keep=true reload=false
kio (KDirListerCache): [void KDirListerCache::listDir(KDirLister*, const KURL&, bool, bool)] 0x82c4a88 url=file:///home/troxx keep=true reload=false
kio (KDirListerCache): listDir: Entry not in cache or reloaded: file:///home/troxx
kio (KDirWatch): Added Dir /home/troxx [KDirWatch-1]
kio (KDirWatch):  Setup FAM (Req 1) for /home/troxx
kdeui (KDockWidget): KDockWidgetHeader::showUndockButton(false)
kdeinit: Got EXEC_NEW 'kio_media' from launcher.
DCOP: register 'kio_media-2156' -> number of clients is now 11
DCOP: unregister 'kio_media-2156'
DCOP: register 'anonymous-2156' -> number of clients is now 11
kio (KLauncher): kio_media (pid 2156) up and running.
kio_file: ========= LIST file:///home/troxx =========
kio_file: ============= COMPLETED LIST ============
kio_file: =============== BYE ===========
kio (KSycoca): Trying to open ksycoca from /tmp/kdecache-troxx/ksycoca
kio_media: MediaProtocol::listDir: media:/hdd
kio_media: ForwardingSlaveBase::listDir: media:/hdd
kded: MediaList::findByName(hdd)
kio (KIOJob): Starting kio_uiserver
kio (KLauncher): KLauncher: Got start_service_by_desktop_path('kio_uiserver.desktop', ...)
kdeinit: Got EXT_EXEC 'kio_uiserver' from launcher.
Could not load library! Trying exec....
kio (KLauncher): kio_uiserver (pid 2157) up and running.
kio (KDirListerCache): [void KDirListerCache::slotEntries(KIO::Job*, const KIO::UDSEntryList&)] new entries for file:///home/troxx
kio: KSambaShare: Could not found smb.conf!
kio: KNFSShare: Could not found exports file!
DCOP: register 'kio_uiserver' -> number of clients is now 12
kio (KIOJob): startServiceByDesktopPath returned 0
kio (KIOJob): kio_uiserver registered
DCOP: register 'anonymous-2157' -> number of clients is now 13
kio (KDirListerCache): [void KDirListerCache::slotResult(KIO::Job*)] finished listing file:///home/troxx
DCOP: new daemon kio_uiserver
DCOP: unregister 'anonymous-2157'
kdeinit: PID 2157 terminated.
kio (UIServer): UIServer::newJob observerAppId=anonymous-2156. Giving id=1
kdeinit: Got EXEC_NEW 'kio_file' from launcher.
kio_file: Starting 2159
kio (KLauncher): kio_file (pid 2159) up and running.
kio_file: MOUNTING fstype= dev=/dev/hdd point= ro=false
sh: line 1: pmount: command not found
kio_file: FileProtocol::mount _fstype=
kio_file: /bin/mount '/dev/hdd' 2>/tmp/kde-troxx/kio_fileP0oIRb.tmp
kio (UIServer): UIServer::mounting 1 /dev/hdd 
kio_file: mount got a warning: mount: block device /dev/hdd is write-protected, mounting read-only
kio_file: 
QWidget: Cannot create a QWidget when no GUI is being used
kioslave: ####### CRASH ###### protocol = media pid = 2156 signal = 11
/usr/kde/3.4/lib/libkio.so.4(_ZN3KIO9SlaveBase15sigsegv_handlerEi+0xe3)[0x44134dd3]
/usr/qt/3/lib/libqt-mt.so.3(_ZN7QWidgetC2EPS_PKcj+0x14f)[0x43594cbf]
/usr/qt/3/lib/libqt-mt.so.3(_ZN7QDialogC2EP7QWidgetPKcbj+0x45)[0x436f06e5]
/usr/kde/3.4/lib/libkdeui.so.4(_ZN7KDialogC2EP7QWidgetPKcbj+0x43)[0x43e82893]
DCOP: unregister 'anonymous-2156'
kio (Slave): slave died pid = 2156
kio (KDirListerCache): [void KDirListerCache::slotResult(KIO::Job*)] finished listing media:/hdd
kdeinit: PID 2156 terminated.
kio (KIOConnection): ERROR: Header read failed, errno=104
kio (KIOConnection): ERROR: Header has invalid size (-1)
Comment 14 Kevin Ottens 2005-04-04 12:33:54 UTC
Ok! I'm now able to reproduce it. Thanks a lot for the input.

I'm now working on it.
Comment 15 Kevin Ottens 2005-04-04 12:57:42 UTC
CVS commit by ervin: 

Add the ability to disable message box use from Jobs, because the can
be used with a KApplication with gui disabled (and then make it crash).

CCBUGS:102086


  M +18 -3     job.cpp   1.436
  M +19 -0     jobclasses.h   1.159


--- kdelibs/kio/kio/job.cpp  #1.435:1.436
@@ -82,9 +82,10 @@ class Job::JobPrivate
 {
 public:
-    JobPrivate() : m_autoErrorHandling( false ), m_parentJob( 0L ), m_extraFlags(0),
+    JobPrivate() : m_autoErrorHandling( false ), m_interactive( true ), m_parentJob( 0L ), m_extraFlags(0),
                    m_processedSize(0)
                    {}
 
     bool m_autoErrorHandling;
+    bool m_interactive;
     QGuardedPtr<QWidget> m_errorParentWidget;
     // Maybe we could use the QObject parent/child mechanism instead
@@ -312,4 +313,14 @@ bool Job::isAutoErrorHandlingEnabled() c
 }
 
+void Job::setInteractive(bool enable)
+{
+  d->m_interactive = enable;
+}
+
+bool Job::isInteractive() const
+{
+  return d->m_interactive;
+}
+
 void Job::setWindow(QWidget *window)
 {
@@ -554,4 +565,6 @@ void SimpleJob::slotError( int error, co
 void SimpleJob::slotWarning( const QString & errorText )
 {
+    if (!isInteractive()) return;
+
     static uint msgBoxDisplayed = 0;
     if ( msgBoxDisplayed == 0 ) // don't bomb the user with message boxes, only one at a time
@@ -2599,4 +2612,5 @@ void CopyJob::statCurrentSrc()
         if (m_mode == Move && !KProtocolInfo::supportsDeleting(m_currentSrcURL)) {
             QGuardedPtr<CopyJob> that = this;
+            if (isInteractive())
             KMessageBox::information( 0, buildErrorString(ERR_CANNOT_DELETE, m_currentSrcURL.prettyURL()));
             if (that)
@@ -3917,4 +3931,5 @@ void DeleteJob::statNextSrc()
             QGuardedPtr<DeleteJob> that = this;
             ++m_currentStat;
+            if (isInteractive())
             KMessageBox::information( 0, buildErrorString(ERR_CANNOT_DELETE, m_currentURL.prettyURL()));
             if (that)

--- kdelibs/kio/kio/jobclasses.h  #1.158:1.159
@@ -179,4 +179,21 @@ namespace KIO {
 
         /**
+         * Enable or disable the message display from the job.
+         *
+         * The default is true.
+         * @param enable enable or disable message display
+         * @since 3.4.1
+         */
+        void setInteractive(bool enable);
+        
+        /**
+         * Returns whether message display is enabled or disabled.
+         * See also setInteractive .
+         * @return true if message display is enabled
+         * @see setInteractive()
+         * @since 3.4.1
+         */
+        bool isInteractive() const;
+        /**
          * Associate this job with a window given by @p window.
          * @param window the window to associate to
@@ -1487,4 +1504,6 @@ namespace KIO {
          * If the program doesn't want CopyJob to show dialogs, but to simply fail on error,
          * call setInteractive( false ).
+         *
+         * KDE4: remove, already in Job
          * @since 3.4
          */
Comment 16 Kevin Ottens 2005-04-04 12:59:40 UTC
CVS commit by ervin: 

Add the ability to disable message box use from Jobs, because the can
be used with a KApplication with gui disabled (and then make it crash).

Backporting to 3.4.x branch.

CCBUGS:102086


  M +18 -3     job.cpp   1.431.2.3
  M +19 -0     jobclasses.h   1.153.2.3


--- kdelibs/kio/kio/job.cpp  #1.431.2.2:1.431.2.3
@@ -82,9 +82,10 @@ class Job::JobPrivate
 {
 public:
-    JobPrivate() : m_autoErrorHandling( false ), m_parentJob( 0L ), m_extraFlags(0),
+    JobPrivate() : m_autoErrorHandling( false ), m_interactive( true ), m_parentJob( 0L ), m_extraFlags(0),
                    m_processedSize(0)
                    {}
 
     bool m_autoErrorHandling;
+    bool m_interactive;
     QGuardedPtr<QWidget> m_errorParentWidget;
     // Maybe we could use the QObject parent/child mechanism instead
@@ -312,4 +313,14 @@ bool Job::isAutoErrorHandlingEnabled() c
 }
 
+void Job::setInteractive(bool enable)
+{
+  d->m_interactive = enable;
+}
+
+bool Job::isInteractive() const
+{
+  return d->m_interactive;
+}
+
 void Job::setWindow(QWidget *window)
 {
@@ -550,4 +561,6 @@ void SimpleJob::slotError( int error, co
 void SimpleJob::slotWarning( const QString & errorText )
 {
+    if (!isInteractive()) return;
+
     static uint msgBoxDisplayed = 0;
     if ( msgBoxDisplayed == 0 ) // don't bomb the user with message boxes, only one at a time
@@ -2593,4 +2606,5 @@ void CopyJob::statCurrentSrc()
         if (m_mode == Move && !KProtocolInfo::supportsDeleting(m_currentSrcURL)) {
             QGuardedPtr<CopyJob> that = this;
+            if (isInteractive())
             KMessageBox::information( 0, buildErrorString(ERR_CANNOT_DELETE, m_currentSrcURL.prettyURL()));
             if (that)
@@ -3911,4 +3925,5 @@ void DeleteJob::statNextSrc()
             QGuardedPtr<DeleteJob> that = this;
             ++m_currentStat;
+            if (isInteractive())
             KMessageBox::information( 0, buildErrorString(ERR_CANNOT_DELETE, m_currentURL.prettyURL()));
             if (that)

--- kdelibs/kio/kio/jobclasses.h  #1.153.2.2:1.153.2.3
@@ -179,4 +179,21 @@ namespace KIO {
 
         /**
+         * Enable or disable the message display from the job.
+         *
+         * The default is true.
+         * @param enable enable or disable message display
+         * @since 3.4.1
+         */
+        void setInteractive(bool enable);
+        
+        /**
+         * Returns whether message display is enabled or disabled.
+         * See also setInteractive .
+         * @return true if message display is enabled
+         * @see setInteractive()
+         * @since 3.4.1
+         */
+        bool isInteractive() const;
+        /**
          * Associate this job with a window given by @p window.
          * @param window the window to associate to
@@ -1487,4 +1504,6 @@ namespace KIO {
          * If the program doesn't want CopyJob to show dialogs, but to simply fail on error,
          * call setInteractive( false ).
+         *
+         * KDE4: remove, already in Job
          * @since 3.4
          */
Comment 17 Kevin Ottens 2005-04-04 13:01:37 UTC
CVS commit by ervin: 

Avoid displaying messagebox while mounting. If mount issues a warning it
makes the ioslave crash (since it is a KApplication with nogui)

CCBUGS:102086


  M +1 -0      mediaimpl.cpp   1.8


--- kdebase/kioslave/media/mediaimpl.cpp  #1.7:1.8
@@ -230,4 +230,5 @@ bool MediaImpl::ensureMediumMounted(Medi
                                            medium.deviceNode(),
                                            medium.mountPoint());
+                job->setInteractive(false);
                 connect( job, SIGNAL( result( KIO::Job * ) ),
                          this, SLOT( slotMountResult( KIO::Job * ) ) );
Comment 18 Kevin Ottens 2005-04-04 13:04:09 UTC
CVS commit by ervin: 

Avoid displaying messagebox while mounting. If mount issues a warning it
makes the ioslave crash (since it is a KApplication with nogui)

Backporting to 3.4.x branch.

BUGS:102086


  M +1 -0      mediaimpl.cpp   1.7.2.1


--- kdebase/kioslave/media/mediaimpl.cpp  #1.7:1.7.2.1
@@ -230,4 +230,5 @@ bool MediaImpl::ensureMediumMounted(Medi
                                            medium.deviceNode(),
                                            medium.mountPoint());
+                job->setInteractive(false);
                 connect( job, SIGNAL( result( KIO::Job * ) ),
                          this, SLOT( slotMountResult( KIO::Job * ) ) );
Comment 19 Mathijs Kwik 2005-04-04 16:31:13 UTC
Thanks for the effort, but it doesn't work.
The problem is not in the dialog box I think.
Before applying your patch, I did (sometimes) see the boxes with mount's output.
After applying the patch, I don't see them anymore.
The crash is also gone, which is good.
But now the device gets mounted (fstab-sync, pmount, static-fstab all the same) and the media-kioslave doesn't report back to konqueror. so the K-Gear-thingy keeps on spinning, like on a slow website. so the mounting works (it already did before the patch) but it still doesn't display anything.

output:
kded: HALBackend::hal_property_modified /org/freedesktop/Hal/devices/block_22_64 -- block.have_scanned
kded: HALBackend::hal_device_added /org/freedesktop/Hal/devices/block_KNOPPIX
kded: MediaList::findById(/org/freedesktop/Hal/devices/block_KNOPPIX)
kded: HALBackend::setVolumeProperties for /org/freedesktop/Hal/devices/block_KNOPPIX
libhal.c 911 : Error sending msg: No property info.category on device with id /org/freedesktop/Hal/devices/ide_1_1
kded: MediaList::addMedium(@/org/freedesktop/Hal/devices/block_KNOPPIX)
kded: MediaList emits mediumAdded(/org/freedesktop/Hal/devices/block_KNOPPIX, hdd)
kded: MediaManager::slotMediumAdded: hdd
kded: MediaDirNotify::toMediaURL(media:/)
kded: MediaList::list()
kded: KURL()
kded: RemoteDirNotify::FilesAdded
kded: RemoteDirNotify::toRemoteURL(media:/)
kded: result => KURL()
kio_media: MediaProtocol::listDir: media:/
kio_media: MediaImpl::listMedia
kded: MediaList::list()
kio_media: MediaProtocol::createMedium
kio_media: url = media:/hda1, mime = media/hdd_unmounted
kio_media: MediaProtocol::createMedium
kio_media: url = media:/hdc3, mime = media/hdd_mounted
kio (KIOJob): stat file:///mnt/data
kio_file: FileProtocol::stat details=2
kio_media: MediaProtocol::createMedium
kio_media: url = media:/hdd, mime = media/cdwriter_unmounted
kded: MediaList::findByName(hdd)
kio (KLauncher): KLauncher: Got start_service_by_desktop_path('/usr/kde/3.4/share/applications/kde/kfmclient_dir.desktop', ...)
kdeinit: Got EXT_EXEC 'kfmclient' from launcher.
Could not load library! Trying exec....
kio (KLauncher): kfmclient (pid 11380) up and running.
kio (KSycoca): Trying to open ksycoca from /tmp/kdecache-troxx/ksycoca
kio (KTrader): query for inode/directory, KParts/ReadOnlyPart : returning 8 offers
kdeinit: Got SHELL 'konqueror' from socket.
Could not load library! Trying exec....
kdeinit: PID 11382 terminated.
Launched ok, pid = 11383
kdeinit: PID 11380 terminated.
kio (KSycoca): Trying to open ksycoca from /tmp/kdecache-troxx/ksycoca
kio (KTrader): query for KURIFilter/Plugin : returning 4 offers
kio (KTrader): query for Browser/View : returning 19 offers
kparts: MainWindow::createGUI, part=(nil)
kio (KTrader): query for Browser/View, Application : returning 2 offers
kio (KTrader): query for Browser/View, KParts/ReadOnlyPart : returning 19 offers
kdeui (KDockWidget): : KDockWidget::setHeader
kdeui (KDockWidget): KDockWidgetHeader::showUndockButton(true)
kdeui (KDockWidget): KDockWidgetHeader::showUndockButton(false)
kio (KTrader): query for inode/directory, Application : returning 0 offers
kio (KTrader): query for inode/directory, KParts/ReadOnlyPart : returning 8 offers
kparts: found KParts Plugin : /usr/kde/3.4/share/apps/konqiconview/kpartplugins/kremoteencodingplugin.rc
kparts: found KParts Plugin : /usr/kde/3.4/share/apps/konqiconview/kpartplugins/kshellcmdplugin.rc
kparts: load plugin
kparts: load plugin
kio (KTrader): query for ThumbCreator : returning 8 offers
kio (KDirLister): +KDirLister
kio (KDirListerCache): +KDirListerCache
kio (KDirWatch): Available methods: Stat, FAM, DNotify
kparts: 0x8102cd8 emitting activePartChanged 0x82a96a0
kparts: MainWindow::createGUI, part=0x82a96a0 KonqKfmIconView
kio (KDirLister): [virtual bool KDirLister::openURL(const KURL&, bool, bool)] media:/hdd keep=false reload=false
kio (KDirListerCache): [void KDirListerCache::listDir(KDirLister*, const KURL&, bool, bool)] 0x82e4d18 url=media:/hdd keep=false reload=false
kio (KDirListerCache): [void KDirListerCache::stop(KDirLister*)] lister: 0x82e4d18
kio (KDirListerCache): [void KDirListerCache::forgetDirs(KDirLister*)] 0x82e4d18
kio (KTrader): query for ThumbCreator : returning 8 offers
kio (KTrader): query for ThumbCreator : returning 8 offers
kio (KDirListerCache): listDir: Entry not in cache or reloaded: media:/hdd
konqueror: KMultiTabBarTab::updateState(): setting text to an empty QString***************
konqueror: KMultiTabBarTab::updateState(): setting text to an empty QString***************
konqueror: KMultiTabBarTab::updateState(): setting text to an empty QString***************
konqueror: KMultiTabBarTab::updateState(): setting text to an empty QString***************
konqueror: KMultiTabBarTab::updateState(): setting text to an empty QString***************
konqueror: KMultiTabBarTab::updateState(): setting text to an empty QString***************
kdeinit: Got EXEC_NEW 'kio_media' from launcher.
kio (KLauncher): kio_media (pid 11384) up and running.
kio (KSycoca): Trying to open ksycoca from /tmp/kdecache-troxx/ksycoca
kio_media: MediaProtocol::listDir: media:/hdd
kio_media: ForwardingSlaveBase::listDir: media:/hdd
kded: MediaList::findByName(hdd)
kio (KIOJob): kio_uiserver registered
kdeinit: Got EXEC_NEW 'kio_file' from launcher.
kio (KLauncher): kio_file (pid 11385) up and running.
kio_file: Starting 11385
kio_file: MOUNTING fstype= dev=/dev/hdd point= ro=false
sh: line 1: pmount: command not found
kio_file: FileProtocol::mount _fstype=
kio_file: /bin/mount '/dev/hdd' 2>/tmp/kde-troxx/kio_filepqK8Xa.tmp
kio_file: mount got a warning: mount: block device /dev/hdd is write-protected, mounting read-only
kio_file:
kio_media: MediaImpl::slotMountResult
Comment 20 Mathijs Kwik 2005-04-04 16:52:50 UTC
I did some more research and found this:
when the device is unmounted, it gets mounted by clicking it.
nothing is displayed though (like I said above) and media:/ still shows a unmounted cdrecorder.

if I restart hald (but leave kded running) media:/ gets updated and shows a mounted cdrecorder, clicking it works as expected. (maybe even without your patch, i'll check that later)
now, when I unmount the device (through right-clicking menu), the device gets unmounted (according to mtab), but media:/ still shows it as mounted and lets me access it but errors out when I open folders that weren't cached.

so... what I think is there's a problem between kded's hal-backend and hald.
I'm gonna build hald with debug info to see if the problem is with hal or with kded's backend.

I'll post results if I find them.
Comment 21 Kevin Ottens 2005-04-04 19:30:44 UTC
I can't reproduce the new behavior you describe. I guess it's related
to something in HAL. Please carefully check where to report the resulting
bug.

But, if you choose to report it against media:/ and not HAL, please open
a new bugreport since it's clearly a different issue than the one described
in the current bugreport.

Before it crashed because of the message box... so now _this_ issue is really
fixed.

Regards.
Comment 22 Mathijs Kwik 2005-04-04 21:16:41 UTC
I found the problem,
sorry for bugging here.
I disabled DNotify in my kernel in favor of Inotify. Since FAM doesn't handle this, I installed gamin which is fam-compatible, which works well.
But now it seems kde does not only use fam, but also talks to dnotify by itself(on gentoo), which caused the problem.
Comment 23 Ruben Jenster 2005-04-28 14:58:33 UTC
I want to add that my kernel also missed dnotify support after adding it everything is running fine.

Regards 

Ruben