Note that there are some explanatory texts on larger screens.

plurals
  1. POSpreadsheet::ParseExcel::Stream losing its parser
    primarykey
    data
    text
    <p>I have an 18M Excel spreadsheet to parse and <code>Spreadsheet::ParseExcel</code> was consuming so much memory that it I had to switch to <a href="https://metacpan.org/module/Spreadsheet::ParseExcel::Stream" rel="nofollow noreferrer">Spreadsheet::ParseExcel::Stream</a>. It works fine on my VM, it works fine on our staging server, but on our production server (configured the same way), I get this error:</p> <pre><code>Can't call method "transfer" on an undefined value at \ lib/Spreadsheet/ParseExcel/Stream/XLS.pm line 31. </code></pre> <p>That comes from the following bit of code:</p> <pre><code>my ($wb, $idx, $row, $col, $cell); my $tmp = my $handler = sub { ($wb, $idx, $row, $col, $cell) = @_; $parser-&gt;transfer($main); XXX here's where we die }; my $tmp_p = $parser = Coro::State-&gt;new(sub { $xls-&gt;Parse($file); # Flag the generator that we're done undef $xls; # If we don't transfer back when done parsing, # it's an implicit program exit (oops!) $parser-&gt;transfer($main) }); weaken($parser); </code></pre> <p>The <code>weaken</code> looked suspicious, so I tried not weakening unless the refcount was greater than 1, but the same problem happens. I instrumented the code to get a stacktrace and got this:</p> <pre><code>parser is undefined at lib/Spreadsheet/ParseExcel/Stream/XLS.pm line 29. Spreadsheet::ParseExcel::Stream::XLS::__ANON__ \ ('Spreadsheet::ParseExcel::Workbook=HASH(0x6cd4a08)', 0, 2, 1, \ 'Spreadsheet::ParseExcel::Cell=HASH(0x1387ce78)') called at \ /usr/share/perl5/Spreadsheet/ParseExcel.pm line 2152 Spreadsheet::ParseExcel::_NewCell( \ 'Spreadsheet::ParseExcel::Workbook=HASH(0x6cd4a08)', 2, 1, \ 'Kind', 'PackedIdx', 'Val', 'Dean', 'FormatNo', 25, ...) \ called at /usr/share/perl5/Spreadsheet/ParseExcel.pm line 896 Spreadsheet::ParseExcel::_subLabelSST( \ 'Spreadsheet::ParseExcel::Workbook=HASH(0x6cd4a08)', 253, 10, \ '\x{2}\x{0}\x{1}\x{0}\x{19}\x{0}2\x{0}\x{0}\x{0}') \ called at /usr/share/perl5/Spreadsheet/ParseExcel.pm line 292 Spreadsheet::ParseExcel::parse( \ 'Spreadsheet::ParseExcel=HASH(0x6cd1810)', '2013-09-13.xls') \ called at lib/Spreadsheet/ParseExcel/Stream/XLS.pm line 35 Spreadsheet::ParseExcel::Stream::XLS::__ANON__ \ called at new_importer.pl line 0 </code></pre> <p>That tells me that the parser read the first and second rows, but it dies on the third row for some reason.</p> <p>I've tried rebuilding <code>Spreadsheet::ParseExcel::Stream</code> and it doesn't appear to have any errors (all tests pass). I've also recompiled <code>Coro</code> (same result).</p> <p>I'm mystified. Anyone have any ideas?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload