Issue 14255 - Resaving template to same name causes error
Summary: Resaving template to same name causes error
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: OOo 1.1 Beta2
Hardware: PC All
: P2 Trivial (vote)
Target Milestone: ---
Assignee: mikhail.voytenko
QA Contact: issues@sw
URL:
Keywords: oooqa
: 17725 (view as issue list)
Depends on:
Blocks:
 
Reported: 2003-05-08 19:47 UTC by Unknown
Modified: 2013-08-07 14:42 UTC (History)
1 user (show)

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


Attachments
Stack dump reproduced thanks to Valgrind on RH8 (6.30 KB, text/plain)
2003-07-06 03:28 UTC, dankegel
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Unknown 2003-05-08 19:47:17 UTC
Steps:

1) Create a new text document. 
2) File | Templates | Save and assign it a name.
3) Close it.
4) File | Templates | Edit and choose the newly created template.
5) File | Templates | Save and choose the same name.
6) When the overwrite dialog appears, choose Yes

Observed: Error writing <filename> as template. General Error. General 
input/output error.
Expected: No error.

Notes: It appears that I don't need to use this technique to save a changed 
template, but can simply use File | Save, but I can't find that documented 
anywhere. However, if I can do it, it shouldn't crash.
Comment 1 Unknown 2003-05-29 22:27:00 UTC
Still a problem in 1.1Beta2
Comment 2 dankegel 2003-07-06 03:26:31 UTC
Was able to reproduce on Linux thanks to Valgrind.  Stack dump to
follow.  The stack dump says osl_destroyMutex is being called when the
mutex is still in use.

Tamar, thanks for the excellent report!
Comment 3 dankegel 2003-07-06 03:28:08 UTC
Created attachment 7434 [details]
Stack dump reproduced thanks to Valgrind on RH8
Comment 4 h.ilter 2003-07-07 11:06:36 UTC
HI->MBA: Could not reproduce, but the stack seems to belong to you.
Comment 5 Mathias_Bauer 2003-07-09 15:44:58 UTC
Michael, please hava a look
Comment 6 mikhail.voytenko 2003-07-10 11:16:21 UTC
Can not reproduce neither in latest 1.1RC build no in 1.1Beta2.
The scenario works pretty well for me, the template is overwritten
successfully.

Unfortunatelly the function call stack does not provide enough
information to detect the occured problem. The debug information
for libucb1.so and libucbhier1.so libraries would help.
Comment 7 mikhail.voytenko 2003-07-10 13:34:37 UTC
Further investigations shows that there is a possible place in UCB
core code where a mutex can be locked forever.
Comment 8 mikhail.voytenko 2003-07-10 13:35:45 UTC
.
Comment 9 mikhail.voytenko 2003-07-11 08:20:31 UTC
The problem in UCB is fixed. Not really sure that the problem is
related to this bug, since I can not reproduce it. But in case for any
reason a 'RuntimeException' was thrown in 'PersistentPropertySet'
methods 'setPropertyValue()' or 'getPropertyValue()' the mutex of the
class could stay locked forever. So destruction of the class could
cause stack similar to the provided one.
Comment 10 mikhail.voytenko 2003-07-11 10:40:52 UTC
The original descryption of the bug mentiones not only crash but also
an error that should not take place. The error is reproducible on
systems with file locking. The cause of the error is that document is
not set to HandsOff state before saving. This is something that should
be implemented for OOo2.0.
A new issue i16712 is created.
Comment 11 mikhail.voytenko 2003-07-11 11:48:52 UTC
Just to finalize, the fix for this bug fixes only possibility of
forever locked mutex in UCB.

Verified in fwk2rc31 workspace.
Comment 12 dankegel 2003-07-12 19:21:20 UTC
Mikhail, you said you can't reproduce this bug.
Have you tried Valgrind (assuming you have an x86 Linux box)?
That should let you reproduce the problem easily... 
see http://kegel.com/openoffice/#valgrind
Comment 13 mikhail.voytenko 2003-07-14 11:57:33 UTC
Yes, I have tried Valgrind.
Unfortunatelly it didn't help to reproduce the problem.
However it provided a valuable information about uninitialized variables.
Comment 14 dankegel 2003-07-22 16:43:44 UTC
Added keyword 'valgrind' since it helped resolve this issue.
Comment 15 mikhail.voytenko 2003-07-23 13:21:05 UTC
The UCB bugfix is successfully integrated to master workspace => closed.
Comment 16 kai.sommerfeld 2003-08-27 15:24:42 UTC
KSO: Michail's changes in the UCB code definitely fix the problem.
The mutex got not only locked forever in case of exceptions, even
worse, it got locked whenever
PersistentPropertySet::setPropertyValues() was called and at least one
property actually was changed and no propertychange listeners were
registered. And exactly this happened in the bug scenario.
Comment 17 kai.sommerfeld 2003-08-27 15:26:46 UTC
*** Issue 17725 has been marked as a duplicate of this issue. ***