Issue 77971

Summary: OOo abnormal end when open the “.pdf â€in unicode
Product: General Reporter: bstqc_caozy <caozy>
Component: codeAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues, stephan.bergmann.secondary
Version: OOo 2.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
stacktrace showing the crash
none
will crash the office none

Description bstqc_caozy 2007-05-31 06:33:51 UTC
1.create a Calc document;
2.input something randomly,just like input "1111â€in one cellï¼›
3.click the button of "Export Directly as PDF" on the toolbar,name the file as 
test.pdf,and save it; 
4.choose "visible Button->Load URL";
5.input the url of test.pdf in LoadURF blank,then enter,select unicode in the 
dialogue of "ASCII Filter Options",click okï¼› 
6.OOo end without error message 
same problem also happen in Writer.
Comment 1 bstqc_caozy 2007-05-31 10:28:19 UTC
Same issue exists in Impress,Drawing and Database.
Besides pdf file,same issue happen when open music,movie,exe,rar etc
Comment 2 shaunmcdonald131 2007-05-31 20:09:32 UTC
OpenOffice.org is not meant to be able to open PDF files. To open PDF files you
need a PDF viewer like Adobe Reader or Apple's Preview.
Comment 3 bstqc_caozy 2007-06-01 02:32:04 UTC
But i still think OOo should not end without error message.
Comment 4 bstqc_caozy 2007-06-01 03:57:36 UTC
Through the "insert->Link to External Data" and select a pdf and Unicode, OOo 
also collapse. 
Comment 5 peter.junge 2007-06-01 04:07:30 UTC
Hi,
I would even say it should not crash at all. No matter, with or without error
message. Component should be 'framework', if more that one application is affected.
BTW, cannot reproduce it for OOo2.1 using Linux.
@bstqc_caozy: Do you use a Chinese version? This is maybe important.
Peter
Comment 6 bstqc_caozy 2007-06-01 04:35:15 UTC
In Calc, "insert->Link to External Data" and select a pdf and Unicode, OOo 
crash in below cases: 
1.OS-Ubuntu 7.04, OOo 2.2
2.OS-Windows XP, OOo 2.1 Chinese version
3.OS-Windows XP, OOo 2.0.4 RC3 Chinese version


Comment 7 frank 2007-07-23 14:12:45 UTC
.
Comment 8 Olaf Felka 2007-07-23 14:57:33 UTC
@ as: Something for you? crashing in this case is nor very graceful.
Comment 9 andreas.schluens 2007-07-31 13:03:47 UTC
.
Comment 10 zhoubo.shi 2007-08-28 04:40:13 UTC
Created attachment 47811 [details]
stacktrace showing the crash
Comment 11 andreas.schluens 2007-08-30 12:42:55 UTC
AS: These stack shows the result ... but not the reason. Fact is the following ...
VCL font layout crashes caused by a corrupt encoded text (non complete surrogate).
So the problem already occures on converting the binary stream into unicode text
 inside text encoded filter (both - writer and calc).

AS->SB: As discussed - please take over this task. Might be converting text to
unicode using the method "rtl_convertTextToUnicode()" can be improved.
Comment 12 andreas.schluens 2007-08-30 13:03:12 UTC
AS->SB: Please note further ... crash occure by selecting "UNICODE" as encoding
... nit "UTF-8" !
Comment 13 andreas.schluens 2007-08-30 13:04:22 UTC
Created attachment 47879 [details]
will crash the office
Comment 14 Stephan Bergmann 2007-08-30 15:54:43 UTC
There are two problems with SwASCIIParser::ReadChars in
sw/source/filter/ascii/parasc.cxx:1.26 when currentCharSet == RTL_TEXTENCODING_UCS2:

1  When the input file has an odd number of bytes, pEnd will become a misaligned
pointer in line 429.  This can lead to SIGBUS or the import of excess garbage
into the document.

2  When the input contains stray surrogates (i.e., a high surrogate not followed
by a low surrogate, or a low surrogate not preceded by a high surrogate), this
according to hdu can lead to the reported crash.
Comment 15 Stephan Bergmann 2007-08-30 16:09:10 UTC
@fme:  Thinking about it, a good fix might be to drop the special-handling of
RTL_TEXTENCODING_UCS2 from SwASCIIParser::ReadChars, which would require as a
prerequisite that a working
rtl_createTextToUnicodeConverter(RTL_TEXTENCODING_UCS2) were added (which is
currently missing, returning NULL).  Let me know if I should supply that
prerequisite.
Comment 16 frank.meies 2008-01-10 11:15:34 UTC
Cannot be fixed until code freeze. Set target to 3.x.