Bug 379220

Summary: assertion hit when binaries were not identical [AccumulatedTraceData::diff()]
Product: [Applications] Heaptrack Reporter: Rolf Eike Beer <kde>
Component: generalAssignee: Milian Wolff <mail>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: One testcase file

Description Rolf Eike Beer 2017-04-25 19:28:49 UTC
I tried to compare 2 different versions of a program (i.e. with and without a fix), but the crash can be easily reproduced by just using data from 2 different binaries.

#4  0x00000000004db3b3 in AccumulatedTraceData::diff(AccumulatedTraceData const&) (this=0x7fffc40033d8, base=...) at /home/eike/repos/KDE/heaptrack/src/analyze/accumulatedtracedata.cpp:588
#5  0x00000000004ab9f3 in Parser::__lambda13::operator()() const (__closure=0x9143b0) at /home/eike/repos/KDE/heaptrack/src/analyze/gui/parser.cpp:548
#6  0x00000000004b7e4e in ThreadWeaver::Lambda<Parser::parse(const QString&, const QString&)::__lambda13>::run(ThreadWeaver::JobPointer, ThreadWeaver::Thread *) (this=0x9143a0)
    at /usr/include/KF5/ThreadWeaver/threadweaver/lambda.h:47
#7  0x00007ffff7984587 in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib64/libKF5ThreadWeaver.so.5
#8  0x00007ffff79833d0 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib64/libKF5ThreadWeaver.so.5
#9  0x00007ffff7982af7 in ThreadWeaver::Thread::run() () at /usr/lib64/libKF5ThreadWeaver.so.5
#10 0x00007ffff2de69e9 in  () at /usr/lib64/libQt5Core.so.5
#11 0x00007ffff742a744 in start_thread () at /lib64/libpthread.so.0
#12 0x00007ffff21e0d3d in clone () at /lib64/libc.so.6
Comment 1 Rolf Eike Beer 2017-04-26 19:37:10 UTC
Created attachment 105209 [details]
One testcase file

Use https://bugs.kde.org/attachment.cgi?id=105208 as the other one.
Comment 2 Milian Wolff 2017-04-28 11:16:04 UTC
Oh, I usually have RelWithDebInfo without assertions, where this doesn't show up then. Confirmed, will look into it.
Comment 3 Milian Wolff 2017-04-28 11:26:08 UTC
Git commit 4f56a13fcc4b75313333216f48698eb682c9d0f9 by Milian Wolff.
Committed on 28/04/2017 at 11:24.
Pushed by mwolff into branch 'master'.

Properly remap string indices before asserting equality

The string indices in the IP belong to the other file and thus
will mismatch. We need to remap them before we can commpare the
data in the assertion correctly.

M  +1    -1    src/analyze/accumulatedtracedata.cpp

https://commits.kde.org/heaptrack/4f56a13fcc4b75313333216f48698eb682c9d0f9