[Bug 64667] New: NPE in loading the StylesTable

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 64667] New: NPE in loading the StylesTable

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64667

            Bug ID: 64667
           Summary: NPE in loading the StylesTable
           Product: POI
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

A Tika user reported an NPE when loading the StylesTable and shared a
triggering file[1].

I confirmed this NPE in trunk just now.

java.lang.NullPointerException
        at
org.apache.poi.xssf.usermodel.XSSFTableStyle.<init>(XSSFTableStyle.java:64)
        at org.apache.poi.xssf.model.StylesTable.readFrom(StylesTable.java:245)
        at org.apache.poi.xssf.model.StylesTable.<init>(StylesTable.java:138)
        at
org.apache.poi.ooxml.POIXMLFactory.createDocumentPart(POIXMLFactory.java:61)
        at
org.apache.poi.ooxml.POIXMLDocumentPart.read(POIXMLDocumentPart.java:659)
        at org.apache.poi.ooxml.POIXMLDocument.load(POIXMLDocument.java:165)
        at
org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:288)
        at
org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:309)
        at
org.apache.poi.xssf.XSSFTestDataSamples.openSampleWorkbook(XSSFTestDataSamples.java:60)
        at
org.apache.poi.xssf.extractor.TestXSSFExcelExtractor.getExtractor(TestXSSFExcelExtractor.java:45)




[1] https://issues.apache.org/jira/browse/TIKA-3163

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64667] NPE in loading the StylesTable

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64667

--- Comment #1 from Tim Allison <[hidden email]> ---
Adding a null check fixes the problem on the offending file:

StylesTable.java:242
            if (ctTableStyles != null && styleDxfs != null) {

I'll wait for a clean build and then commit unless there are objections.

My preference is not to add the triggering file to our unit tests because its
size outweighs the scope of the problem/fix.

I can add a unit test with the file if desired.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64667] NPE in loading the StylesTable

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64667

--- Comment #2 from Nick Burch <[hidden email]> ---
Do we have any small files in the regression corpus that show the same bug?

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64667] NPE in loading the StylesTable

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64667

--- Comment #3 from Tim Allison <[hidden email]> ---
We don't.  I can manually minify the file...

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64667] NPE in loading the StylesTable

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64667

--- Comment #4 from Tim Allison <[hidden email]> ---
For anyone curious about searching stacktraces...our db is now live via
Datasette

https://corpora.tika.apache.org/datasette/corpora-metadata?sql=select%0D%0A++ID%2C%0D%0A++ORIG_STACK_TRACE%2C%0D%0A++SORT_STACK_TRACE%2C%0D%0A++PARSE_EXCEPTION_ID%0D%0Afrom%0D%0A++PARSE_EXCEPTIONS%0D%0Awhere%0D%0A++orig_stack_trace+like+%27%25XSSFTableStyle%25%27%0D%0Aorder+by%0D%0A++ID%0D%0Alimit%0D%0A++101


select
  ID,
  ORIG_STACK_TRACE,
  SORT_STACK_TRACE,
  PARSE_EXCEPTION_ID
from
  PARSE_EXCEPTIONS
where
  orig_stack_trace like '%XSSFTableStyle%'
order by
  ID
limit
  101

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64667] NPE in loading the StylesTable

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64667

Tim Allison <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Tim Allison <[hidden email]> ---
r1880834

manually created a small example from the original

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]