D21581: Detect valgrind, avoid database removal when using valgrind

Stefan BrĂ¼ns noreply at phabricator.kde.org
Tue Jun 4 17:09:13 BST 2019


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190604/2137a4c9/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list