documenturldb: Temporarily remove Q_ASSERT, ignore empty filenames instead
AbandonedPublic

Authored by michaelh on Jan 31 2018, 3:40 PM.

Details

Reviewers
dfaure
vhanda
mgallien
Group Reviewers
Frameworks
Baloo
Summary

In debug mode this assert prevents usage of cli tools like baloosearch.
Replace Q_ASSERT with an if.. clause until the cause for assert failure is clear

Test Plan
$baloosearch type:Audio | grep '^$' | wc -l
17

+ 17 lines on stderr "Id 148657949215033349 has no valid filename, ignoring it."

baloosearch://?query=type:Audio in dolphin looks normal.

Diff Detail

Repository
R293 Baloo
Branch
empty-file
Lint
No Linters Available
Unit
No Unit Test Coverage
michaelh created this revision.Jan 31 2018, 3:40 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptJan 31 2018, 3:40 PM
michaelh requested review of this revision.Jan 31 2018, 3:40 PM
michaelh retitled this revision from baloo:DocumentUrlDB: Temporarily remove Q_ASSERT, ignore empty filenames instead to DocumentUrlDB: Temporarily remove Q_ASSERT, ignore empty filenames instead.Jan 31 2018, 3:43 PM
michaelh retitled this revision from DocumentUrlDB: Temporarily remove Q_ASSERT, ignore empty filenames instead to documenturldb: Temporarily remove Q_ASSERT, ignore empty filenames instead.Jan 31 2018, 5:02 PM
michaelh added a reviewer: Baloo.
michaelh added a project: Baloo.
mgallien added a comment.EditedFeb 1 2018, 9:57 PM

I do not reproduce your issue. At the same time, I have wiped out my baloo db a lot of times so I may just have one that is correct given it is young.

I do not reproduce your issue. At the same time, I have wiped out my baloo db a lot of times so I may just have one that is correct given it is young.

Yes, you need a corrupt db for that. If it's sane Q_ASSERT will pass. Lucky you :)
I will keep mine in its corrupt state to find out what is wrong.

michaelh added a comment.EditedFeb 4 2018, 10:08 AM

@mgallien: Here is way to come close to reproducing this without corrupting you db:

$balooctl stop
  • Take 2 pendrives A and B
  • Plug them in in this order: A > B

Assuming they are mounted inside /run/media/mgallien/

$ stat -c "%D %n" /run/media/mgallien/*

Unmount and unplug the drives
Plug them in again in this order: B > A

$ stat -c "%D %n" /run/media/mgallien/*

On my system Drive A now has a different device id.

  • Read `baloo/src/engine/idutils.h:48'
  • Plug out the drives, restart baloo

For testing I indexed some files on the pendrive.
Without the drive plugged in on my system the result is weird behaviour like this:

baloosearch -d "/run/media/mgallien/" type:Video | xargs -d'\n' balooshow -x "{}"
Elapsed: 5.45662 msecs
ASSERT: "id > 0" in file /home/super/devel/kde/src/frameworks/baloo/src/engine/transaction.cpp, line 101
xargs: balooshow: terminated by signal 6

Which of course should not happen.

@mgallien: Here is way to come close to reproducing this without corrupting you db:

$balooctl stop
  • Take 2 pendrives A and B
  • Plug them in in this order: A > B Assuming they are mounted inside /run/media/mgallien/ ` $ stat -c "%D %n" /run/media/mgallien/* ` Unmount and unplug the drives Plug them in again in this order: B > A ` $ stat -c "%D %n" /run/media/mgallien/* ` On my system Drive A now has a different device id.
  • Read `baloo/src/engine/idutils.h:48'
  • Plug out the drives, restart baloo

    For testing I indexed some files on the pendrive. Without the drive plugged in on my system the result is weird behaviour like this: ` baloosearch -d "/run/media/mgallien/" type:Video | xargs -d'\n' balooshow -x "{}" Elapsed: 5.45662 msecs ASSERT: "id > 0" in file /home/super/devel/kde/src/frameworks/baloo/src/engine/transaction.cpp, line 101 xargs: balooshow: terminated by signal 6 ` Which of course should not happen.

I will test following your procedure. Anyway, this should not happen. Let's try to fix that bug.

michaelh abandoned this revision.Mar 19 2018, 6:59 AM

Done in D11285