Issue 90220 - OOo deadlocks when attempting to paste into Zotero interface
Summary: OOo deadlocks when attempting to paste into Zotero interface
Status: CLOSED NOT_AN_OOO_ISSUE
Alias: None
Product: Writer
Classification: Application
Component: programming (show other issues)
Version: OOo 2.4.0
Hardware: PC Windows XP
: P2 Trivial with 1 vote (vote)
Target Milestone: ---
Assignee: Mathias_Bauer
QA Contact: issues@sw
URL:
Keywords: crash
: 91179 (view as issue list)
Depends on:
Blocks:
 
Reported: 2008-06-01 16:40 UTC by username132
Modified: 2013-08-07 14:43 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
stack of two threads: Main thread starts macro execution and another thread tries to paste (5.61 KB, text/plain)
2008-07-10 14:02 UTC, Oliver Specht
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description username132 2008-06-01 16:40:59 UTC
I have some documents in my Zotero bibliographic database. When I click on the
'insert citation' button in OOo Writer, and right click in the search box and
select 'paste' from the context-menu, OOo crashes and must be closed via Windows
Task Manager.
Comment 1 username132 2008-06-01 16:54:39 UTC
Further information needed to replicate problem properly (needs Zotero
installed; Zotero is a citation manager and is an extension for Firefox):

Create a new Writer document and type something (anything; e.g. fgfgfgdg).
Select part or all of what you typed and copy to clipboard via your preferred
method (mine being Ctrl + C). Now click the 'add citation' button on the OOo
Writer toolbar and chose a citation style (it really doesn't matter which). Now,
in the search bar in the newly-present dialogue, right click and select paste.
With a bit of luck, OpenOffice should now have crashed and require termination.
Comment 2 michael.ruess 2008-06-02 09:27:06 UTC
Reassigned to SBA.
Comment 3 username132 2008-07-02 19:38:05 UTC
I reported this issue at the Zotero forum and they provide some insight:
http://forums.zotero.org/discussion/3064/bug-report-openoffice-writer-crash-when-pasting-from-clipboard-into-zotero-interface-search/#Item_11
Comment 4 michael.ruess 2008-07-09 15:49:56 UTC
*** Issue 91179 has been marked as a duplicate of this issue. ***
Comment 5 michael.ruess 2008-07-09 15:53:58 UTC
MRU->OS: please have a look where in Writer this might be located. Currently in
OO 3.0 there's a Basic runtime error when trying to use zotero (issue 91520).
But in OO 2.4.1 i could confirm this.
Comment 6 Oliver Specht 2008-07-10 12:12:50 UTC
There's no crash but a deadlock.

In the main thread SfxMacroLoader::dispatch() aquires the SolarMutex before
calling the macros.
In a second thread the TransferableHelper::getTransferData waits to get the same
Mutex.

->mba: Can we do anything to fix it?
Comment 7 Mathias_Bauer 2008-07-10 13:50:10 UTC
The SolarMutex alone can't create a deadlock. So the problem is that the thread
owning the mutex is blocked somewhere. This seems to be the bug we need to fix.
Can you see where the thread containing the macro execution is hanging?
Comment 8 Oliver Specht 2008-07-10 14:02:53 UTC
Created attachment 55050 [details]
stack of two threads: Main thread starts macro execution and another thread tries to paste
Comment 9 Mathias_Bauer 2008-07-10 14:43:15 UTC
The thread looks as if the Python UNO Bridge stops the thread it is called in
and waits until another thread is ready. This is a complete disaster.

Fixing this could be done by

- releasing the SolarMutex before calling the Python macro 
- eliminating the thread change in PyUNO

The first will greatly enhance the chance for a crash and the second one is
something I can't judge as I don't know the background. 

I hope Jörg Budischewsky is still lurking and so I cc him.
Comment 10 joergbudi 2008-07-11 20:47:38 UTC
Hi,

imho the issue should be assigned to the zotero implementer (or marked as 
invalid) . Just downloaded the extension from 

http://www.zotero.org/documentation/openoffice_integration

there are just 15 lines of python code, the relevant three lines are

        h1=httplib.HTTPConnection("127.0.0.1:50001")
        h1.request("POST","",q,headers)
        response=h1.getresponse()

, so the extension does a RPC call to some server, the RPC Call does not return 
for whatever reason and thus blocks the office. 

Bye,

Joerg
Comment 11 Mathias_Bauer 2008-07-12 10:22:58 UTC
Thanks for the help, Jörg!
I will try to get in touch with them, someone from the bibliography project
seems to be very interested in the Zotero OOo support.
Comment 12 Mathias_Bauer 2008-09-01 12:00:16 UTC
The problem will be fixed in Zotero. Here's the reply of Dan Stillman from Zotero:

We're going to try to switch to async HTTP calls to avoid blocking the 
thread. This will probably require adding something like a non-modal 
"Waiting for Zotero..." dialog box that closes automatically when the 
async request completes. Ticket created: 
https://www.zotero.org/trac/ticket/1069

So I think that we can close the issue for OOo.
Comment 13 Mathias_Bauer 2008-09-01 12:00:31 UTC
closing