Bug 143200 - Crash: Assertion failing when pasting a cell to a large-height range
Summary: Crash: Assertion failing when pasting a cell to a large-height range
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.3.0.0 alpha0+
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.6.0
Keywords: haveBacktrace
Depends on:
Blocks: Crash-Assert
  Show dependency treegraph
 
Reported: 2021-07-05 12:23 UTC by Mike Kaganski
Modified: 2023-04-18 08:10 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2021-07-05 12:23:10 UTC
In a DBGUTIL build:

1. In a Calc sheet, select all rows (e.g., click on any column header to select a column completely, from row 1 to 1048576);
2. Format->Rows->Height;
3. Set to 3 cm;
4. Put "1" to A1;
5. Select A1 -> Ctrl+C
6. Select A2:A1048576 -> Ctrl+V.

-> "assert( nNum <= std::numeric_limits<sal_Int32>::max( ))" fires at Fraction::Fraction.

Caolan: enabling that assert was from https://git.libreoffice.org/core/+/d430865f35b74706cd7a9b3cdab8084bc2068986 (I enjoy its brevity! :-D), after disabling in https://git.libreoffice.org/core/+/7c98711c5ac80214901bf0c284bdb127d41d345c. And Noel had initially added it in https://git.libreoffice.org/core/+/331e2e5ed3bf4e0b2c1fab3b7bca836170317827.
Comment 1 Caolán McNamara 2021-07-05 14:03:05 UTC
yeah, I had accidentally removed that assert when playing around with something else so you can ignore that removal+readd
Comment 2 Aron Budea 2021-07-05 21:05:25 UTC
I'm not getting an assert in the following debug build:
LO 7.3.0.0.alpha0+ (00d0d8f58cefb76bf9a8867228af1d6c9a9a5ad3) / Ubuntu.

