Bug 384021 - Crash on investment charts with multiple investments
Summary: Crash on investment charts with multiple investments
Status: RESOLVED FIXED
Alias: None
Product: kdiagram
Classification: Applications
Component: KChart (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Dag Andersen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-25 20:07 UTC by David Houlden
Modified: 2018-03-23 08:43 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.1


Attachments
Backtrace (5.93 KB, text/plain)
2017-08-25 20:07 UTC, David Houlden
Details
Anon file to demonstrate problem (439.70 KB, application/gzip)
2017-08-26 12:31 UTC, David Houlden
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Houlden 2017-08-25 20:07:03 UTC
Created attachment 107521 [details]
Backtrace

Latest 4.8 git head crashes whenever I try to display an investment price graph which shows price history for more than one investment. Charts showing only one investment work ok. Backtrace attached.
Comment 1 Ralf Habacker 2017-08-26 11:37:47 UTC
You have a test case or a how to reproduce ?
Comment 2 David Houlden 2017-08-26 12:31:35 UTC
Created attachment 107532 [details]
Anon file to demonstrate problem

Open the anon file attached. In investment reports, R000013, 14, 16 will crash KMyMoney. R000018 will work.
Comment 3 Ralf Habacker 2017-08-31 17:48:15 UTC
Git commit a583dc9d434ec1f42bc417769adcf3449dea741c by Ralf Habacker.
Committed on 31/08/2017 at 17:47.
Pushed by habacker into branch '4.8'.

Fix 'Crash on investment charts with multiple investments'

The root cause of this crash is an implementation bug in
CartesianDiagramDataCompressor::slotColumnsAboutToBeInserted().

In case m_model is set, adding columns to m_data requires to add a
QVector<DataPoint> instance sized to the model row count. Instead the
size is limited to m_xResolution which depends on the diagram zoom factor
and other values. Having a too small sized column in m_data let
slotRowsAboutToBeInserted() crash.

This patch needs to be pushed upstream to have it in further kdiagram
releases.

Fixup of commit 7516308b.
FIXED-IN:4.8.1

M  +1    -1    libkdchart/src/KDChart/Cartesian/KDChartCartesianDiagramDataCompressor_p.cpp

https://commits.kde.org/kmymoney/a583dc9d434ec1f42bc417769adcf3449dea741c
Comment 4 Ralf Habacker 2017-09-02 09:39:24 UTC
Fix has been added to kmymoneys 4.8 kdiagram source copy for now.
Comment 5 Dag Andersen 2018-03-23 08:43:38 UTC
Afaics this fix is included in KChart 2.6 so closing it.