Bug 155037 - Crash in: rtl_uString_new when attempting to copy sheet to a sheet containing VBA macro
Summary: Crash in: rtl_uString_new when attempting to copy sheet to a sheet containin...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.0 all versions
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Xisco Faulí
URL:
Whiteboard: target:7.6.0 target:7.5.4
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-26 22:08 UTC by Michael
Modified: 2023-05-08 08:35 UTC (History)
1 user (show)

See Also:
Crash report or crash signature: ["rtl_uString_new"]


Attachments
histogram.xls containing binHistogram macro for counting data (24.50 KB, application/vnd.ms-excel)
2023-04-26 22:08 UTC, Michael
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael 2023-04-26 22:08:29 UTC
Created attachment 186946 [details]
histogram.xls containing binHistogram macro for counting data

This bug was filed from the crash reporting server and is br-6353002a-03d3-4359-8301-6d1021d2fb70.
=========================================
I hit this on an old version 7.3.3.  I upgraded to the latest and reproduced it the same way
7.5.2.2 (x86_64)
https://git.libreoffice.org/core/+log/53bb9681a964705cf672590721dbc85eb4d0c3a2
I'm running windows 10 22H2

I'm wanted to use a VBA macro I had in Excel, so I made the following settings:
Tools\Options\LibreOffice\Security\Macro Security - Medium
Tools\Options\Load/Save\VBA Properties - all boxes checked

load histogram.xls (attached) containing VBA macro - confirm enable macros

save as history_test.ods

click new
type 1 in first cell
rename sheet from "Sheet1" to "Data"
right click "Data" tab / Move/Copy Sheet / copy to document "histogram_test.ods"
Make sure "Copy" not "Move" is selected, then click the big "Copy" button at the bottom.

"Due to an error, LibreOffice crashed.... "

When I restart Calc, it runs through recovery
https://crashreport.libreoffice.org/stats/crash_details/6353002a-03d3-4359-8301-6d1021d2fb70

Most times the data was not copied, but one time when I was doing this with real data it actually had the copied sheet in the file with the macro when it was  recovered.

If you have trouble reproducing this, let me know.  I should be able to do it again and give more details.


Here's some mother crash reports for this issue:
First time, copied multiple tabs of data:
https://crashreport.libreoffice.org/stats/crash_details/0c8eae5f-a200-43f9-8800-d1e929f05077

Tried copying only one tab of data.  (This time data got copied when file was recovered.)
https://crashreport.libreoffice.org/stats/crash_details/fcfe19f2-7ec1-4c19-922b-368a25594b4d

Tried again with page containing very little data
https://crashreport.libreoffice.org/stats/crash_details/6f3a2063-5bb6-4598-b2e9-38db95f2faba

Tried loading file containing macro, but with with macros disabled.  It still crashed.
https://crashreport.libreoffice.org/stats/crash_details/23c87c1a-0828-4ca4-98e8-e119965896ab

Updated to latest version and retested repro steps to generate the main crash report linked to this bug report.
Comment 1 Xisco Faulí 2023-05-03 16:00:49 UTC
Reproduced in

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d5565b70bc6d3d263e1cc50fa1f343f4e1a428fe
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded

Steps to reproduce:
1. Open attached document
2. Create a new calc document
3. Right click on the sheet name - Move or copy sheet
4. Copy to the first document

-> Crash
Comment 2 Xisco Faulí 2023-05-03 16:34:05 UTC
Also reproduced in

Version: 5.0.2.2
Build ID: 37b43f919e4de5eeaca9b9755ed688758a8251fe
Locale: es-ES (es_ES.UTF-8)
Comment 3 Xisco Faulí 2023-05-03 16:36:14 UTC
And in

Version 4.0.2.2 (Build ID: 4c82dcdd6efcd48b1d8bba66bfe1989deee49c3)
Comment 4 Commit Notification 2023-05-04 10:12:34 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

tdf#155037: check source code name exists

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.
Comment 5 Commit Notification 2023-05-05 08:50:00 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/0e4b219337fc4df1ae58f3f257ea3990b615f983

tdf#155037: check source code name exists

It will be available in 7.5.4.

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.
Comment 6 Michael 2023-05-06 04:41:57 UTC
I tested this in the 7.6.0.0 daily build version below, and it works great now.  Thanks!!  
Would you like me to verify the 7.5.4 daily build as well?


Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 3bc7cc14706f47d740dfc5715970054922ca470c
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 7 Xisco Faulí 2023-05-08 08:35:46 UTC
(In reply to Michael from comment #6)
> I tested this in the 7.6.0.0 daily build version below, and it works great
> now.  Thanks!!  
> Would you like me to verify the 7.5.4 daily build as well?
> 
> 
> Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
> Build ID: 3bc7cc14706f47d740dfc5715970054922ca470c
> CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL:
> win
> Locale: en-US (en_US); UI: en-US
> Calc: CL threaded

Thanks for doublechecking. Setting this ticket to VERIFIED
No, no need to verify it with 7.5.4. it should also be OK there if it works on master