Issue 122273 - CRASH / Hang when open document via FTP
CRASH / Hang when open document via FTP
Status: CLOSED FIXED
Product: General
Classification: Code
Component: ui
3.4.0
PC Windows 7
: P3 major (vote)
: 4.0.0
Assigned To: Ariel Constenla-Haile
Kay
:
: 96509 118276 (view as issue list)
Depends on: 122357
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-10 05:53 UTC by Rainer Bielefeld
Modified: 2013-06-10 04:47 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Rainer Bielefeld 2013-05-10 05:53:30 UTC
Steps how to reproduce with server installation of  "AOO 4.0.0-Dev – English UI / German locale [AOO400m1(Build:9700) - Rev. 1479897 (2013-05-09)]" on WIN7 Home Premium (64bit)", own separate user profile (Save new document, save, close and try to reopen):

0. From LibO Start Center menu 'Tools -> Options -> AOO -> General - use AOO 
   dialogs
1. From AOO Start Center open new Writer document, type few words into document
2. Menu  'File -> Save As - Filename=ftp://f0073d93@bielefeldundbuss.de' <Save>
   > After few seconds password dialog appears
3. type Password "cilbuPaQobiL", <ok>
   > After few moments folder contents will appear 
4. Type a new file name (not an existing one) like "MyNameCocument.odt" replacing
   old contents in File Name line
5. <Save>
   > document will be saved
6. Menu 'File -> Close'
   > Document closed
7. Menu 'File -> Open'
  > FTP folder contents shown
8. Double Click your new document
   Bug: AOO will hang (WIN message appears), has to be terminated

Additional Info:
a) might be related to "Bug 118276 - LibreOffice writer crashes after 
   Ctrl+click in a FTP hyperlink - Ubuntu 10.04 - LibreOffice/Openoffice 3.3.2"
b) Still Reproducible with server installation of  "AOO 4.0.0-Dev – English UI 
   / German locale [AOO400m1(Build:9700) - Rev. 1479897 (2013-05-09)]" 
   on WIN7 Home Premium (64bit)", own separate user profile
c) I think that never worked
d) Not a "Damaged document" problem, if you transfer the document to your HDD
   using FileZilla or similar you will see that the the documents can be opened
   without problems
e) Might be the same as "Bug 96509 - Crash when opening document over ftp"
Comment 1 Ariel Constenla-Haile 2013-06-01 06:27:01 UTC
(In reply to rainerbielefeld from comment #0)
>    Bug: AOO will hang (WIN message appears), has to be terminated

With 3.4.1 on Linux, I don't get a hang, but an error box:

General Error.
General input/output error.
Comment 2 Ariel Constenla-Haile 2013-06-01 09:14:10 UTC
The crash is reproducible on Windows 7
The problem is in http://svn.apache.org/viewvc/openoffice/trunk/main/ucb/source/ucp/ftp/ftpurl.cxx?revision=1413471&view=markup#l436

fclose(res)

res is NULL, flcose(NULL) is producing the crash. The problem comes from

FILE *res = tmpfile();

I get a "Permission denied" on Windows 7 with tmpfile().

On Linux, the problem is in FTPInputStream::readBytes()
http://svn.apache.org/viewvc/openoffice/trunk/main/ucb/source/ucp/ftp/ftpinpstr.cxx?revision=1413471&view=markup#l95

The algorithm is wrong, throws an exception when it cannot read all bytes requested.
Comment 3 SVN Robot 2013-06-01 17:16:49 UTC
"arielch" committed SVN 0 into trunk:
i122273 - Avoid using tmpfile()
Comment 4 Ariel Constenla-Haile 2013-06-01 17:20:52 UTC
Fixed on trunk by using our system abstraction layer instead of tmpfile()
Comment 5 Ariel Constenla-Haile 2013-06-01 17:49:06 UTC
*** Issue 118276 has been marked as a duplicate of this issue. ***
Comment 6 Rainer Bielefeld 2013-06-10 04:20:49 UTC
I did test due to original report, works fine. Thanks a lot for the fix!
Comment 7 Rainer Bielefeld 2013-06-10 04:44:26 UTC
I tested with server installation of  "AOO 4.0.0-Dev – English UI / German locale [AOO400m2(Build:9701)  -  Rev. 1489073  2013-06-03 13:48:37]" on WIN7 Home Premium (64bit)", own separate user profile
Comment 8 Rainer Bielefeld 2013-06-10 04:47:46 UTC
*** Issue 96509 has been marked as a duplicate of this issue. ***