Skip to content

prevent crash on ASSERT: "!filePath.endsWith(QLatin1Char('/'))" in .../src/file/newfileindexer.cpp, line 38

Oded Arbel requested to merge odeda/baloo:patch-crash-newfileindexer into master

This is a WIP patch to track why it happens and fix this crash:

Mar 31 01:42:22 vesho baloo_file[2407974]: ASSERT: "!filePath.endsWith(QLatin1Char('/'))" in file /home/odeda/cvs/baloo/src/file/newfileindexer.cpp, line 38

The main problem with figuring it out is that NewFileIndexer::run() - where that assert happens, is run on a schedule so it is hard to understand what causes the directory path to get submitted a new file for indexing.

The call path I'm looking at (in reverse) is like this:

NewFileIndexer::run() <- NewFileIndexer constructed with a static file list by FileIndexScheduler::scheduleIndexing() <- paths in the file list added by slot FileIndexScheduler::indexNewFile() <- signaled by FileWatch::indexNewFile() <- signaled by either PendingFileQueue::indexNewFile() or MetadataMover::movedWithoutData().

  • PendingFileQueue::indexNewFile() checks PendingFile::isNewFile() before emitting, so I should check it but it sounds safe.
  • MetadataMover::movedWithoutData() is emitted by MetadataMover::updateMetadata() in two different locations, where one looks very clearly as emitting for directories, but I want to be sure of more - hence this patch just move the assert to be more in the direct call path of whatever signal causes this crash.
Edited by Oded Arbel

Merge request reports