D10989: Check for nullptr in indexForNode

2020-04-15 Thread Jaime Torres Amate
jtamate abandoned this revision.
jtamate added a comment.




REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D10989

To: jtamate, #frameworks, dfaure
Cc: kde-frameworks-devel, mpyne, LeGast00n, cblack, michaelh, ngraham, bruns


D10989: Check for nullptr in indexForNode

2020-04-15 Thread David Faure
dfaure requested changes to this revision.
dfaure added a comment.
This revision now requires changes to proceed.
Herald added a subscriber: kde-frameworks-devel.


  I pushed https://commits.kde.org/kio/d219f304319cb61aa51aae78c46872cbe49f8ff0 
instead, you can drop this.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D10989

To: jtamate, #frameworks, dfaure
Cc: kde-frameworks-devel, mpyne, LeGast00n, cblack, michaelh, ngraham, bruns


D10989: Check for nullptr in indexForNode

2018-03-06 Thread David Faure
dfaure added a comment.


  helgrind and drd are for multithreading data races, but KDirModel can't be 
used in a multithreading context, so I'm not sure why you're mentioning those 
tools.
  
  If you do want to detect data races, please note that helgrind and drd have 
lots of false positives (if you really want to use helgrind, read 
https://www.kdab.com/~dfaure/helgrind.html), and a much better tool is clang's 
thread-sanitizer. Downside: you need to build your own Qt first, with 
`-platform linux-clang-libc++ -sanitize thread`. Upside: the apps run much 
faster than with helgrind, and the reports are much more useful.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D10989

To: jtamate, #frameworks, dfaure
Cc: mpyne, michaelh


D10989: Check for nullptr in indexForNode

2018-03-06 Thread Jaime Torres Amate
jtamate added a comment.


  In D10989#219594 , @mpyne wrote:
  
  > I think valgrind has some flags you can use to try to generate a backtrace 
for where a freed block of memory was freed from, which might be useful for 
debugging.
  
  
  Thanks. The parameter is --read-var-info=yes, but it confirms my assumption, 
the job is already deleted and its space used by many others before the crash.
  With --tool=helgrind it shows more than 4.500 errors.
  With -tool=drd it shows more than 90.000 errors.
  Therefore I'll try to fix as many of them as possible, step by step, if it's 
possible.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D10989

To: jtamate, #frameworks, dfaure
Cc: mpyne, michaelh


D10989: Check for nullptr in indexForNode

2018-03-06 Thread David Faure
dfaure added a comment.


  That's actually valgrind-memcheck's default behaviour.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D10989

To: jtamate, #frameworks, dfaure
Cc: mpyne, michaelh


D10989: Check for nullptr in indexForNode

2018-03-05 Thread Michael Pyne
mpyne added a comment.


  I'm not sure the job could have been deleted before 
`KDialogJobUiDelegate::showErrorMessage()` since much of the call stack before 
then involves making method calls on the job.  
KDirLister::handleError(KIO::Job*) (kdirlister.cpp:81) makes a call to 
`job->error()` right before calling `handleError`, for instance.
  
  Is it possible that the widget itself has been deleted early somehow?  Does 
the job run on a different event loop (due to threading or similar)?
  
  I think valgrind has some flags you can use to try to generate a backtrace 
for where a freed block of memory was freed from, which might be useful for 
debugging.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D10989

To: jtamate, #frameworks, dfaure
Cc: mpyne, michaelh


D10989: Check for nullptr in indexForNode

2018-03-05 Thread Jaime Torres Amate
jtamate added a comment.


  > I tried testing
  > 
  >   kdialog --getexistingdirectory smb://
  > 
  > but this gives an error here "Unable to find any workgroups in your local 
network." even with samba started locally. Don't know why.
  
  I get always a crash trying kdialog --getexistingdirectory smb://, only 
executed directly or under valgrind, but not under gdb when I get that message 
also.
  
  8150== Process terminating with default action of signal 11 (SIGSEGV)
  -
  
  8150==  Access not within mapped region at address 0x28
  ---
  
  8150==at 0x62701D6: QObject::isWidgetType() const (qobject.h:147)
  -
  
  8150==by 0x627022C: QWidget* qobject_cast(QObject*) 
(qwidget.h:741)
  
-
  
  8150==by 0x627072B: 
QtPrivate::QVariantValueHelper::object(QVariant const&) 
(qvariant.h:709)
  
--
  
  8150==by 0x62704BD: 
QtPrivate::ObjectInvoker, QVariant 
const&, QWidget*>::invoke(QVariant const&) (qvariant.h:102)
  
---
  
  8150==by 0x627037B: QWidget* qvariant_cast(QVariant const&) 
(qvariant.h:835)
  
--
  
  8150==by 0x62702D5: QWidget* QVariant::value() const 
(qvariant.h:352)
  
---
  
  8150==by 0x626FF64: KJobWidgets::window(KJob*) (kjobwidgets.cpp:35)
  ---
  
  8150==by 0x6268028: KDialogJobUiDelegate::window() const 
(kdialogjobuidelegate.cpp:144)
  
---
  
  8150==by 0x62680E6: KDialogJobUiDelegate::showErrorMessage() 
(kdialogjobuidelegate.cpp:162)
  
---
  
  8150==by 0x4F48236: KDirLister::handleError(KIO::Job*) (kdirlister.cpp:81)
  --
  
  8150==by 0x5F9F573: KCoreDirListerCache::slotResult(KJob*) 
(kcoredirlister.cpp:1334)
  

  
  8150==by 0x5FAAC6E: KCoreDirListerCache::qt_static_metacall(QObject*, 
QMetaObject::Call, int, void**) (moc_kcoredirlister_p.cpp:136)
  

  
  8150==by 0x921B029: QMetaObject::activate(QObject*, int, int, void**) (in 
/usr/lib64/libQt5Core.so.5.10.0)
  
--
  
  8150==by 0x8A798DC: KJob::result(KJob*, KJob::QPrivateSignal) 
(moc_kjob.cpp:569)
  

  
  8150==by 0x8A778B4: KJob::finishJob(bool) (kjob.cpp:114)
  
  
  8150==by 0x8A77F9A: KJob::emitResult() (kjob.cpp:298)
  -
  
  8150==by 0x5F592AB: KIO::SimpleJob::slotFinished() (simplejob.cpp:232)
  --
  
  8150==by 0x5F52050: KIO::ListJob::slotFinished() (listjob.cpp:247)
  --
  
  8150==by 0x5F593C6: KIO::SimpleJob::slotError(int, QString const&) 
(simplejob.cpp:245)
  
--
  
  8150==by 0x5F5BA92: QtPrivate::FunctorCall, 
QtPrivate::List, void, void (KIO::SimpleJob::*)(int, 
QString const&)>::call(void (KIO::SimpleJob::*)(int, QString const&), 
KIO::SimpleJob*, void**) (qobjectdefs_impl.h:136)
  
--
  
  8150==by 0x5F5B8EF: void QtPrivate::FunctionPointer::call, void>(void (KIO::SimpleJob::*)(int, QString const&), KIO::SimpleJob*, 
void**) 

D10989: Check for nullptr in indexForNode

2018-03-04 Thread Jaime Torres Amate
jtamate added a dependency: D11013: Remove trailing data in the protocol 
parameter in findProtocol.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D10989

To: jtamate, #frameworks, dfaure
Cc: michaelh


D10989: Check for nullptr in indexForNode

2018-03-03 Thread David Faure
dfaure added a comment.


  It would be much better to fix those two issues instead...
  
  kf5.kio.core: Refilling KProtocolInfoFactory cache in the hope to find ""
  (which sounds like a wrongly constructed URL with no scheme)
  
  kf5.kio.widgets: Items emitted in directory QUrl("smb://") but that directory 
isn't in KDirModel! Root directory: QUrl("smb:///")
  (which might or might not be a consequence of the previous issue)
  
  I tried testing
  
kdialog --getexistingdirectory smb://
  
  but this gives an error here "Unable to find any workgroups in your local 
network." even with samba started locally. Don't know why.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D10989

To: jtamate, #frameworks, dfaure
Cc: michaelh


D10989: Check for nullptr in indexForNode

2018-03-03 Thread Jaime Torres Amate
jtamate created this revision.
jtamate added reviewers: Frameworks, dfaure.
Restricted Application added a project: Frameworks.
jtamate requested review of this revision.

REVISION SUMMARY
  CCBUG: 390288
  Checking for nullptr will avoid the crash and return an empty
  QModelIndex.

TEST PLAN
  Ask @Valdo if the bug can be reproduced.

REPOSITORY
  R241 KIO

BRANCH
  kate (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D10989

AFFECTED FILES
  src/widgets/kdirmodel.cpp

To: jtamate, #frameworks, dfaure
Cc: michaelh