Bug 390288 - KIO/KDirModel: Kate crash while trying to save a new file to a Samba share
Summary: KIO/KDirModel: Kate crash while trying to save a new file to a Samba share
Status: RESOLVED WORKSFORME
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Neon Linux
: VHI crash
Target Milestone: ---
Assignee: David Faure
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2018-02-11 20:34 UTC by Valdo
Modified: 2022-10-09 20:09 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
New crash information added by DrKonqi (12.54 KB, text/plain)
2018-05-12 17:07 UTC, Tony
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Valdo 2018-02-11 20:34:39 UTC
Application: kate (17.12.2)

Qt Version: 5.9.3
Frameworks Version: 5.43.0
Operating System: Linux 4.13.0-32-generic x86_64
Distribution: KDE neon LTS User Edition 5.12

-- Information about the crash:
- What I was doing when the application crashed:
 I had created a new text file and was about to save it to a Samba share hosted on another  machine of mine (running Linux Mint 18.x).

-- Backtrace:
Application: Kate (kate), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fcf6183d900 (LWP 2425))]

Thread 2 (Thread 0x7fcf40971700 (LWP 2427)):
#0  0x00007fcf5bf3974d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fcf5642038c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fcf5642049c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fcf5cb696cb in QEventDispatcherGlib::processEvents (this=0x7fcf3c0008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#4  0x00007fcf5cb11e2a in QEventLoop::exec (this=this@entry=0x7fcf40970c90, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#5  0x00007fcf5c93a8f4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:515
#6  0x00007fcf5cfe8315 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#7  0x00007fcf5c93f709 in QThreadPrivate::start (arg=0x7fcf5d25cd40) at thread/qthread_unix.cpp:368
#8  0x00007fcf580936ba in start_thread (arg=0x7fcf40971700) at pthread_create.c:333
#9  0x00007fcf5bf4541d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7fcf6183d900 (LWP 2425)):
[KCrash Handler]
#6  KDirModelNode::rowNumber (this=0x0) at /workspace/build/src/widgets/kdirmodel.cpp:168
#7  KDirModelPrivate::indexForNode (this=0x2eae8f0, node=0x0, rowNumber=-1) at /workspace/build/src/widgets/kdirmodel.cpp:349
#8  0x00007fcf60cb9ffa in KDirModelPrivate::_k_slotNewItems (this=<optimized out>, directoryUrl=..., items=...) at /workspace/build/src/widgets/kdirmodel.cpp:446
#9  0x00007fcf5cb40279 in QMetaObject::activate (sender=0x2ed6340, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=10, argv=argv@entry=0x7ffff329a4e0) at kernel/qobject.cpp:3766
#10 0x00007fcf5cb40b87 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7fcf60bc7760 <KCoreDirLister::staticMetaObject>, local_signal_index=local_signal_index@entry=10, argv=argv@entry=0x7ffff329a4e0) at kernel/qobject.cpp:3628
#11 0x00007fcf609500ba in KCoreDirLister::itemsAdded (this=<optimized out>, _t1=..., _t2=...) at /workspace/build/obj-x86_64-linux-gnu/src/core/moc_kcoredirlister.cpp:542
#12 0x00007fcf6095335b in KCoreDirLister::Private::emitItems (this=0x2ac3700) at /workspace/build/src/core/kcoredirlister.cpp:2576
#13 0x00007fcf609625e3 in KCoreDirListerCache::slotEntries (this=<optimized out>, job=<optimized out>, entries=...) at /workspace/build/src/core/kcoredirlister.cpp:1284
#14 0x00007fcf60964000 in KCoreDirListerCache::qt_static_metacall (_o=0x7fcf60bcb1a0 <(anonymous namespace)::Q_QGS_kDirListerCache::innerFunction()::holder>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /workspace/build/obj-x86_64-linux-gnu/src/core/moc_kcoredirlister_p.cpp:135
#15 0x00007fcf5cb40279 in QMetaObject::activate (sender=sender@entry=0x2fa5540, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffff329a850) at kernel/qobject.cpp:3766
#16 0x00007fcf5cb40b87 in QMetaObject::activate (sender=sender@entry=0x2fa5540, m=m@entry=0x7fcf60bc5c40 <KIO::ListJob::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffff329a850) at kernel/qobject.cpp:3628
#17 0x00007fcf6090b0d4 in KIO::ListJob::entries (this=this@entry=0x2fa5540, _t1=_t1@entry=0x2fa5540, _t2=...) at /workspace/build/obj-x86_64-linux-gnu/src/core/moc_listjob.cpp:266
#18 0x00007fcf6090c5fa in KIO::ListJobPrivate::slotListEntries (this=<optimized out>, list=...) at /workspace/build/src/core/listjob.cpp:153
#19 0x00007fcf6090cc7d in KIO::ListJob::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /workspace/build/obj-x86_64-linux-gnu/src/core/moc_listjob.cpp:132
#20 0x00007fcf5cb40279 in QMetaObject::activate (sender=sender@entry=0x30834d0, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=6, argv=argv@entry=0x7ffff329aad0) at kernel/qobject.cpp:3766
#21 0x00007fcf5cb40b87 in QMetaObject::activate (sender=sender@entry=0x30834d0, m=m@entry=0x7fcf60bc5760 <KIO::SlaveInterface::staticMetaObject>, local_signal_index=local_signal_index@entry=6, argv=argv@entry=0x7ffff329aad0) at kernel/qobject.cpp:3628
#22 0x00007fcf608ec0e5 in KIO::SlaveInterface::listEntries (this=this@entry=0x30834d0, _t1=...) at /workspace/build/obj-x86_64-linux-gnu/src/core/moc_slaveinterface.cpp:451
#23 0x00007fcf608edf98 in KIO::SlaveInterface::dispatch (this=0x30834d0, _cmd=<optimized out>, rawdata=...) at /workspace/build/src/core/slaveinterface.cpp:177
#24 0x00007fcf608ec637 in KIO::SlaveInterface::dispatch (this=0x30834d0) at /workspace/build/src/core/slaveinterface.cpp:89
#25 0x00007fcf608f16f1 in KIO::Slave::gotInput (this=0x30834d0) at /workspace/build/src/core/slave.cpp:406
#26 0x00007fcf609803e5 in KIO::Slave::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /workspace/build/obj-x86_64-linux-gnu/src/core/moc_slave.cpp:89
#27 0x00007fcf5cb40279 in QMetaObject::activate (sender=0x2cd4f00, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3766
#28 0x00007fcf5cb412b9 in QObject::event (this=0x2cd4f00, e=<optimized out>) at kernel/qobject.cpp:1246
#29 0x00007fcf5dfcab9c in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x2cd4f00, e=0x3060960) at kernel/qapplication.cpp:3722
#30 0x00007fcf5dfd25a7 in QApplication::notify (this=0x7ffff329c140, receiver=0x2cd4f00, e=0x3060960) at kernel/qapplication.cpp:3481
#31 0x00007fcf5cb13df8 in QCoreApplication::notifyInternal2 (receiver=0x2cd4f00, event=event@entry=0x3060960) at kernel/qcoreapplication.cpp:1018
#32 0x00007fcf5cb165db in QCoreApplication::sendEvent (event=0x3060960, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:233
#33 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x2311710) at kernel/qcoreapplication.cpp:1678
#34 0x00007fcf5cb16a48 in QCoreApplication::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1532
#35 0x00007fcf5cb6a0a3 in postEventSourceDispatch (s=0x235fd90) at kernel/qeventdispatcher_glib.cpp:276
#36 0x00007fcf56420197 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#37 0x00007fcf564203f0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#38 0x00007fcf5642049c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#39 0x00007fcf5cb696af in QEventDispatcherGlib::processEvents (this=0x235e6d0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#40 0x00007fcf5cb11e2a in QEventLoop::exec (this=this@entry=0x7ffff329b340, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#41 0x00007fcf5e1b86c7 in QDialog::exec (this=0x2fad440) at dialogs/qdialog.cpp:545
#42 0x00007fcf5e1b85da in QDialog::exec (this=this@entry=0x7ffff329b480) at dialogs/qdialog.cpp:541
#43 0x00007fcf5e1cad65 in QFileDialog::getSaveFileUrl (parent=0x2765a80, caption=..., dir=..., filter=..., selectedFilter=selectedFilter@entry=0x0, options=..., supportedSchemes=...) at dialogs/qfiledialog.cpp:2418
#44 0x00007fcf612620c3 in KTextEditor::DocumentPrivate::documentSaveAs (this=0x2495ea0) at /workspace/build/src/document/katedocument.cpp:4310
#45 0x00007fcf61260ab7 in KTextEditor::DocumentPrivate::documentSave (this=0x2495ea0) at /workspace/build/src/document/katedocument.cpp:4301
#46 0x00007fcf613ed25f in KTextEditor::DocumentPrivate::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=0x7ffff329b740) at /workspace/build/obj-x86_64-linux-gnu/src/moc_katedocument.cpp:512
#47 0x00007fcf5cb40279 in QMetaObject::activate (sender=sender@entry=0x27b5120, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffff329b740) at kernel/qobject.cpp:3766
#48 0x00007fcf5cb40b87 in QMetaObject::activate (sender=sender@entry=0x27b5120, m=m@entry=0x7fcf5e69de00 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffff329b740) at kernel/qobject.cpp:3628
#49 0x00007fcf5dfc46a2 in QAction::triggered (this=this@entry=0x27b5120, _t1=false) at .moc/moc_qaction.cpp:370
#50 0x00007fcf5dfc6db0 in QAction::activate (this=0x27b5120, event=<optimized out>) at kernel/qaction.cpp:1165
#51 0x00007fcf5dfc7744 in QAction::event (this=<optimized out>, e=<optimized out>) at kernel/qaction.cpp:1091
#52 0x00007fcf5dfcab9c in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x27b5120, e=0x7ffff329ba00) at kernel/qapplication.cpp:3722
#53 0x00007fcf5dfd25a7 in QApplication::notify (this=0x7ffff329c140, receiver=0x27b5120, e=0x7ffff329ba00) at kernel/qapplication.cpp:3481
#54 0x00007fcf5cb13df8 in QCoreApplication::notifyInternal2 (receiver=0x27b5120, event=event@entry=0x7ffff329ba00) at kernel/qcoreapplication.cpp:1018
#55 0x00007fcf5d889b26 in QCoreApplication::sendEvent (event=0x7ffff329ba00, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:233
#56 QShortcutMap::dispatchEvent (this=this@entry=0x2311d58, e=e@entry=0x7ffff329bab0) at kernel/qshortcutmap.cpp:674
#57 0x00007fcf5d889bd9 in QShortcutMap::tryShortcut (this=this@entry=0x2311d58, e=e@entry=0x7ffff329bab0) at kernel/qshortcutmap.cpp:351
#58 0x00007fcf5d83b776 in QWindowSystemInterface::handleShortcutEvent (window=<optimized out>, window@entry=0x2925fb0, timestamp=2040935, keyCode=83, modifiers=..., nativeScanCode=39, nativeVirtualKey=115, nativeModifiers=20, text=..., autorepeat=false, count=1) at kernel/qwindowsysteminterface.cpp:375
#59 0x00007fcf5d858e24 in QGuiApplicationPrivate::processKeyEvent (e=0x2b9d920) at kernel/qguiapplication.cpp:2056
#60 0x00007fcf5d85e175 in QGuiApplicationPrivate::processWindowSystemEvent (e=e@entry=0x2b9d920) at kernel/qguiapplication.cpp:1739
#61 0x00007fcf5d8377cb in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:939
#62 0x00007fcf4c1bb470 in userEventSourceDispatch (source=<optimized out>) at qeventdispatcher_glib.cpp:77
#63 0x00007fcf56420197 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#64 0x00007fcf564203f0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#65 0x00007fcf5642049c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#66 0x00007fcf5cb696af in QEventDispatcherGlib::processEvents (this=0x235e6d0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#67 0x00007fcf5cb11e2a in QEventLoop::exec (this=this@entry=0x7ffff329be70, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#68 0x00007fcf5cb1ad64 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1291
#69 0x000000000042847c in ?? ()
#70 0x00007fcf5be5e830 in __libc_start_main (main=0x426320, argc=2, argv=0x7ffff329c398, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffff329c388) at ../csu/libc-start.c:291
#71 0x0000000000429f19 in _start ()

