Bug 143412 - CRASH: converting images ( steps in comment 12 )
Summary: CRASH: converting images ( steps in comment 12 )
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version:
(earliest affected)
7.2.0.1 rc
Hardware: All Linux (All)
: high critical
Assignee: Not Assigned
URL:
Whiteboard: target:7.3.0 target:7.2.0.2
Keywords: bibisected, bisected, regression, wantBacktrace
Depends on:
Blocks:
 
Reported: 2021-07-16 16:45 UTC by Callegar
Modified: 2021-07-22 13:23 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Basic code for function in TexMaths that crashes LO 7.2 (at line 189) (5.18 KB, text/plain)
2021-07-20 18:00 UTC, Roland Baudin
Details
Minimal macro + svg file (2.66 KB, application/zip)
2021-07-21 09:04 UTC, Roland Baudin
Details
SVG file (4.17 KB, image/svg+xml)
2021-07-21 09:27 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Callegar 2021-07-16 16:45:21 UTC
Description:
Trying to use the texmaths extension makes LibO 7.2RC1 crash.

From my understanding there is no guarantee for extensions to keep working when a new major release of LibO comes out because some interfaces may be changed or removed.  Still, an extension should never make the whole application crash, IMHO.

Steps to Reproduce:
1. Install the texmaths extension
2. Assure that you have LaTeX installed (e.g. via the TexLive or some other TeX distro or through your linux distribution, etc.)
3. Properly configure texmaths so that it can find the required LaTeX components (i.e., set up the paths of LaTeX, XeLaTeX, dvipng, dvisvgm correctly)
4. Start up draw or impress (but writer should also work)
5. Press the button to insert a texmath equation
6. Write x (the letter x) as the expression
7. Press the LaTeX or XeLaTeX button
 

Actual Results:
Libreoffice crashes

Expected Results:
Libreoffice should not crash. It can be acceptable for the extension to misbehave (the extension may need porting to the new major version of LibO), but the application should not crash.


Reproducible: Always


User Profile Reset: No



Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: DrawingDocument
[Information guessed from browser]
OS: Linux (All)
OS is 64bit: yes
Comment 1 Julien Nabet 2021-07-16 17:20:57 UTC
Would it be possible you attach a backtrace or do you know another extension with this same pb?
Indeed, I had tried once to install LaTeX, it's quite a big new world when you nothing about it like me.
Comment 2 Callegar 2021-07-16 20:38:58 UTC
Unfortunately at this time I do not know of other extensions crashing in the same way.

What is it needed to get a backtrace?

For what concerns LaTeX, it can be rather large to install. Easiest is if you are on a Linux distro, where you can probably just install some package test and then remove it. Alternatively texlive lets you do a completely "portable" install.

