Bug 430890

Summary: SMB ioslave: WS-Discovery asserts if IPv6 is not available
Product: [Frameworks and Libraries] kio-extras Reporter: Jonathan Marten <jjm>
Component: SambaAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: nate, sitter
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Jonathan Marten 2020-12-28 09:59:01 UTC
SUMMARY

The SMB ioslave asserts in WSDiscoveryClient::sendProbe() if the system does not have IPv6 support or an IPv6 interface configured.  It attempts to use the KDSoapUdpClient to send IPv4 and IPv6 discovery messages, but any error return from either of those is checked with an assert.  This includes when the system does not have IPv6 available, but this is a benign error that should not be fatal.

STEPS TO REPRODUCE
1. Execute the command "kioclient5 ls smb:/" on a system without IPv6.
2. Observe the crash as below.

OBSERVED RESULT

Application: kdeinit5 (kdeinit5), signal: Aborted
Content of s_kcrashErrorMessage: [Current thread is 1 (Thread 0x7f060c539840 (LWP 876210))]
0x00007f060f58226f in poll () from /lib64/libc.so.6

Thread 1 (Thread 0x7f060c539840 (LWP 876210)):
[KCrash Handler]
#8  0x00007f060fac5ac7 in qt_message_fatal (context=..., message=<synthetic pointer>...) at qtbase-everywhere-src-5.15.1/src/corelib/global/qlogging.cpp:1914
#9  QMessageLogger::fatal (this=this@entry=0x7fff8e9bdc90, msg=msg@entry=0x7f060fdd67f8 "ASSERT: \"%s\" in file %s, line %d") at qtbase-everywhere-src-5.15.1/src/corelib/global/qlogging.cpp:893
#10 0x00007f060fac4815 in qt_assert (assertion=assertion@entry=0x7f060ae712e9 "rc", file=file@entry=0x7f060ae73760 "kio-extras/smb/kdsoap-ws-discovery-client/src/wsdiscoveryclient.cpp", line=line@entry=88) at qtbase-everywhere-src-5.15.1/include/QtCore/../../src/corelib/global/qlogging.h:90
#11 0x00007f060ae3a3ae in WSDiscoveryClient::sendProbe (this=this@entry=0x562695317960, typeList=..., scopeList=...) from /usr/lib64/plugins/kf5/kio/smb.so
#12 0x00007f060ae485c2 in WSDiscoverer::start (this=0x56269534dc10) at /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include/g++-v9/initializer_list:79
#13 0x00007f060ae3f984 in SMBSlave::listDir (this=0x7fff8e9be0e0, kurl=...) at kio-extras/smb/kio_smb_browse.cpp:446
#14 0x00007f060abfb2c6 in KIO::SlaveBase::dispatch (this=0x7fff8e9be0f0, command=71, data=...) at kio/src/core/slavebase.cpp:1243
#15 0x00007f060abfbbfe in KIO::SlaveBase::dispatchLoop (this=0x7fff8e9be0f0) at kio/src/core/slavebase.cpp:325
#16 0x00007f060ae3a863 in kdemain (argc=<optimized out>, argv=0x5626952ca6e0) at kio-extras/smb/main.cpp:21

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.20.80
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.1
kio-extras Git master 003a5ca4

ADDITIONAL INFORMATION

Suggest that the two Q_ASSERT(rc) checks near the end of WSDiscoveryClient::sendProbe() should be changed to qWarning() or qDebug().
Comment 1 Nate Graham 2021-01-05 17:19:04 UTC
Wanna submit a merge request? :)
Comment 2 Jonathan Marten 2021-01-05 18:11:03 UTC
Will do.  Just needed confirmation that just warning is the right thing to do.
Comment 3 Bug Janitor Service 2021-01-06 14:12:34 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/kio-extras/-/merge_requests/66
Comment 4 Jonathan Marten 2021-01-07 12:49:26 UTC
Upstream fix submitted at
https://gitlab.com/caspermeijn/kdsoap-ws-discovery-client/-/merge_requests/16
Comment 5 Nate Graham 2021-01-08 06:04:01 UTC
Cool, thanks!
Comment 6 Jonathan Marten 2023-12-01 12:09:59 UTC
See bug 477118 for merge request to fix.
Comment 7 Nate Graham 2023-12-01 17:34:10 UTC

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