Bug 158073 - [FreeBSD] KMountPoint doesn't get mount options for devices not in /etc/fstab
Summary: [FreeBSD] KMountPoint doesn't get mount options for devices not in /etc/fstab
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: git master
Platform: FreeBSD Ports FreeBSD
: NOR wishlist
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-19 23:13 UTC by Pawel Pekala
Modified: 2021-07-26 21:42 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.85


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Pekala 2008-02-19 23:13:25 UTC
Version:            (using KDE 3.5.8)
Installed from:    FreeBSD Ports
Compiler:          gcc version 3.4.6 [FreeBSD] 20060305  
OS:                FreeBSD

Any Kde app doing (Ksqiurrel in my case):

KMountPoint::currentMountPoints(KMountPoint::NeedMountOptions)

will crash when there is mounted device not listed in fstab (mounted manually 
or by hal for example).

Backtrace:

#0  0x28bec9ba in KMountPoint::currentMountPoints (infoNeeded=3) at kmountpoint.cpp:252
#1  0x08128e6e in SQ_MountView::reload (this=0x8564b00, current=true) at sq_mountview.cpp:105
#2  0x08129543 in SQ_MountView::slotRefresh (this=0x8564b00) at sq_mountview.cpp:243
#3  0x08129679 in SQ_MountView::setColumns (this=0x8564b00, cols=0) at sq_mountview.cpp:178
#4  0x081298d3 in SQ_MountView::setupColumns (this=0x8564b00) at sq_mountview.cpp:195
#5  0x08129d1d in SQ_MountView (this=0x8564b00, parent=0x0, name=0x0) at sq_mountview.cpp:66
#6  0x080f01ed in KSquirrel::eventFilter (this=0x81db800, o=0x8336800, e=0x0) at ksquirrel.cpp:250
#7  0x29070e70 in QObject::activate_filters (this=0x8336800, e=0xbfbfe370) at kernel/qobject.cpp:903
#8  0x29070f36 in QObject::event (this=0x8336800, e=0xbfbfe370) at kernel/qobject.cpp:735
#9  0x290a61f2 in QWidget::event (this=0x8336800, e=0xbfbfe370) at kernel/qwidget.cpp:4659
#10 0x29017375 in QApplication::internalNotify (this=0x0, receiver=0x8336800, e=0xbfbfe370)
    at kernel/qapplication.cpp:2636
#11 0x2901750a in QApplication::notify (this=0xbfbfe760, receiver=0x8336800, e=0xbfbfe370)
    at kernel/qapplication.cpp:2524
#12 0x28ae7d6a in KApplication::notify (this=0xbfbfe760, receiver=0x8336800, event=0xbfbfe370)
    at kapplication.cpp:550
#13 0x290a40f2 in QWidget::show (this=0x8336800) at qapplication.h:496
#14 0x290a3d95 in QWidget::showChildren (this=0x0, spontaneous=false) at kernel/qwidget.cpp:4125
#15 0x290a3f3a in QWidget::show (this=0x81db800) at kernel/qwidget.cpp:3984
#16 0x2915b499 in QMainWindow::show (this=0x81db800) at widgets/qmainwindow.cpp:1507
#17 0x288fd25a in KMainWindow::show (this=0x81db800) at kmainwindow.cpp:383
#18 0x080f9b30 in KSquirrel::continueLoading (this=0x81db800) at ksquirrel.cpp:1398
#19 0x080f9fe5 in KSquirrel::preCreate (this=0x81db800) at ksquirrel.cpp:1309
#20 0x080faf1c in KSquirrel (this=0x81db800, parent=0x0, name=0x82408c0 "č#\027\bŔ\b$\b")
    at ksquirrel.cpp:163
#21 0x080fd5d1 in main (argc=1, argv=0xbfbfe900) at qcstring.h:291

This happends due to null pointer dereference here:

      if (infoNeeded & NeedMountOptions)
      {
         struct fstab *ft = getfsfile(mounted[i].f_mntonname);
         QString options = QFile::decodeName(ft->fs_mntops);
         mp->m_mountOptions = QStringList::split(',', options);
      }

ft will be null for devices not listed in /etc/fstab.
Comment 1 Dario Andres 2008-12-20 03:29:14 UTC
Have you experienced this bug with an updated KDE version? Thanks :) 
Comment 2 Pawel Pekala 2008-12-23 11:36:34 UTC
(In reply to comment #1)
> Have you experienced this bug with an updated KDE version? Thanks :) 
> 

I`m using 3.5.10 right now and it still happends. Ksqiurrel launches fine when
there no external devices mounted, after I plug-in my pendrive ksquirrel will 
crash as described earlier - same backtrace.
Comment 3 Christoph Feck 2009-04-11 14:10:41 UTC
The same bug is also present in KDE 4.

currentMountPoints() incorrectly uses /etc/fstab instead of /etc/mtab.
See kmountpoint.cpp, line 310 in r952145.
Comment 4 Christoph Feck 2009-06-01 19:05:21 UTC
SVN commit 976429 by cfeck:

Do not dereference null fstab entry

CCBUG: 158073
CCMAIL: faure@kde.org


 M  +6 -2      kmountpoint.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=976429
Comment 5 Christoph Feck 2009-06-01 19:09:36 UTC
Comment #4 fixes the crash, changing description and severity.
Comment 6 Andrew Crouthamel 2018-11-02 22:55:06 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 7 Andrew Crouthamel 2018-11-16 02:38:23 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version?

Thank you for helping us make KDE software even better for everyone!
Comment 8 Ahmad Samir 2021-05-29 00:02:34 UTC
Currently the code in kmountpoint:
        if (infoNeeded & NeedMountOptions) {
            struct fstab *ft = getfsfile(mounted[i].f_mntonname);
            if (ft != nullptr) {
                QString options = QFile::decodeName(ft->fs_mntops);
                mp->d->m_mountOptions = options.split(QLatin1Char(','));
            } else {
                // TODO: get mount options if not mounted via fstab, see mounted[i].f_flags
            }
        }

so, it would need a FreeBSD dev to implement that.