Bug 143514 - Crash when closing document after clearContents in dbgutil build
Summary: Crash when closing document after clearContents in dbgutil build
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:7.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-23 15:14 UTC by Mike Kaganski
Modified: 2021-08-19 08:14 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Macro in the document results in crash when closing (8.78 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-07-23 15:14 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2021-07-23 15:14:04 UTC
Created attachment 173807 [details]
Macro in the document results in crash when closing

Open the attached document in a dbgutil build, and run the macro "crash" in it. Then close the document => crash.

The macro is

Sub crash()
	doc = thisComponent
	scene = doc.createInstance("com.sun.star.drawing.Shape3DSceneObject")
	doc.DrawPages(0).add(scene)
	scene.add(doc.createInstance("com.sun.star.drawing.Shape3DCubeObject"))
	sheet = doc.Sheets(0).clearContents(1023)
'	doc.close(false)
End Sub

It basically adds a scene to the document's draw page, a cube to the scene, then calls clearContents on the sheet.
Comment 1 Mike Kaganski 2021-07-23 15:39:38 UTC
https://gerrit.libreoffice.org/c/core/+/119433
Comment 2 Commit Notification 2021-07-23 18:07:40 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6362c905cf19f2f6cb67bf634091b14c2a8e90ec

tdf#143514: Avoid double-free in dbgutil code

It will be available in 7.3.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 3 Julien Nabet 2021-08-19 08:14:38 UTC
It brought some regression see last comment of tdf#117162