In any case, I'll try to contact the texmaths author who may be able to identify what is specifically disliked of the extension con in LibO 7.2.
Comment 3 QA Administrators 2021-07-17 03:43:40 UTC Comment hidden (obsolete)
Comment 4 Julien Nabet 2021-07-17 08:05:26 UTC
(In reply to sergio.callegari from comment #2)
> ...
> What is it needed to get a backtrace?
>...
Sorry, I had forgotten to provide the link:
https://wiki.documentfoundation.org/QA/BugReport/Debug_Information#GNU.2FLinux:_How_to_get_a_backtrace
Comment 5 Julien Nabet 2021-07-17 09:20:07 UTC
On pc Debian testing updated today x86-64 with master sources updated today too, I've installed texlive and dvipng + TexMaths 0.49 from https://extensions.libreoffice.org/en/extensions/show/texmaths-1, then I've given a try, no crash with gtk3, gen or kf5 rendering.

On console, I've noticed these logs:
warn:configmgr:122277:122277:configmgr/source/xcuparser.cxx:159: bad set node <prop> member in "file:///home/julien/lo/libreoffice/instdir/program/../program/../user/uno_packages/cache/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/lu4mvsa.tmp/Addons.xcu"
warn:configmgr:122277:122277:configmgr/source/xcuparser.cxx:904: ignoring modify of unknown set member node "ToolBarItems" in "file:///home/julien/lo/libreoffice/instdir/program/../program/../user/uno_packages/cache/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/lu4mvsa.tmp/Addons.xcu"
warn:configmgr:122277:122277:configmgr/source/xcuparser.cxx:159: bad set node <prop> member in "file:///home/julien/lo/libreoffice/instdir/program/../program/../user/uno_packages/cache/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/lu4mvsa.tmp/Addons.xcu"
warn:configmgr:122277:122277:configmgr/source/xcuparser.cxx:904: ignoring modify of unknown set member node "ToolBarItems" in "file:///home/julien/lo/libreoffice/instdir/program/../program/../user/uno_packages/cache/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/lu4mvsa.tmp/Addons.xcu"
...
warn:stoc:122277:122277:stoc/source/inspect/introspection.cxx:1612: object of type "com.sun.star.awt.XTopWindowListener" lacks XTypeProvider
warn:stoc:122277:122277:stoc/source/inspect/introspection.cxx:1612: object of type "com.sun.star.awt.XWindowListener" lacks XTypeProvider
warn:stoc:122277:122277:stoc/source/inspect/introspection.cxx:1612: object of type "com.sun.star.awt.XWindowListener" lacks XTypeProvider

for gtk3 specifically:
(soffice:122277): Gtk-CRITICAL **: 11:14:31.596: gtk_widget_show: assertion 'GTK_IS_WIDGET (widget)' failed

(soffice:122277): Gtk-CRITICAL **: 11:14:31.619: gtk_widget_set_sensitive: assertion 'GTK_IS_WIDGET (widget)' failed
(soffice:122277): GLib-GObject-WARNING **: 11:14:33.281: invalid (NULL) pointer instance

(soffice:122277): GLib-GObject-CRITICAL **: 11:14:33.281: g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(soffice:122277): GLib-GObject-WARNING **: 11:14:33.281: invalid (NULL) pointer instance
Comment 6 Roland Baudin 2021-07-20 18:00:56 UTC
Created attachment 173714 [details]
Basic code for function in TexMaths that crashes LO 7.2 (at line 189)
Comment 7 Roland Baudin 2021-07-20 18:03:35 UTC
Hi,

I am the author of the TexMaths extension. I was able to isolate the line that crashes LO 7.2:

oDispatcher.executeDispatch( oDrawDocCtrl.Frame, ".uno:ChangeBezier", "", 0, Array() )

This line 189 of the attached file ImportGraphicIntoTexMaths.bas.

Please note that this line worked in LO 7.1.x.
Comment 8 Julien Nabet 2021-07-20 18:17:21 UTC
(In reply to Roland Baudin from comment #7)
> Hi,
> 
> I am the author of the TexMaths extension. I was able to isolate the line
> that crashes LO 7.2:
> 
> oDispatcher.executeDispatch( oDrawDocCtrl.Frame, ".uno:ChangeBezier", "", 0,
> Array() )
> 
> This line 189 of the attached file ImportGraphicIntoTexMaths.bas.
> 
> Please note that this line worked in LO 7.1.x.

I dond't know if it's the same pb as Serge's one but I copied pasted the code in a brand new file, brand new macro.
Then I runned the macro and had:
at line 21 "cURL_ = cURL" this error message box:
"BASIC runtime error.
Argument is not optional."

Would it be possible you attach a minimum example file so when just running the macro we can reproduce the crash?
Comment 9 Roland Baudin 2021-07-21 09:04:43 UTC
Created attachment 173724 [details]
Minimal macro + svg file
Comment 10 Roland Baudin 2021-07-21 09:14:53 UTC
I have attached a complete example.

To reproduce the crash:

1. Download Test.zip and unzip it

2. Copy the Test.bas macro in Module1 and edit the line:

  cURL = "file:///home/test/tmpfile.svg"

to reflect the path to tmpfile.svg.

3. Run the Test macro in LO 7.2 => LO 7.2 crashes

4. Set the variable Group to FALSE at line 11 => LO 7.2 does not crash

5. When the variable Group is set to TRUE, the following code is executed (lines 31-39):

Dim oShapes as Variant
oShapes = createUnoService("com.sun.star.drawing.ShapeCollection")

Dim i as Integer
For i = 0 To oDrawPage.getCount()-1
   oShapes.add(oDrawPage.getByIndex(i))
Next

oDrawPage.group(oShapes)

and then LO 7.2 crahes at line 60:

oDispatcher.executeDispatch( oDrawDocCtrl.Frame, ".uno:ChangeBezier", "", 0, Array() )

If you set a breakpoint at this line, you will see the Draw document that is opened and you can check that the graphic elements are grouped, as desired.

There is no crash in LO 7.1.
Comment 11 Xisco Faulí 2021-07-21 09:23:23 UTC
I do reproduce it with the svg and the bas script provided in attachment 173724 [details]

Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=2ec1dab4693cd45b475f02452114dd96ec0bda1b

author	Noel <noel.grandin@collabora.co.uk>	2021-02-02 13:24:24 +0200
committer	Noel Grandin <noel.grandin@collabora.co.uk>	2021-02-02 16:02:29 +0100
commit 2ec1dab4693cd45b475f02452114dd96ec0bda1b (patch)
tree 789e865957c27936d3528989147f182c7a565c20
parent ebf4e535864f98f3b32799596ae16b752132da0a (diff)
use unique_ptr in SdrEditView::ImpConvertOneObj

Bisected with: bibisect-linux64-7.2

Adding Cc: to Noel Grandin
Comment 12 Xisco Faulí 2021-07-21 09:27:04 UTC
Created attachment 173725 [details]
SVG file

Actually the problem is in convert Obj. Steps:
1. Open attached svg file
2. Select it
3. Convert to Curve
4. Convert to Polygon

-> Crash
Comment 13 Commit Notification 2021-07-22 06:58:22 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/58c6fad213024ef8f162984a66af565ac9ad4b97

tdf#143412 CRASH: converting images

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 14 Commit Notification 2021-07-22 08:41:35 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/29df92dc04897796aa47815989c51f59975607fb

tdf#143412 CRASH: converting images

It will be available in 7.2.0.2.

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 15 Xisco Faulí 2021-07-22 13:23:08 UTC
Unittest added for this issue in https://git.libreoffice.org/core/+/d1099ec6220e098b9d7e263c9b7f873997ea9e30%5E%21