Bug 142692 - Python script connecting to LO instance fails
Summary: Python script connecting to LO instance fails
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version:
(earliest affected)
7.2.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Macro-Python
  Show dependency treegraph
 
Reported: 2021-06-07 01:30 UTC by Aron Budea
Modified: 2021-06-07 13:53 UTC (History)
2 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 Aron Budea 2021-06-07 01:30:29 UTC
Follow steps from bug 126582, copied below slightly modified:

1. Run LO Impress as `soffice --impress --accept="socket,host=localhost,port=2002;urp;StarOffice.ServiceManager"`
2. Dismiss a "Template" window, so you're left with a new presentation of a single slide
3. Run the attached python script, attachment 153018 [details] (it creates 2 new slides and puts a text on them)

=> Error when connecting to LO:
...
  File "test.py", line 16, in connectToLO
    return (desktop.CurrentComponent, smgr)
__main__.RuntimeException: Binary URP bridge disposed during call

Observed in LO 7.2.0.0.alpha1+ (e96554b67b17f9d3d91b0bb1f29ab0b9cdc43dcb) / Ubuntu.
No issue in 7.1.0.3.

This is a regression from the following commit. Adding CC: to Noel Grandin.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=857caa5fc69b92e781457a1b67a89aa051c2d70f
author		Noel Grandin <noel@peralex.com>	2021-04-30 13:00:35 +0200
committer	Noel Grandin <noel.grandin@collabora.co.uk>	2021-04-30 16:03:35 +0200

tdf#79049 speed up OOXML workbook load
Comment 1 Noel Grandin 2021-06-07 07:08:41 UTC
How do I  set up my environment so the script can run?

(Currently it can't find the uno import)
Comment 2 Aron Budea 2021-06-07 07:34:25 UTC
Not sure, I didn't have to do anything special in Ubuntu 20.04, and I haven't even built it with internal Python.

By the way, I can see the following in the console of the soffice process when running the script:

warn:sal.osl:3110642:3110738:sal/osl/unx/socket.cxx:1570: receive socket [0] failed: EOL
warn:binaryurp:3110642:3110738:binaryurp/source/reader.cxx:123: caught UNO exception 'N3com3sun4star3uno9ExceptionE msg: acc_socket.cxx:SocketConnection::read: error - Success /home/valaki/projects/libreoffice/io/source/acceptor/acc_socket.cxx:175'
warn:binaryurp:3110642:3110738:binaryurp/source/bridge.cxx:840: undisposed bridge "" in state 2, potential deadlock ahead
Comment 3 Noel Grandin 2021-06-07 07:36:36 UTC
Eh, I don't have a OS-installed LibreOffice, only a development build, so probably some PATH/etc stuff needs to be configured, but no idea what
Comment 4 Noel Grandin 2021-06-07 10:36:50 UTC
Are you sure about this bisect?

If I revert my commit, then run your test

(a) in gtk mode, I get a solid deadlock because of different threads taking different mutexes in different orders

(b) in gen mode, I get the same exception as without reverting my commit
Comment 5 Aron Budea 2021-06-07 13:53:08 UTC
(In reply to Noel Grandin from comment #4)
> Are you sure about this bisect?
I have now built LO at 857caa5fc69b92e781457a1b67a89aa051c2d70f, and got an error with the steps.
I have also built LO at 857caa5fc69b92e781457a1b67a89aa051c2d70f~1, and the steps succeeded.