[Interest] Callgrind under Linux

Jérôme Godbout godboutj at amotus.ca
Fri Mar 6 15:47:41 CET 2020


We did find a closed issue about it: https://bugreports.qt.io/browse/QTBUG-62118
But no solution or hint about the cause of this.

From: Interest <interest-bounces at qt-project.org> On Behalf Of Jérôme Godbout
Sent: March 6, 2020 9:27 AM
To: interest at qt-project.org
Subject: [Interest] Callgrind under Linux

Hi,
one of my colleague is trying to start valgrind callgrind to profile a part of the application using Qt 5.12.7, latest Qt Creator with Ubuntu. the start command look like this:

valgrind --tool=callgrind --instr-atstart=no ./OpM-3_DU_SW

it did the macro for the start/stop and dump. Added the valgrind lib. But Valgrind seem to crash with the following error:

==13393== Callgrind, a call-graph generating cache profiler
==13393== Copyright (C) 2002-2015, and GNU GPL'd, by Josef Weidendorfer et al.
==13393== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==13393== Command: ./OpM-3_DU_SW
==13393==
==13393== For interactive control, run 'callgrind_control -h'.
No active callgrind runs detected.
==13393== warning: ignoring line info entry with huge line number (1302938)
==13393==          Can't handle line numbers greater than 1048575, sorry
==13393== (Nb: this message is only shown once)
vex amd64->IR: unhandled instruction bytes: 0xF 0xC7 0xF2 0xB9 0x1 0x0 0x0 0x0
vex amd64->IR:   REX=0 REX.W=0 REX.R=0 REX.X=0 REX.B=0
vex amd64->IR:   VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=0F
vex amd64->IR:   PFX.66=0 PFX.F2=0 PFX.F3=0
==13393== valgrind: Unrecognised instruction at address 0x84d5c40.
==13393==    at 0x84D5C40: qt_random_cpu(void*, long long) (immintrin.h:103)
==13393==    by 0x84D6666: QRandomGenerator::SystemGenerator::generate(unsigned int*, unsigned int*) (qrandom.cpp:369)
==13393==    by 0x84D7068: QRandomGenerator::_fillRange(void*, void*) (qrandom.cpp:1226)
==13393==    by 0x853378B: qt_create_qhash_seed() (qrandom.h:143)
==13393==    by 0x8534136: QHashData::detach_helper(void (*)(QHashData::Node*, void*), void (*)(QHashData::Node*), int, int) (qhash.cpp:325)
==13393==    by 0x86B868E: QMetaType::registerConverterFunction(QtPrivate::AbstractConverterFunction const*, int, int) (qhash.h:599)
==13393==    by 0x6819C02: QMetaTypeId<QList<QMediaResource> >::qt_metatype_id() (qmetatype.h:2310)
==13393==    by 0x40106B9: call_init.part.0 (dl-init.c:72)
==13393==    by 0x40107CA: _dl_init (dl-init.c:30)
==13393==    by 0x4000C69: ??? (in /lib/x86_64-linux-gnu/ld-2.23.so)
==13393== Your program just tried to execute an instruction that Valgrind
==13393== did not recognise.  There are two possible reasons for this.
==13393== 1. Your program has a bug and erroneously jumped to a non-code
==13393==    location.  If you are running Memcheck and you just saw a
==13393==    warning about a bad jump, it's probably your program's fault.
==13393== 2. The instruction is legitimate but Valgrind doesn't handle it,
==13393==    i.e. it's Valgrind's fault.  If you think this is the case or
==13393==    you are not sure, please let us know and we'll try to fix it.
==13393== Either way, Valgrind will now raise a SIGILL signal which will
==13393== probably kill your program.
==13393==
==13393== Process terminating with default action of signal 4 (SIGILL)
==13393==  Illegal opcode at address 0x84D5C40
==13393==    at 0x84D5C40: qt_random_cpu(void*, long long) (immintrin.h:103)
==13393==    by 0x84D6666: QRandomGenerator::SystemGenerator::generate(unsigned int*, unsigned int*) (qrandom.cpp:369)
==13393==    by 0x84D7068: QRandomGenerator::_fillRange(void*, void*) (qrandom.cpp:1226)
==13393==    by 0x853378B: qt_create_qhash_seed() (qrandom.h:143)
==13393==    by 0x8534136: QHashData::detach_helper(void (*)(QHashData::Node*, void*), void (*)(QHashData::Node*), int, int) (qhash.cpp:325)
==13393==    by 0x86B868E: QMetaType::registerConverterFunction(QtPrivate::AbstractConverterFunction const*, int, int) (qhash.h:599)
==13393==    by 0x6819C02: QMetaTypeId<QList<QMediaResource> >::qt_metatype_id() (qmetatype.h:2310)
==13393==    by 0x40106B9: call_init.part.0 (dl-init.c:72)
==13393==    by 0x40107CA: _dl_init (dl-init.c:30)
==13393==    by 0x4000C69: ??? (in /lib/x86_64-linux-gnu/ld-2.23.so)
==13393==
==13393== Events    : Ir
==13393== Collected : 0
==13393==
==13393== I   refs:      0

This ain't our application it's a client one, but how does one know what exactly is wrong!? The proint call stack seem legitimate to me.
Any tips on this would be welcome.

Side note: Any pro tips to monitor only application calls and filter out the system libs without specifying every system lib by hand?

Thanks,


[cid:image001.jpg at 01D5F39C.476162B0]
une compagnie  [cid:image002.jpg at 01D5F39C.476162B0]
RAPPROCHEZ LA DISTANCE
Jérôme Godbout
Développeur Logiciel Sénior /
Senior Software Developer
p: +1 (418) 800-1073 ext.:109
amotus.ca<http://www.amotus-solutions.com/>
statum-iot.com<http://statum-iot.com/>
[cid:image003.png at 01D5F39C.476162B0]<https://www.facebook.com/LesSolutionsAmotus/> [cid:image004.png at 01D5F39C.476162B0] <https://www.linkedin.com/company/amotus-solutions/>  [cid:image005.png at 01D5F39C.476162B0] <https://twitter.com/AmotusSolutions>  [cid:image006.jpg at 01D5F39C.476162B0] <https://www.youtube.com/channel/UCoYpQgsmj1iJZyDjTQ3x8Ig>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200306/ee87ad0c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 6725 bytes
Desc: image001.jpg
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200306/ee87ad0c/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 1016 bytes
Desc: image002.jpg
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200306/ee87ad0c/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 483 bytes
Desc: image003.png
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200306/ee87ad0c/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 506 bytes
Desc: image004.png
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200306/ee87ad0c/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 500 bytes
Desc: image005.png
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200306/ee87ad0c/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.jpg
Type: image/jpeg
Size: 713 bytes
Desc: image006.jpg
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200306/ee87ad0c/attachment-0002.jpg>


More information about the Interest mailing list