Skip to content

Failing to read XLS file: process doesn't terminate. #258

@Yv-vY

Description

@Yv-vY

Using the spreadsheet gem I've hit this bug when trying to load the attached XLS file, which obviously is bloated following a "save as" from XLSX to XLS in Microsoft Excel.
When selecting the worksheet 0, the ruby process starts to have high CPU usage and never completes (at least in 5 minutes).

Notes:

  • there's only ~ 300 lines of data in the file
  • the file reads perfectly with LibreOffice too
    BloatedExcelFile.zip

Here's the backtrace:


^C/opt/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/irb-1.3.1/lib/irb.rb:418:in `raise': abort then interrupt! (IRB::Abort)
	from /home/yann/.gem/ruby/3.0.0/gems/spreadsheet-1.2.6/lib/spreadsheet/excel/reader.rb:677:in `block in read_row'
	from /home/yann/.gem/ruby/3.0.0/gems/spreadsheet-1.2.6/lib/spreadsheet/excel/reader.rb:672:in `fetch'
	from /home/yann/.gem/ruby/3.0.0/gems/spreadsheet-1.2.6/lib/spreadsheet/worksheet.rb:157:in `map'
	from /home/yann/.gem/ruby/3.0.0/gems/spreadsheet-1.2.6/lib/spreadsheet/worksheet.rb:157:in `each'
	from /home/yann/.gem/ruby/3.0.0/gems/spreadsheet-1.2.6/lib/spreadsheet/excel/worksheet.rb:47:in `each'
	from /home/yann/.gem/ruby/3.0.0/gems/roo-xls-1.2.0/lib/roo/xls/excel.rb:252:in `read_cells'
	from /home/yann/.gem/ruby/3.0.0/gems/roo-2.8.3/lib/roo/base.rb:119:in `block (2 levels) in <class:Base>'
	from /home/yann/.gem/ruby/3.0.0/gems/simple-spreadsheet-0.5.0/lib/simple-spreadsheet/modules/roo_module.rb:20:in `last_row'
	from (irb):4:in `<main>'
	... 3 levels...

Thanks for your support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions