https://bugs.documentfoundation.org/show_bug.cgi?id=97863

            Bug ID: 97863
           Summary: FILEOPEN: XLS import hangs with 100% cpu usage
           Product: LibreOffice
           Version: unspecified
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: [email protected]
          Reporter: [email protected]

Using LibreOffice version 5.1.0.3 5e3e00a007d9b3b6efb6797a8b8e57b51ab1f737
(Debian download from lo.org).

Trying to open MS XLS file (3.1MB, not attaching) from
http://www.tulli.fi/fi/yksityisille/autoverotus/taulukot/autot/au/012015.xls
(Finnish customs statistics for imported used cars), LO "hangs" with 100% CPU
usage. Not sure about its content, but it should have a sheet for every month
with a few hundred rows for constants, should not have any formulas, fancy
formatting or such.

I have no source but gdb backtrace points to 

(gdb) bt
#0  0x00007f2b3b1596c0 in XclImpExtName::MOper::MOper(svl::SharedStringPool&,
XclImpStream&) ()
   from /opt/libreoffice5.1/program/libscfiltlo.so
#1  0x00007f2b3b15b34e in XclImpExtName::XclImpExtName(XclImpSupbook&,
XclImpStream&, XclSupbookType, ExcelToSc*) ()
   from /opt/libreoffice5.1/program/libscfiltlo.so
#2  0x00007f2b3b15bfca in XclImpSupbook::ReadExternname(XclImpStream&,
ExcelToSc*) () from /opt/libreoffice5.1/program/libscfiltlo.so
#3  0x00007f2b3b05f5e9 in ImportExcel8::Read() () from
/opt/libreoffice5.1/program/libscfiltlo.so
#4  0x00007f2b3b03704b in ScFormatFilterPluginImpl::ScImportExcel(SfxMedium&,
ScDocument*, EXCIMPFORMAT) ()
   from /opt/libreoffice5.1/program/libscfiltlo.so
#5  0x00007f2b3ce1d0de in ScDocShell::ConvertFrom(SfxMedium&) () from
/opt/libreoffice5.1/program/../program/libsclo.so
...

Looking from disassembly it is spinning in the nested for loop @
https://github.com/LibreOffice/core/blob/5e3e00a007d9b3b6efb6797a8b8e57b51ab1f737/sc/source/filter/excel/xilink.cxx#L289.

Setting a breakpoint at the end of the outermost loop (nRow <= nLastRow):

(gdb) disassemble
...
   0x00007f2b3b159747 <+327>:   add    $0x1,%r15
   0x00007f2b3b15974b <+331>:   cmp    0x28(%rsp),%r15
   0x00007f2b3b159750 <+336>:   jbe    0x7f2b3b1596c0
<_ZN13XclImpExtName5MOperC2ERN3svl16SharedStringPoolER12XclImpStream+192>
...

(gdb) break *0x00007f2b3b15974b

and running it

(gdb) cont
Continuing.

Breakpoint 1, 0x00007f2b3b15974b in
XclImpExtName::MOper::MOper(svl::SharedStringPool&, XclImpStream&) ()
   from /opt/libreoffice5.1/program/libscfiltlo.so

(gdb) p $r15
$42 = 19240055
(gdb) x/gx $rsp+0x28
0x7ffeadb55d08: 0xffffffffffffffff

The limit nLastRow is ULONG_MAX and the test being for "unsigned less or equal"
it will spin there forever.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to