We have moved to a new Sailfish OS Forum. Please start new discussions there.

Help with setting up valgrind in Qt Creator.

asked 2014-03-21 17:18:38 +0300

fasza2mobile gravatar image

Hi, I am trying to set up up Valgrind to work with QtCreator, but having no luck with it. I searched for guides, but they seem a bit out of date. A link to a more up to date tutorial would be much appreciated. I'm using Linux x86_64 by the way. Thanks in advance!

edit retag flag offensive close delete

2 Answers

Sort by » oldest newest most voted

answered 2014-08-30 04:47:00 +0300

A bit late, but I needed valgrind for myself now. It is very easy to set up valgrind to analyze your app running on Jolla using Qt Creator.

  1. SSH into your Jolla with user nemo
  2. Get root privileges by typing devel-su and enter your password
  3. Install the package valgrind (e.g. by using zypper: zypper install valgrind)
  4. Now you can just start analyzing your app in Qt Creator by running an action in Analyze menu

Hope, it'll help you!

edit flag offensive delete publish link more


Thanks, I thought I had to set up the extrnal version, but as it turns out the normal one is already set up. That being said the memory analyzer doesn't work for me, it just stops without giving any error message or indicating some sort of success. The function profiler does work, albeit very slowly. The QML profiler I didn't try.

I will accept your answer as I believe it is correct, though unfortunately I can't really use the aformentioned tools as I'd like to.

fasza2mobile ( 2014-09-03 17:01:21 +0300 )edit

Tank you! I have to say, that I didn't test the memory analyzer and the QML profiler. Yes, it is very very slow... I didn't use valgrind anytime before, so I thought it is normal. Maybe it could be tuned a little bit.

ejjoman ( 2014-09-03 18:05:17 +0300 )edit

answered 2015-12-08 15:12:38 +0300

JoliJolla gravatar image

As said before, valgrind is nowdays already included in SailfishOs. But to support memcheck, the default tool for valgind, you need to install glibc-debuginfo. Example with pkcon:

pkcon install glibc-debuginfo

Same strategy also works with the emulator.

Problems remaining:

  • As usual, quite a lot of false positives with Qt and memcheck
  • Don't be surprised by the extreme slowness of your program, valgrind overhead is huge. Makes debugging annoying and may hide some concurrency problems.
  • I still can't make it run from SailfishSDK, either internal or external.
  • The binary is always stripped when deployed, even when compiled in debug mode, which is odd for debugging purposes.
edit flag offensive delete publish link more
Login/Signup to Answer

Question tools



Asked: 2014-03-21 17:18:38 +0300

Seen: 2,097 times

Last updated: Dec 08 '15