Bug 120238 - Assert when inserting a chart as OLE object
Summary: Assert when inserting a chart as OLE object
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.2.0.0.alpha0+
Hardware: All All
: high major
Assignee: Eike Rathke
URL:
Whiteboard: target:6.2.0
Keywords: haveBacktrace
Depends on:
Blocks: Crash-Assert
  Show dependency treegraph
 
Reported: 2018-10-01 11:27 UTC by Heiko Tietze
Modified: 2018-10-05 11:37 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
gdb bt (34.39 KB, text/plain)
2018-10-02 20:11 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Heiko Tietze 2018-10-01 11:27:28 UTC
Running latest master, Calc crashes on Insert > Object > OLE Object... > Chart. Inserting another OLE object such as LibreOffice Drawing works. 

Console returns:
...
warn:chart2.tools:6590:6590:chart2/source/tools/WrappedPropertySet.cxx:139: found no inner property set to map to
soffice.bin: /home/ht/Sources/libreoffice/sc/source/core/tool/chartpos.cxx:409: void ScChartPositioner::CreatePositionMap(): Assertion `rCol.empty()' failed.

Version: 6.2.0.0.alpha0+
Build ID: f0ae799100d22d5949e80e3570bceccbe68f59be
CPU threads: 8; OS: Linux 4.18; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); Calc: threaded

--enable-debug
--without-java
--without-myspell-dicts
--without-doxygen
--disable-firebird-sdbc
--without-system-firebird
Comment 1 Xisco Faulí 2018-10-01 15:01:54 UTC
I can't reproduce it in

Version: 6.2.0.0.alpha0+
Build ID: e9c1cbce903d325b1e19602d72765511589f5bf2
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: threaded
Comment 2 Aron Budea 2018-10-01 15:17:33 UTC
Confirmed with a 6.2.0.0.alpha0+ debug(!) build (b6429f3e72a705e41e1da6b6402bd7aba12ab11f) / Ubuntu 18.04.

I'm not getting the crash with the latest build of lo-linux-dbgutil-daily repo (e206a3b40083729fd57502f33e49fa30e54ac8e6), so either this is a recent regression, or the daily bibisect repo isn't compiled to include asserts.
Comment 3 Julien Nabet 2018-10-02 20:11:52 UTC
Created attachment 145335 [details]
gdb bt

On pc Debian x86-64 with master sources updated today, I could reproduce this.

I attached gdb session including bt with symbols.
Comment 4 Julien Nabet 2018-10-02 20:12:48 UTC
Noel: noticing assert statement has been put with b1f9aa5f58ea322097998839e00d95fc40be8b22, thought you might be interested in this one.
Comment 5 Julien Nabet 2018-10-02 20:29:20 UTC
Eike: I noticed in gdb several times this log:
warn:chart2:9459:9459:chart2/source/tools/DiagramHelper.cxx:701: DBG_UNHANDLED_EXCEPTION in static std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::chart2::XDataSeries> > chart::DiagramHelper::getDataSeriesFromDiagram(const com::sun::star::uno::Reference<com::sun::star::chart2::XDiagram>&)
    type: com.sun.star.uno.RuntimeException
    message: unsatisfied query for interface of type com.sun.star.chart2.XCoordinateSystemContainer!

In chart2/source/tools/DiagramHelper.cxx, at this point:
    674 std::vector< Reference< XDataSeries > >
    675     DiagramHelper::getDataSeriesFromDiagram(
    676         const Reference< XDiagram > & xDiagram )
    677 {
    678     std::vector< Reference< XDataSeries > > aResult;

Each time the quoted log appears, it's because "xDiagram.is()" returns false.
Should we just return if it's the case or should "xDiagram.is()" return true?
Comment 6 Eike Rathke 2018-10-04 11:13:49 UTC
That exception is unrelated to the problem. Catching the exception there seems also sensible. However, simply returning the empty vector aResult in case of !xDiagram.is() looks like a valid short cut, but it wouldn't gain much performance because the exception is already thrown when the XCoordinateSystemContainer is queried with uno::UNO_QUERY_THROW.

Anyway, there's something wrong with the data range being assembled when inserting a Chart on an empty data area, the same happens with clicking the Chart icon.

Taking.
Comment 7 Commit Notification 2018-10-04 17:08:44 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cc354c104e09a2f35faf06a3df9d044ced94d6a9

Resolves: tdf#120238 remove wrong assert()

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Heiko Tietze 2018-10-05 11:37:22 UTC
No assertion with

Version: 6.2.0.0.alpha0+
Build ID: 42b629bc7f700d6f1d1b922e5c6aab119b8edf27
CPU threads: 8; OS: Linux 4.18; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); Calc: threaded