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

# Help with setting up valgrind in Qt Creator.

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 close delete

Sort by » oldest newest most voted

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

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.

( 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.

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

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.
more