Possible duplicates by query: bug 295702.

Reported using DrKonqi
Comment 1 Dominik Haumann 2018-02-13 20:04:35 UTC
@Valdo: Now this is important: Can you reproduce this issue? Could you please try very hard to reproduce this? What did you do exactly? Please also skim through bug #190535 and see whether you maybe did something similar. This bug is ~10 years old and it seems it's still not entirely fixed. So any help here would be very much appreciated!!!

This seems to be a very old bug as well and is a duplicate of bug #295702 and #190535. I won't close it as duplicate yet, since #190535 is in state NEEDSINFO / WAITINGFORINFO.

@dfaure: It seems even thanks to the many fixes in bug #190535, there still are cases where this bug can happen. The backtrace shows the node=0x0, and rowNumber==-1. Same as in #190535.
Comment 2 Valdo 2018-02-20 22:38:11 UTC
Hi Dominik,

yes I can reproduce this issue systematically.

A/ Test case avoiding the bug:

I can create an empty text file in the remote Samba share with Dolphin. Then open that empty file with Kate, feed it with some text and save it: no issue.

B/ Test case hitting the bug:

Launch Kate, type in some text, then click Save, navigate to the "Network" shortcut, then double-clicking "Samba shares": Kate crashes in less than a second.

By reading the first part of bug #190535, I had the idea to launch Kate from Konsole. As soon as I click Save (to select a destination folder), this information displays in Konsole:

