D21581: Detect valgrind, avoid database removal when using valgrind

2019-06-04 Thread Ben Cooksley
bcooksley added a comment.


  This changes breaks the build on Windows/MSVC because 'valgrind.h' doesn't 
support MSVC.
  Can you please correct this / disable this check on Windows?

REPOSITORY
  R293 Baloo

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

To: bruns, #baloo, ngraham, astippich, poboiko, broulik, mgallien
Cc: bcooksley, mgallien, kde-frameworks-devel, LeGast00n, domson, 
ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams


D21581: Detect valgrind, avoid database removal when using valgrind

2019-06-04 Thread Stefan Brüns
This revision was automatically updated to reflect the committed changes.
Closed by commit R293:446aeb07d922: Detect valgrind, avoid database removal 
when using valgrind (authored by bruns).

REPOSITORY
  R293 Baloo

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D21581?vs=59137&id=59139

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

AFFECTED FILES
  src/engine/database.cpp
  src/engine/valgrind.h

To: bruns, #baloo, ngraham, astippich, poboiko, broulik, mgallien
Cc: mgallien, kde-frameworks-devel, LeGast00n, domson, ashaposhnikov, michaelh, 
astippich, spoorun, ngraham, bruns, abrahams


D21581: Detect valgrind, avoid database removal when using valgrind

2019-06-04 Thread Nathaniel Graham
ngraham accepted this revision.
ngraham added a comment.


  Hah, wow

REPOSITORY
  R293 Baloo

BRANCH
  master

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

To: bruns, #baloo, ngraham, astippich, poboiko, broulik, mgallien
Cc: mgallien, kde-frameworks-devel, LeGast00n, domson, ashaposhnikov, michaelh, 
astippich, spoorun, ngraham, bruns, abrahams


D21581: Detect valgrind, avoid database removal when using valgrind

2019-06-04 Thread Matthieu Gallien
mgallien accepted this revision.
mgallien added a comment.
This revision is now accepted and ready to land.


  Very nice. Thank you

REPOSITORY
  R293 Baloo

BRANCH
  master

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

To: bruns, #baloo, ngraham, astippich, poboiko, broulik, mgallien
Cc: mgallien, kde-frameworks-devel, LeGast00n, domson, ashaposhnikov, michaelh, 
astippich, spoorun, ngraham, bruns, abrahams


D21581: Detect valgrind, avoid database removal when using valgrind

2019-06-04 Thread Stefan Brüns
bruns updated this revision to Diff 59137.
bruns added a comment.


  rebase

REPOSITORY
  R293 Baloo

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D21581?vs=59136&id=59137

BRANCH
  master

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

AFFECTED FILES
  src/engine/database.cpp
  src/engine/valgrind.h

To: bruns, #baloo, ngraham, astippich, poboiko, broulik
Cc: kde-frameworks-devel, LeGast00n, domson, ashaposhnikov, michaelh, 
astippich, spoorun, ngraham, bruns, abrahams


D21581: Detect valgrind, avoid database removal when using valgrind

2019-06-04 Thread Stefan Brüns
bruns edited the summary of this revision.

REPOSITORY
  R293 Baloo

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

To: bruns, #baloo, ngraham, astippich, poboiko, broulik
Cc: kde-frameworks-devel, LeGast00n, domson, ashaposhnikov, michaelh, 
astippich, spoorun, ngraham, bruns, abrahams


D21581: Detect valgrind, avoid database removal when using valgrind

2019-06-04 Thread Stefan Brüns
bruns created this revision.
bruns added reviewers: Baloo, ngraham, astippich, poboiko, broulik.
Herald added projects: Frameworks, Baloo.
Herald added a subscriber: kde-frameworks-devel.
bruns requested review of this revision.

REVISION SUMMARY
  The mmap size supported by valgrind is set at valgrind compile time. If
  the application tries to mmap in total more than the supported size,
  the mmap fails. As a result lmdb fails to open the DB which is
  interpreted as a broken DB, thus the DB is deleted.
  
  Valgrind can be detected at runtime using the RUNNING_ON_VALGRIND
  macro from valgrind.h, which is added to the sources:
  
  > You are encouraged to copy the valgrind/*.h headers into your project's
  
include directory, so your program doesn't have a compile-time
dependency on Valgrind being installed. The Valgrind headers, unlike
most of the rest of the code, are under a BSD-style license so you may
include them without worrying about license incompatibility.

TEST PLAN
  valgrind --tool=callgrind baloo_file
  
  > org.kde.baloo.engine: Valgrind detected, limiting DB mmap to 40 GByte

REPOSITORY
  R293 Baloo

BRANCH
  base

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

AFFECTED FILES
  src/engine/database.cpp
  src/engine/valgrind.h

To: bruns, #baloo, ngraham, astippich, poboiko, broulik
Cc: kde-frameworks-devel, LeGast00n, domson, ashaposhnikov, michaelh, 
astippich, spoorun, ngraham, bruns, abrahams