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
Details
- Reviewers
dfaure vhanda mgallien - Group Reviewers
Frameworks Baloo
$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
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.
@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.