You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by "Allison, Timothy B." <ta...@mitre.org> on 2017/04/26 18:45:03 UTC

xls record length exception

All,
  I can't share the file, but...  (sorry, it hurts me too).  File opens without problem in Excel.  If anyone has any recommendations, I'd appreciate it.

Caused by: org.apache.poi.hssf.record.RecordFormatException: Expected to find a ContinueRecord in order to read remaining 1 of 51 chars
               at org.apache.poi.hssf.record.RecordInputStream.readStringCommon(RecordInputStream.java:420)
               at org.apache.poi.hssf.record.RecordInputStream.readCompressedUnicode(RecordInputStream.java:379)
               at org.apache.poi.hssf.record.FormatRecord.<init>(FormatRecord.java:57)

It looks like the record length is correct, but that the XLUnicode string requires one more character than is stored in the record.

In a format record, I'm seeing:

1E 04 37 00  -- format record which should contain 0x37 bytes
2a 00 - index code and Unicode or not
33 00 00 ...  --- the XLUnicode String that should be 51 characters long

However, only 50 characters follow...and they match where the overall record length should end

Another format record follows immediately:
1E 04 2E 00...


RE: xls record length exception

Posted by "Allison, Timothy B." <ta...@mitre.org>.
I don't think so.  I'm fixing that now, though, because this part of the code base is now fresh. :)

-----Original Message-----
From: Javen O'Neal [mailto:javenoneal@gmail.com] 
Sent: Thursday, April 27, 2017 11:36 AM
To: POI Developers List <de...@poi.apache.org>
Subject: RE: xls record length exception

Is bug 61049 related?

On Apr 27, 2017 5:16 AM, "Allison, Timothy B." <ta...@mitre.org> wrote:

> Thank you, Javen.
>
> As happens too often, I had senders-regret on this email.  I found a 
> triggering file in our regression corpus and opened 61045.
>
> No multibytes found; more details in issue.
>
> Thank you!
>
> -----Original Message-----
> From: Javen O'Neal [mailto:javenoneal@gmail.com]
> Sent: Wednesday, April 26, 2017 11:59 PM
> To: POI Developers List <de...@poi.apache.org>
> Subject: Re: xls record length exception
>
> Are there any multibyte Unicode characters in the record?
>
> Any chance you could open the file in a hex editor or modify the biff 
> record reader to dump the bytes of just that record?
>
> If the record contents are sensitive, you could redact all single-byte 
> codepoints with 0x41 ("A"). Of course at that point you've probably 
> found the problem...
>
> On Apr 26, 2017 11:45, "Allison, Timothy B." <ta...@mitre.org> wrote:
>
> All,
>   I can't share the file, but...  (sorry, it hurts me too).  File 
> opens without problem in Excel.  If anyone has any recommendations, 
> I'd appreciate it.
>
> Caused by: org.apache.poi.hssf.record.RecordFormatException: Expected 
> to find a ContinueRecord in order to read remaining 1 of 51 chars
>                at org.apache.poi.hssf.record.RecordInputStream.
> readStringCommon(RecordInputStream.java:420)
>                at org.apache.poi.hssf.record.RecordInputStream.
> readCompressedUnicode(RecordInputStream.java:379)
>                at org.apache.poi.hssf.record.FormatRecord.<init>(
> FormatRecord.java:57)
>
> It looks like the record length is correct, but that the XLUnicode 
> string requires one more character than is stored in the record.
>
> In a format record, I'm seeing:
>
> 1E 04 37 00  -- format record which should contain 0x37 bytes 2a 00 - 
> index code and Unicode or not
> 33 00 00 ...  --- the XLUnicode String that should be 51 characters 
> long
>
> However, only 50 characters follow...and they match where the overall 
> record length should end
>
> Another format record follows immediately:
> 1E 04 2E 00...
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


RE: xls record length exception

Posted by Javen O'Neal <ja...@gmail.com>.
Is bug 61049 related?

On Apr 27, 2017 5:16 AM, "Allison, Timothy B." <ta...@mitre.org> wrote:

