[Libreoffice-bugs] [Bug 125924] New: Exporting xls/rhbz499466-2.xls to PDF triggers undefined conversion from NaN to int

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Fri Jun 14 15:58:40 UTC 2019


https://bugs.documentfoundation.org/show_bug.cgi?id=125924

            Bug ID: 125924
           Summary: Exporting xls/rhbz499466-2.xls to PDF triggers
                    undefined conversion from NaN to int
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Chart
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: sbergman at redhat.com
                CC: quikee at gmail.com

(With <https://gerrit.libreoffice.org/#/c/74055/> "Avoid
-fsanitize=float-divide-by-zero" out of the way:)  At least on recent master,
`--convert-to pdf xls/rhbz499466-2.xls` with xls/rhbz499466-2.xls as obtained
by bin/get-bugzilla-attachments-by-mimetype (i.e., the attachment at
<https://bugzilla.redhat.com/show_bug.cgi?id=499466#c1>):

> chart2/source/view/charttypes/VSeriesPlotter.cxx:1342:33: runtime error: nan is outside the range of representable values of type 'int'
>  #0 in chart::VSeriesPlotter::createRegressionCurvesShapes(chart::VDataSeries const&, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, bool) at chart2/source/view/charttypes/VSeriesPlotter.cxx:1342:33
>  #1 in chart::AreaChart::impl_createSeriesShapes() at chart2/source/view/charttypes/AreaChart.cxx:539:17 (instdir/program/../program/libchartcorelo.so +0x2428578)
>  #2 in chart::AreaChart::createShapes() at chart2/source/view/charttypes/AreaChart.cxx:965:5
>  #3 in chart::ChartView::impl_createDiagramAndContent(chart::CreateShapeParam2D const&, com::sun::star::awt::Size const&) at chart2/source/view/main/ChartView.cxx:1608:25
>  #4 in chart::ChartView::createShapes2D(com::sun::star::awt::Size const&) at chart2/source/view/main/ChartView.cxx:3037:41
>  #5 in chart::ChartView::createShapes() at chart2/source/view/main/ChartView.cxx:2506:5
[...]

The problem is that in

>         if( !bAverageLine )
>         {
>             rVDataSeries.getMinMaxXValue(fMinX, fMaxX);
>             fMaxX += aExtrapolateForward;
>             fMinX -= aExtrapolateBackward;
> 
>             fPointScale = (fMaxX - fMinX) / (fChartMaxX - fChartMinX);
>             fPointScale = std::min(fPointScale, 1000.0);
>         }

(VSeriesPlotter::createRegressionCurvesShapes,
chart2/source/view/charttypes/VSeriesPlotter.cxx) the call to
VDataSeries::getMinMaxXValue sets fMinX and fMaxX to NaN, so fPointScale is set
to NaN, and the later

>         sal_Int32 nPointCount = 100 * fPointScale;

causes undefined behavior.  That code got updated, if not introduced with
<https://gerrit.libreoffice.org/plugins/gitiles/core/+/9408a1d008487cbeafd2dc4705eda2fae9547aab%5E!>
"Draw MeanValue in chart bounds, smarter define no. of curve points."

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20190614/8116f5c8/attachment.html>


More information about the Libreoffice-bugs mailing list