Issue 117728 - sc: allocates up to 1300MB of memory then crashes with terminate called after throwing an instance of 'std::bad_alloc'
Summary: sc: allocates up to 1300MB of memory then crashes with terminate called after...
Status: CLOSED FIXED
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: OOo 3.3
Hardware: PC OpenBSD
: P2 Normal (vote)
Target Milestone: 3.4.0
Assignee: oc
QA Contact: issues@sc
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-06 09:03 UTC by robert
Modified: 2017-05-20 10:31 UTC (History)
3 users (show)

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


Attachments
backtrace (7.03 KB, text/plain)
2011-04-06 09:04 UTC, robert
no flags Details
Test document with 201 sheets (99.50 KB, application/vnd.ms-excel)
2011-04-15 08:07 UTC, daniel.rentz
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description robert 2011-04-06 09:03:11 UTC
In OOo 3.3 we are unable to import an Excel document (5.2MB, more than 256 sheets). This document worked fine in 3.2 (only up to 256 sheets of course).

In 3.3 the soffice process allocates more than 1300MB of memory while importing the xls file (takes about 2 minutes). It is not a datasize problem because our limits are more than 2G.

Unfortunately I cannot share the xls file itself because it's confidential.

The backtrace:

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Abort trap (core dumped) 

#0  0x0a2ed7bd in kill () from /usr/lib/libc.so.58.0
#1  0x0a34de35 in abort () at /usr/src/lib/libc/stdlib/abort.c:68
#2  0x03e6d266 in __gnu_cxx::__verbose_terminate_handler () at /usr/src/gnu/lib/libstdc++-v3/../../gcc/libstdc++-v3/libsupc++/vterminate.cc:98
#3  0x03ea9f1a in __cxxabiv1::__terminate (handler=0x3e6d100 <__gnu_cxx::__verbose_terminate_handler()>) at /usr/src/gnu/lib/libstdc++-v3/../../gcc/libstdc++-v3/libsupc++/eh_terminate.cc:43
#4  0x03ea9f62 in std::terminate () at /usr/src/gnu/lib/libstdc++-v3/../../gcc/libstdc++-v3/libsupc++/eh_terminate.cc:53
#5  0x03e6ab4a in __cxa_throw (obj=Could not find the frame base for "__cxa_throw".
) at /usr/src/gnu/lib/libstdc++-v3/../../gcc/libstdc++-v3/libsupc++/eh_throw.cc:76
#6  0x1c000fb2 in operator delete ()
#7  0x1c0010a6 in operator new ()
#8  0x0304098e in XclImpColRowSettings (this=0x82872680, rRoot=@0x8547100c) at new_allocator.h:91
#9  0x0306abc4 in XclImpOutlineDataBuffer (this=0x7e378e00, rRoot=@0x8547100c, nScTab=154) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/sc/source/filter/excel/impop.cxx:1317
#10 0x0306ad9d in ImportExcel::NeueTabelle (this=0x85471000) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/sc/source/filter/excel/impop.cxx:1165
#11 0x0306ed1c in ImportExcel8::Read (this=0x85471000) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/sc/source/filter/excel/read.cxx:1037
#12 0x0304c49f in ScFormatFilterPluginImpl::ScImportExcel (this=0x85b1f730, rMedium=@0x7cc2ae40, pDocument=0x877bc040, eFormat=EIF_BIFF8) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/sc/source/filter/excel/excel.cxx:203
#13 0x1076be34 in ScDocShell::ConvertFrom (this=0x877bc000, rMedium=@0x7cc2ae40) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/sc/source/ui/docshell/docsh.cxx:1122
#14 0x01d9136c in SfxObjectShell::DoLoad (this=0x877bc000, pMed=0x7cc2ae40) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/sfx2/source/doc/objstor.cxx:712
#15 0x01df778a in SfxBaseModel::load (this=0x7db15800, seqArguments=@0xcfbdef14) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/sfx2/source/doc/sfxbasemodel.cxx:1787
#16 0x01e678cc in SfxFrameLoader_Impl::load (this=0x7ec35300, rArgs=@0xcfbdf014, _rTargetFrame=@0xcfbdf024) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/sfx2/source/view/frmload.cxx:631
#17 0x0f940f79 in framework::LoadEnv::impl_loadContent (this=0x806bac4c) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/framework/source/loadenv/loadenv.cxx:1213
#18 0x0f942c08 in framework::LoadEnv::startLoading (this=0x806bac4c) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/framework/source/loadenv/loadenv.cxx:434
#19 0x0f933805 in framework::LoadDispatcher::impl_dispatch (this=0x806bac00, rURL=@0xcfbdf25c, lArguments=@0xcfbdf520, xListener=@0xcfbdf1fc) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/framework/source/dispatch/loaddispatcher.cxx:169
#20 0x0f933ea1 in framework::LoadDispatcher::dispatchWithReturnValue (this=0x806bac00, rURL=@0xcfbdf25c, lArguments=@0xcfbdf520) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/framework/source/dispatch/loaddispatcher.cxx:106
#21 0x06f6aacd in comphelper::SynchronousDispatch::dispatch (xStartPoint=@0xcfbdf538, sURL=@0xcfbdf4c8, sTarget=@0xcfbdf504, nFlags=0, lArguments=@0xcfbdf520)
    at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/comphelper/source/misc/synchronousdispatch.cxx:85