> Thank you, Javen.
>
> As happens too often, I had senders-regret on this email.  I found a
> triggering file in our regression corpus and opened 61045.
>
> No multibytes found; more details in issue.
>
> Thank you!
>
> -----Original Message-----
> From: Javen O'Neal [mailto:javenoneal@gmail.com]
> Sent: Wednesday, April 26, 2017 11:59 PM
> To: POI Developers List <de...@poi.apache.org>
> Subject: Re: xls record length exception
>
> Are there any multibyte Unicode characters in the record?
>
> Any chance you could open the file in a hex editor or modify the biff
> record reader to dump the bytes of just that record?
>
> If the record contents are sensitive, you could redact all single-byte
> codepoints with 0x41 ("A"). Of course at that point you've probably found
> the problem...
>
> On Apr 26, 2017 11:45, "Allison, Timothy B." <ta...@mitre.org> wrote:
>
> All,
>   I can't share the file, but...  (sorry, it hurts me too).  File opens
> without problem in Excel.  If anyone has any recommendations, I'd
> appreciate it.
>
> Caused by: org.apache.poi.hssf.record.RecordFormatException: Expected to
> find a ContinueRecord in order to read remaining 1 of 51 chars
>                at org.apache.poi.hssf.record.RecordInputStream.
> readStringCommon(RecordInputStream.java:420)
>                at org.apache.poi.hssf.record.RecordInputStream.
> readCompressedUnicode(RecordInputStream.java:379)
>                at org.apache.poi.hssf.record.FormatRecord.<init>(
> FormatRecord.java:57)
>
> It looks like the record length is correct, but that the XLUnicode string
> requires one more character than is stored in the record.
>
> In a format record, I'm seeing:
>
> 1E 04 37 00  -- format record which should contain 0x37 bytes 2a 00 -
> index code and Unicode or not
> 33 00 00 ...  --- the XLUnicode String that should be 51 characters long
>
> However, only 50 characters follow...and they match where the overall
> record length should end
>
> Another format record follows immediately:
> 1E 04 2E 00...
>

RE: xls record length exception

Posted by "Allison, Timothy B." <ta...@mitre.org>.
Thank you, Javen.  

As happens too often, I had senders-regret on this email.  I found a triggering file in our regression corpus and opened 61045.

No multibytes found; more details in issue.

Thank you!

-----Original Message-----
From: Javen O'Neal [mailto:javenoneal@gmail.com] 
Sent: Wednesday, April 26, 2017 11:59 PM
To: POI Developers List <de...@poi.apache.org>
Subject: Re: xls record length exception

Are there any multibyte Unicode characters in the record?

Any chance you could open the file in a hex editor or modify the biff record reader to dump the bytes of just that record?

If the record contents are sensitive, you could redact all single-byte codepoints with 0x41 ("A"). Of course at that point you've probably found the problem...

On Apr 26, 2017 11:45, "Allison, Timothy B." <ta...@mitre.org> wrote:

All,
  I can't share the file, but...  (sorry, it hurts me too).  File opens without problem in Excel.  If anyone has any recommendations, I'd appreciate it.

Caused by: org.apache.poi.hssf.record.RecordFormatException: Expected to find a ContinueRecord in order to read remaining 1 of 51 chars
               at org.apache.poi.hssf.record.RecordInputStream.
readStringCommon(RecordInputStream.java:420)
               at org.apache.poi.hssf.record.RecordInputStream.
readCompressedUnicode(RecordInputStream.java:379)
               at org.apache.poi.hssf.record.FormatRecord.<init>(
FormatRecord.java:57)

It looks like the record length is correct, but that the XLUnicode string requires one more character than is stored in the record.

In a format record, I'm seeing:

1E 04 37 00  -- format record which should contain 0x37 bytes 2a 00 - index code and Unicode or not
33 00 00 ...  --- the XLUnicode String that should be 51 characters long

However, only 50 characters follow...and they match where the overall record length should end

Another format record follows immediately:
1E 04 2E 00...

Re: xls record length exception

Posted by Javen O'Neal <ja...@gmail.com>.
Are there any multibyte Unicode characters in the record?

Any chance you could open the file in a hex editor or modify the biff
record reader to dump the bytes of just that record?

If the record contents are sensitive, you could redact all single-byte
codepoints with 0x41 ("A"). Of course at that point you've probably found
the problem...

On Apr 26, 2017 11:45, "Allison, Timothy B." <ta...@mitre.org> wrote:

All,
  I can't share the file, but...  (sorry, it hurts me too).  File opens
without problem in Excel.  If anyone has any recommendations, I'd
appreciate it.

Caused by: org.apache.poi.hssf.record.RecordFormatException: Expected to
find a ContinueRecord in order to read remaining 1 of 51 chars
               at org.apache.poi.hssf.record.RecordInputStream.
readStringCommon(RecordInputStream.java:420)
               at org.apache.poi.hssf.record.RecordInputStream.
readCompressedUnicode(RecordInputStream.java:379)
               at org.apache.poi.hssf.record.FormatRecord.<init>(
FormatRecord.java:57)

It looks like the record length is correct, but that the XLUnicode string
requires one more character than is stored in the record.

In a format record, I'm seeing:

1E 04 37 00  -- format record which should contain 0x37 bytes
2a 00 - index code and Unicode or not
33 00 00 ...  --- the XLUnicode String that should be 51 characters long

However, only 50 characters follow...and they match where the overall
record length should end

Another format record follows immediately:
1E 04 2E 00...