kf5.kio.core: Refilling KProtocolInfoFactory cache in the hope to find ""
kf5.kio.core: KSambaShare: Could not find smb.conf!

Each time I navigate to a new local subfolder, I get this information:

kf5.kio.core: Refilling KProtocolInfoFactory cache in the hope to find ""

Then clicking the "Network" shortcut to the left of the Save window:

kf5.kio.core: Refilling KProtocolInfoFactory cache in the hope to find ""

As soon as I double-click "Samba shares" to the right, I get this in Konsole:

kf5.kio.core: Refilling KProtocolInfoFactory cache in the hope to find ""
kf5.kio.core: Refilling KProtocolInfoFactory cache in the hope to find ""
kf5.kio.core: Refilling KProtocolInfoFactory cache in the hope to find ""
kf5.kio.widgets: Items emitted in directory QUrl("smb://") but that directory isn't in KDirModel! Root directory: QUrl("smb:///")
Item: QUrl("smb://workgroup")
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = kate path = /usr/bin pid = 1779
KCrash: Arguments: /usr/bin/kate 
KCrash: Attempting to start /usr/lib/x86_64-linux-gnu/libexec/drkonqi from kdeinit
sock_file=/run/user/1000/kdeinit5__0

[2]+  Arrêté                kate
$

Remember my Samba share is hosted on a Linux Mint 18.3 machine. On that machine, when right-clicking the folder shared with Samba and selecting option "Sharing options" (or equivalent English translation), I can notice that message: "The share name is too long" (or equivalent English translation). In my case, the share name is "Partage Mint-land".