#22 0x0ab288cb in desktop::DispatchWatcher::executeDispatchRequests (this=0x82b69200, aDispatchRequestsList=@0xcfbdf58c, bNoTerminate=false) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/desktop/source/app/dispatchwatcher.cxx:337
#23 0x0ab3636e in desktop::OfficeIPCThread::ExecuteCmdLineRequests (aRequest=@0xcfbdf80c) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/desktop/source/app/officeipcthread.cxx:986
#24 0x0ab136c9 in desktop::Desktop::OpenClients () at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/desktop/source/app/app.cxx:2901
#25 0x0ab1558a in desktop::Desktop::OpenClients_Impl (this=0xcfbe0000) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/desktop/source/app/app.cxx:2216
#26 0x0ab156a4 in desktop::Desktop::LinkStubOpenClients_Impl (pThis=0xcfbe0000, pCaller=0x0) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/desktop/source/app/app.cxx:2212
#27 0x0b5ac853 in ImplWindowFrameProc (pWindow=0x7f6d1600, nEvent=Variable "nEvent" is not available.
) at link.hxx:139
#28 0x09c207f3 in SalDisplay::DispatchInternalEvent (this=0x89bb1800) at salframe.hxx:286
#29 0x057dbd61 in GtkXLib::userEventFn (data=0x7f36fe00) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/vcl/unx/gtk/app/gtkdata.cxx:764
#30 0x057dbdad in call_userEventFn (data=0x7f36fe00) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/vcl/unx/gtk/app/gtkdata.cxx:737
#31 0x0a472671 in g_source_is_destroyed () from /usr/local/lib/libglib-2.0.so.2800.0
#32 0x0a474577 in g_main_context_dispatch () from /usr/local/lib/libglib-2.0.so.2800.0
#33 0x0a4785ee in g_main_context_prepare () from /usr/local/lib/libglib-2.0.so.2800.0
#34 0x0a478c15 in g_main_context_iteration () from /usr/local/lib/libglib-2.0.so.2800.0
#35 0x057dc780 in GtkXLib::Yield (this=0x7f36fe00, bWait=true, bHandleAllCurrentEvents=false) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/vcl/unx/gtk/app/gtkdata.cxx:816
#36 0x09c2a4e7 in X11SalInstance::Yield (this=0x876812c0, bWait=Variable "bWait" is not available.
) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/vcl/unx/source/app/salinst.cxx:263
#37 0x0b379738 in Application::Yield (i_bAllEvents=false) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/vcl/source/app/svapp.cxx:471
#38 0x0b37b1bc in Application::Execute () at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/vcl/source/app/svapp.cxx:448
#39 0x0ab0c570 in desktop::Desktop::Main (this=0xcfbe0000) at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/desktop/source/app/app.cxx:1938
#40 0x0b381408 in ImplSVMain () at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/vcl/source/app/svmain.cxx:183
#41 0x0b381505 in SVMain () at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/vcl/source/app/svmain.cxx:224
#42 0x0ab395bc in soffice_main () at /home/torrent/.pobj/openoffice-3.3.0-debug-no_java-parallel-no_lang/OOO330_m20/desktop/source/app/sofficemain.cxx:49
#43 0x1c000e7c in main ()
Comment 1 robert 2011-04-06 09:04:19 UTC
Created attachment 76296 [details]
backtrace
Comment 2 daniel.rentz 2011-04-11 10:46:19 UTC
accepted
Comment 3 mdxonefour 2011-04-11 11:45:04 UTC
adjusting target and prio accordingly to severity of this issue
Comment 4 daniel.rentz 2011-04-11 15:57:29 UTC
Fixed. Specific buffers in the XLS import filters have allocated space for 1 million rows but it is sufficient to allocate only 64K rows as supported by the XLS file format.
Comment 5 niklas.nebel 2011-04-12 12:42:44 UTC
Code change reviewed.
Comment 6 daniel.rentz 2011-04-12 14:46:32 UTC
back to QA
Comment 7 daniel.rentz 2011-04-15 08:07:23 UTC
Created attachment 76386 [details]
Test document with 201 sheets

The attached document has 201 empty worksheets. Old import allocates >1.3 GB, after the fix, this becomes ~200 MB.
Comment 8 oc 2011-04-15 11:10:10 UTC
verified in internal build cs_calc68
Comment 9 Oliver-Rainer Wittmann 2012-06-13 12:26:06 UTC
getting rid of value "enhancement" for field "severity".
For enhancement the field "issue type" shall be used.