Issue 117400

Summary: CSV: importing 64Kb+ english field entry in utf-8 causes alertless crash
Product: Calc Reporter: mark.macnair
Component: open-importAssignee: ooo
Status: CLOSED FIXED QA Contact: issues@sc <issues>
Severity: Normal    
Priority: P2 CC: damjan, issues, phoenix.wanglf
Version: DEV300m102Keywords: crash
Target Milestone: 4.0.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: 3.4.0
Developer Difficulty: ---
Attachments:
Description Flags
plain english ansii csv with field entry of > 65535
none
patch supposed to fix the issue none

Description mark.macnair 2011-03-16 13:17:50 UTC
Created attachment 76118 [details]
plain english ansii csv with field entry of > 65535

When opening an ansii encoded comma seperated file in calc, using utf-8 or western europe (ascii/us) as the decoding method, open office calc crashes with no error message.
Comment 1 Oliver-Rainer Wittmann 2012-06-13 12:29:24 UTC
getting rid of value "enhancement" for field "severity".
For enhancement the field "issue type" shall be used.
Comment 2 damjan 2012-10-16 15:16:37 UTC
"/opt/openoffice.org3/program/soffice.bin -calc" starts using 100% CPU, the GUI hangs, and more and more memory gets allocated, causing its entire 4GB virtual address space to get exhausted, this causing "operator new" to throw an exception that GDB reports as the following:

Program received signal SIGABRT, Aborted.
0xf775f430 in __kernel_vsyscall ()
(gdb) bt
#0  0xf775f430 in __kernel_vsyscall ()
#1  0xf70601ef in raise () from /lib/i386-linux-gnu/libc.so.6
#2  0xf7063835 in abort () from /lib/i386-linux-gnu/libc.so.6
#3  0xf72e752f in __gnu_cxx::__verbose_terminate_handler() () from /opt/openoffice.org3/program/../basis-link/ure-link/lib/libstdc++.so.6
#4  0xf72e5465 in ?? () from /opt/openoffice.org3/program/../basis-link/ure-link/lib/libstdc++.so.6
#5  0xf72e54a2 in std::terminate() () from /opt/openoffice.org3/program/../basis-link/ure-link/lib/libstdc++.so.6
#6  0xf72e55e1 in __cxa_throw () from /opt/openoffice.org3/program/../basis-link/ure-link/lib/libstdc++.so.6
#7  0x08048e68 in ?? ()
#8  0x08048f2d in operator new[](unsigned int) ()
#9  0xf5fa60c8 in GenericSalLayout::AppendGlyph(GlyphItem const&) () from /opt/openoffice.org3/program/../basis-link/program/libvcl.so
#10 0xf5de84e7 in ?? () from /opt/openoffice.org3/program/../basis-link/program/libvcl.so
#11 0xf5de86d1 in ServerFontLayout::LayoutText(ImplLayoutArgs&) () from /opt/openoffice.org3/program/../basis-link/program/libvcl.so
#12 0xf5f17e53 in ?? () from /opt/openoffice.org3/program/../basis-link/program/libvcl.so
#13 0xf5f18788 in OutputDevice::GetTextArray(String const&, long*, unsigned short, unsigned short) const () from /opt/openoffice.org3/program/../basis-link/program/libvcl.so
#14 0xefe8c344 in SvxFont::QuickGetTextSize(OutputDevice const*, String const&, unsigned short, unsigned short, long*) const () from /opt/openoffice.org3/program/../basis-link/program/libediteng.so
#15 0xefe5b085 in ?? () from /opt/openoffice.org3/program/../basis-link/program/libediteng.so
#16 0xefe5c550 in ?? () from /opt/openoffice.org3/program/../basis-link/program/libediteng.so
#17 0xefe5f68d in ?? () from /opt/openoffice.org3/program/../basis-link/program/libediteng.so
#18 0xefe2bfee in EditEngine::SetUpdateMode(unsigned char) () from /opt/openoffice.org3/program/../basis-link/program/libediteng.so
#19 0xee573457 in ScEditEngineDefaulter::SetText(String const&) () from /opt/openoffice.org3/program/../basis-link/program/libsc.so
#20 0xee498964 in ?? () from /opt/openoffice.org3/program/../basis-link/program/libsc.so
#21 0xee498e24 in ?? () from /opt/openoffice.org3/program/../basis-link/program/libsc.so
#22 0xee183870 in ?? () from /opt/openoffice.org3/program/../basis-link/program/libsc.so
#23 0xf5e358dc in Timer::Timeout() () from /opt/openoffice.org3/program/../basis-link/program/libvcl.so
#24 0xf5e35ddd in Timer::ImplTimerCallbackProc() () from /opt/openoffice.org3/program/../basis-link/program/libvcl.so
#25 0xf3debaa6 in X11SalData::Timeout() const () from /opt/openoffice.org3/basis-link/program/libvclplug_gen.so
#26 0xf3ddfb22 in SalXLib::CheckTimeout(bool) () from /opt/openoffice.org3/basis-link/program/libvclplug_gen.so
#27 0xf3ddfd7f in SalXLib::Yield(bool, bool) () from /opt/openoffice.org3/basis-link/program/libvclplug_gen.so
#28 0xf3de9e9d in X11SalInstance::Yield(bool, bool) () from /opt/openoffice.org3/basis-link/program/libvclplug_gen.so
#29 0xf5e31d14 in ?? () from /opt/openoffice.org3/program/../basis-link/program/libvcl.so
#30 0xf5e31272 in Application::Yield(bool) () from /opt/openoffice.org3/program/../basis-link/program/libvcl.so
#31 0xf5e312a3 in Application::Execute() () from /opt/openoffice.org3/program/../basis-link/program/libvcl.so
#32 0xf755f5eb in ?? () from /opt/openoffice.org3/program/../basis-link/program/libsofficeapp.so
#33 0xf5e3521c in ?? () from /opt/openoffice.org3/program/../basis-link/program/libvcl.so
#34 0xf5e353b3 in SVMain() () from /opt/openoffice.org3/program/../basis-link/program/libvcl.so
#35 0xf7579668 in soffice_main () from /opt/openoffice.org3/program/../basis-link/program/libsofficeapp.so
#36 0x08048d14 in main ()
Comment 3 ooo 2012-10-19 14:35:46 UTC
Created attachment 79793 [details]
patch supposed to fix the issue

The attached patch fixed the issue for LibreOffice. I'm contributing this under ALv2.
Comment 4 damjan 2012-10-22 15:56:08 UTC
(In reply to comment #3)
> Created attachment 79793 [details]
> patch supposed to fix the issue
> 
> The attached patch fixed the issue for LibreOffice. I'm contributing this
> under ALv2.

Thank you very much! Your patch stops the crash, but it still truncates the field to 65535 chars and causes error 513 when attempting to append more text. That's a separate bug though :), so I am going to commit it.
Comment 5 SVN Robot 2012-10-22 16:02:38 UTC
"damjan" committed SVN revision 1400928 into trunk:
#i117400# CSV: importing 64Kb+ english field entry in utf-8 causes alertless ...
Comment 6 damjan 2012-10-22 16:07:19 UTC
Fixed by commit 1400928, so resolving fixed.
Comment 7 Li Feng Wang 2012-11-08 09:09:16 UTC
Verified pass with build r1404513.