I hope this helps. Feel free to ask for more details if needed. And thanks for your investigation.
Comment 3 Tony 2018-05-12 17:07:30 UTC
Created attachment 112601 [details]
New crash information added by DrKonqi

kwrite (18.04.1) using Qt 5.10.0

- What I was doing when the application crashed:

I was trying to access a file from a SAMBA share located on my NAS. KWrite crashed when I clicked on the NAS icon. The shares were not listed.

-- Backtrace (Reduced):
#6  KDirModelNode::rowNumber (this=0x0) at /workspace/build/src/widgets/kdirmodel.cpp:168
#7  KDirModelPrivate::indexForNode (this=0x27f13e0, node=0x0, rowNumber=-1) at /workspace/build/src/widgets/kdirmodel.cpp:349
#8  0x00007fa413a15f7a in KDirModelPrivate::_k_slotNewItems (this=<optimized out>, directoryUrl=..., items=...) at /workspace/build/src/widgets/kdirmodel.cpp:446
#9  0x00007fa4154ca7b6 in QtPrivate::QSlotObjectBase::call (a=0x7ffe2c167150, r=0x1fe0230, this=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:378
[...]
#12 0x00007fa4136a6e7a in KCoreDirLister::itemsAdded (this=<optimized out>, _t1=..., _t2=...) at /workspace/build/obj-x86_64-linux-gnu/src/core/moc_kcoredirlister.cpp:476
Comment 4 Christoph Cullmann 2018-07-14 14:23:36 UTC
Looks more like an issue in the KDirModel itself.
Comment 5 Castro B 2019-06-20 04:28:48 UTC
my Samba is shared when right-clicking the folder shared with Samba and selecting option "Sharing options".

Castro B,
https://mrpromokod.ru
Comment 6 David Faure 2020-04-15 07:55:29 UTC
Git commit d219f304319cb61aa51aae78c46872cbe49f8ff0 by David Faure.
Committed on 15/04/2020 at 07:54.
Pushed by dfaure into branch 'master'.

Avoid crash in release mode after the warning about unexpected child items

The root of the issue seems to be in kio_smb though.

M  +1    -0    src/widgets/kdirmodel.cpp

https://commits.kde.org/kio/d219f304319cb61aa51aae78c46872cbe49f8ff0
Comment 7 Justin Zobel 2022-10-06 06:37:14 UTC
Thank you for reporting this crash in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the crash with a recent software version?

If you can reproduce the issue, please change the status to "CONFIRMED" when replying. Thank you!
Comment 8 Tony 2022-10-07 12:36:58 UTC
Unfortunately I no longer use Samba shares and can not test this.
Comment 9 Nate Graham 2022-10-09 20:09:12 UTC
Ok, I guess we'll close it for now, then.