Is there anything specific about the repro steps? Eg. for step 6, I first select column A, then edit the range in the names box on the toolbar to A2:A1048576, press Enter and then Ctrl + V, but I don't think that should matter.
Comment 3 Mike Kaganski 2021-07-05 21:08:10 UTC
(In reply to Aron Budea from comment #2)
> Is there anything specific about the repro steps? Eg. for step 6, I first
> select column A, then edit the range in the names box on the toolbar to
> A2:A1048576, press Enter and then Ctrl + V, but I don't think that should
> matter.

No, nothing special. But maybe try to make height in step 3 a bit larger - say, 10 cm. I only wanted to have the smallest round number that triggers the problem, but ...
Comment 4 Noel Grandin 2021-07-06 10:08:44 UTC
Cannot reproduce on Linux, maybe Windows-specific?
Comment 5 Mike Kaganski 2021-07-06 10:48:46 UTC
Looks so, but I'm actually surprised, because the call stack wasn't looking platform-specific:

> tllo.dll!Fraction::Fraction(__int64 nNum, __int64 nDen) Line 56
> 	at C:\lo\src\core\tools\source\generic\fract.cxx(56)
> sclo.dll!ScDrawLayer::CopyFromClip(ScDrawLayer * pClipModel, short nSourceTab, const tools::Rectangle & rSourceRange, const ScAddress & rDestPos, const tools::Rectangle & rDestRange) Line 1872
> 	at C:\lo\src\core\sc\source\core\data\drwlayer.cxx(1872)
> sclo.dll!ScTable::CopyOneCellFromClip(sc::CopyFromClipContext & rCxt, const short nCol1, const long nRow1, const short nCol2, const long nRow2, const long nSrcRow, const ScTable * pSrcTab) Line 179
> 	at C:\lo\src\core\sc\source\core\data\table7.cxx(179)
> sclo.dll!ScDocument::CopyOneCellFromClip(sc::CopyFromClipContext & rCxt, short nCol1, long nRow1, short nCol2, long nRow2) Line 140
> 	at C:\lo\src\core\sc\source\core\data\document10.cxx(140)
> sclo.dll!ScDocument::CopyFromClip(const ScRange & rDestRange, const ScMarkData & rMark, InsertDeleteFlags nInsFlag, ScDocument * pRefUndoDoc, ScDocument * pClipDoc, bool bResetCut, bool bAsLink, bool bIncludeFiltered, bool bSkipAttrForEmpty, const ScRangeList * pDestRanges) Line 2921
> 	at C:\lo\src\core\sc\source\core\data\document.cxx(2921)
> sclo.dll!ScViewFunc::PasteFromClip(InsertDeleteFlags nFlags, ScDocument * pClipDoc, ScPasteFunc nFunction, bool bSkipEmpty, bool bTranspose, bool bAsLink, InsCellCmd eMoveMode, InsertDeleteFlags nUndoExtraFlags, bool bAllowDialogs) Line 1366
> 	at C:\lo\src\core\sc\source\ui\view\viewfun3.cxx(1366)
> sclo.dll!ScClipUtil::PasteFromClipboard(ScViewData & rViewData, ScTabViewShell * pTabViewShell, bool bShowDialog) Line 94
> 	at C:\lo\src\core\sc\source\ui\view\cliputil.cxx(94)
> sclo.dll!ScCellShell::ExecuteEdit(SfxRequest & rReq) Line 1298
> 	at C:\lo\src\core\sc\source\ui\view\cellsh1.cxx(1298)
> sclo.dll!SfxStubScCellShellExecuteEdit(SfxShell * pShell, SfxRequest & rReq) Line 7496
> 	at C:\lo\src\build\workdir\SdiTarget\sc\sdi\scslots.hxx(7496)
> sfxlo.dll!SfxDispatcher::Call_Impl(SfxShell & rShell, const SfxSlot & rSlot, SfxRequest & rReq, bool bRecord) Line 256
> 	at C:\lo\src\core\sfx2\source\control\dispatch.cxx(256)
> sfxlo.dll!SfxDispatcher::Execute_(SfxShell & rShell, const SfxSlot & rSlot, SfxRequest & rReq, SfxCallMode eCallMode) Line 753
> 	at C:\lo\src\core\sfx2\source\control\dispatch.cxx(753)
> sfxlo.dll!SfxBindings::Execute_Impl(SfxRequest & aReq, const SfxSlot * pSlot, SfxShell * pShell) Line 1061
> 	at C:\lo\src\core\sfx2\source\control\bindings.cxx(1061)
> sfxlo.dll!SfxDispatchController_Impl::dispatch(const com::sun::star::util::URL & aURL, const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & aArgs, const com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> & rListener) Line 786
> 	at C:\lo\src\core\sfx2\source\control\unoctitm.cxx(786)
> sfxlo.dll!SfxOfficeDispatch::dispatch(const com::sun::star::util::URL & aURL, const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & aArgs) Line 231
> 	at C:\lo\src\core\sfx2\source\control\unoctitm.cxx(231)
> svtlo.dll!svt::`anonymous namespace'::AsyncAccelExec::impl_ts_asyncCallback(LinkParamNone * __formal) Line 482
> 	at C:\lo\src\core\svtools\source\misc\acceleratorexecute.cxx(482)
> svtlo.dll!svt::`anonymous namespace'::AsyncAccelExec::LinkStubimpl_ts_asyncCallback(void * instance, LinkParamNone * data) Line 474
> 	at C:\lo\src\core\svtools\source\misc\acceleratorexecute.cxx(474)
> vcllo.dll!Link<LinkParamNone *,void>::Call(LinkParamNone * data) Line 111
> 	at C:\lo\src\core\include\tools\link.hxx(111)
> vcllo.dll!vcl::EventPoster::DoEvent_Impl(void * __formal) Line 53
> 	at C:\lo\src\core\vcl\source\helper\evntpost.cxx(53)
> vcllo.dll!vcl::EventPoster::LinkStubDoEvent_Impl(void * instance, void * data) Line 48
> 	at C:\lo\src\core\vcl\source\helper\evntpost.cxx(48)
> vcllo.dll!Link<void *,void>::Call(void * data) Line 111
> 	at C:\lo\src\core\include\tools\link.hxx(111)
> vcllo.dll!ImplHandleUserEvent(ImplSVEvent * pSVEvent) Line 2017
> 	at C:\lo\src\core\vcl\source\window\winproc.cxx(2017)
> vcllo.dll!ImplWindowFrameProc(vcl::Window * _pWindow, SalEvent nEvent, const void * pEvent) Line 2585
> 	at C:\lo\src\core\vcl\source\window\winproc.cxx(2585)
> vcllo.dll!SalFrame::CallCallback(SalEvent nEvent, const void * pEvent) Line 306
> 	at C:\lo\src\core\vcl\inc\salframe.hxx(306)
> vclplug_winlo.dll!ImplHandleUserEvent(HWND__ * hWnd, __int64 lParam) Line 4147
> 	at C:\lo\src\core\vcl\win\window\salframe.cxx(4147)
> vclplug_winlo.dll!SalFrameWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam, bool & rDef) Line 5793
> 	at C:\lo\src\core\vcl\win\window\salframe.cxx(5793)
> vclplug_winlo.dll!SalFrameWndProcW(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 5900
> 	at C:\lo\src\core\vcl\win\window\salframe.cxx(5900)
> user32.dll!00007ffd616fe858()
> user32.dll!00007ffd616fe299()
> vclplug_winlo.dll!ImplSalDispatchMessage(const tagMSG * pMsg) Line 406
> 	at C:\lo\src\core\vcl\win\app\salinst.cxx(406)
> vclplug_winlo.dll!ImplSalYield(bool bWait, bool bHandleAllCurrentEvents) Line 437
> 	at C:\lo\src\core\vcl\win\app\salinst.cxx(437)
> vclplug_winlo.dll!WinSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents) Line 512
> 	at C:\lo\src\core\vcl\win\app\salinst.cxx(512)
> vcllo.dll!ImplYield(bool i_bWait, bool i_bAllEvents) Line 465
> 	at C:\lo\src\core\vcl\source\app\svapp.cxx(465)
> vcllo.dll!Application::Yield() Line 533
> 	at C:\lo\src\core\vcl\source\app\svapp.cxx(533)
> vcllo.dll!Application::Execute() Line 444
> 	at C:\lo\src\core\vcl\source\app\svapp.cxx(444)
> sofficeapp.dll!desktop::Desktop::Main() Line 1602
> 	at C:\lo\src\core\desktop\source\app\app.cxx(1602)
> vcllo.dll!ImplSVMain() Line 199
> 	at C:\lo\src\core\vcl\source\app\svmain.cxx(199)
> vcllo.dll!SVMain() Line 232
> 	at C:\lo\src\core\vcl\source\app\svmain.cxx(232)
> sofficeapp.dll!soffice_main() Line 98
> 	at C:\lo\src\core\desktop\source\app\sofficemain.cxx(98)
> soffice.bin!sal_main() Line 49
> 	at C:\lo\src\core\desktop\source\app\main.c(49)
> soffice.bin!main(int argc, char * * argv) Line 47
> 	at C:\lo\src\core\desktop\source\app\main.c(47)
> soffice.bin!invoke_main() Line 79
> 	at d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(79)
> soffice.bin!__scrt_common_main_seh() Line 288
> 	at d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(288)
> soffice.bin!__scrt_common_main() Line 331
> 	at d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(331)
> soffice.bin!mainCRTStartup(void * __formal) Line 17
> 	at d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp(17)

Sorry for not mentioning version info:

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 5f843dc41e42aaac362b0dc82a8344fba120e086
CPU threads: 12; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL
Comment 6 Stéphane Guillou (stragu) 2023-03-20 23:32:53 UTC
Mike, are you still able to reproduce this one?
Comment 7 Mike Kaganski 2023-03-21 07:47:37 UTC
(In reply to Stéphane Guillou (stragu) from comment #6)
Yes.
Comment 8 QA Administrators 2023-03-22 03:24:16 UTC Comment hidden (noise, obsolete)
Comment 9 Commit Notification 2023-04-18 05:52:42 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/b1684730ccbbca83df4dcb07d4759eebebbc4d66

tdf#143200 assert when pasting a cell to a large-height range

It will be available in 7.6.0.

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

Affected users are encouraged to test the fix and report feedback.