Created attachment 197937 [details] Data for quickly creating a Histogram chart Open attached document. Select the data. Insert Histogram chart with default values. Duplicate the sheet. => Crash Tested in Version: 25.2.0.0.alpha1+ (X86_64) / LibreOffice Community Build ID: 44ccd392be12dad23e216fb3eb2c2e5b275eee75 CPU threads: 32; OS: Windows 11 X86_64 (10.0 build 26100); UI render: Skia/Raster; VCL: win Locale: de-DE (de_DE); UI: en-US Calc: threaded
Created attachment 197939 [details] Backtrace I can confirm this crash in Version: 25.2.0.0.alpha1+ (X86_64) / LibreOffice Community Build ID: 383e3aef8438141bfc953f0cca094f6d3d7ed007 CPU threads: 12; OS: Linux 6.11; UI render: default; VCL: kf6 (cairo+wayland) Locale: en-US (en_US.UTF-8); UI: en-US Calc: CL threaded I have added a backtrace of the crash.
Maybe a dup of https://bugs.documentfoundation.org/show_bug.cgi?id=162147
can't repro on: Version: 25.2.0.0.alpha1+ (X86_64) / LibreOffice Community Build ID: ec4415d2a78b1c0fb5eab5baea88508d6b9db43b CPU threads: 20; OS: Linux 5.14; UI render: default; VCL: kf5 (cairo+xcb) Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded
The crash happens in https://opengrok.libreoffice.org/xref/core/chart2/source/tools/DataSourceHelper.cxx?r=d0fe2b9cf985bd77483a716c825734956f3dc828#285 uno::Reference< chart2::data::XLabeledDataSequence > xCategories( xDiagram->getCategories() ); The crash happens, because xDiagram is empty in the describes scenario having a histogram chart. It is not yet clear why xDiagram is empty.
HistogramChart class inherits from BarChart view which is responsible for rendering the histogram. However, when duplicating a sheet, the chart might not be fully initialized or reattached to the new sheet’s context? I will look in this further, this is what I suspect, could be one of the possibility.
Right now I am in this file with debugger - chart2/source/tools/AxisHelper.cxx#181 else if( xChartDoc.is() && xChartDoc->hasInternalDataProvider() && nDimensionIndex == 0 ) //maybe date axis { rtl::Reference< Diagram > xDiagram( xChartDoc->getFirstChartDiagram() ); if( xDiagram->isSupportingDateAxis() ) { nNumberFormatKey = DiagramHelper::getDateNumberFormat( xChartDoc ); } else { rtl::Reference< DataSource > xSource = DataSourceHelper::getUsedData( *xChartDoc ); if( xSource.is() ) { std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aXValues( DataSeriesHelper::getAllDataSequencesByRole( xSource->getDataSequences(), u"values-x"_ustr ) ); if( aXValues.empty() ) { uno::Reference< chart2::data::XLabeledDataSequence > xCategories( xDiagram->getCategories() ); if( xCategories.is() ) { Reference< data::XDataSequence > xSeq( xCategories->getValues()); if( xSeq.is() ) { bool bHasValidDoubles = false; double fTest=0.0; Sequence< uno::Any > aCats( xSeq->getData() ); sal_Int32 nCount = aCats.getLength(); for( sal_Int32 i = 0; i < nCount; ++i ) { if( (aCats[i]>>=fTest) && !std::isnan(fTest) ) { bHasValidDoubles=true; break; } } if( bHasValidDoubles ) nNumberFormatKey = DiagramHelper::getDateNumberFormat( xChartDoc ); } } } } } bFormatSet = true; }