You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2020/03/26 16:19:26 UTC

[Bug 64271] New: JVM crashes when we write XL file

https://bz.apache.org/bugzilla/show_bug.cgi?id=64271

            Bug ID: 64271
           Summary: JVM crashes when we write XL file
           Product: POI
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: girish.kumar@milestonegroup.com
  Target Milestone: ---

Created attachment 37127
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37127&action=edit
crash pid file

We notice JVM crash occurring when we try to write workbook very rarely.

Code in summary would be as follows
OPCPackage opcPackage = OPCPackage.open(workbookFilename,
PackageAccess.READ_WRITE);
    Workbook  workbook = new XSSFWorkbook(opcPackage);
    File tmpFile =  tmpFile = File.createTempFile(existingFile.getName(),
".tmp", new File("."));

    try (FileOutputStream fos = new FileOutputStream(tmpFile)) {
      workbook.write(fos);
    }


Details of the crash would be attached in the PID file

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 64271] JVM crashes when we write XL file

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64271

--- Comment #2 from Girish Kumar <gi...@milestonegroup.com> ---
Apache POI version - 3.15

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 64271] JVM crashes when we write XL file

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64271

--- Comment #5 from Girish Kumar <gi...@milestonegroup.com> ---
Thanks for responding Axel.

double assignment of tmp is my mistake while copy and paste and formatting.

Also I see another bug link which is close to crash location

https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8186557 and they recommend
disabling memory mapping. Not sure whether that would help.


Also see another stack overflow message, which talks about WorkBookFactory 

https://stackoverflow.com/questions/11344131/jvm-crashing-while-writing-to-xlsx-file-poi/17329250

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 64271] JVM crashes when we write XL file

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64271

--- Comment #7 from Axel Howind <ax...@dua3.com> ---
A little info I copied from
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8233188 :

> Historically, native crashes in
> java.util.zip.ZipFile::getNextEntry
> were invariably due to the zip file being overwritten while running. (DON'T DO THAT)
> In recent jdks, I think this was addressed by moving the native code into java (and not using mmap).

Since the bug seems to be within the JDK, and should be fixed in more recent
versions, you should first update your JDK 8 and see if you can reproduce the
crash. Alternatively disable mmap or make sure files are not
changed/moved/deleted while writing the workbook.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 64271] JVM crashes when we write XL file

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64271

--- Comment #1 from Girish Kumar <gi...@milestonegroup.com> ---
Apache POI version - 3.15

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 64271] JVM crashes when we write XL file

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64271

--- Comment #4 from Axel Howind <ax...@dua3.com> ---
BTW: I have seen bug reports JVM crashes with SIGBUS when creating temp files
and there's not enough space left on the device. But these should have already
been fixed even in your 4 year-old version of Java.

As a side note, the double assignment to `tmpFile` looks really weird (but it
has nothing to do with the crash):

    File tmpFile =  tmpFile = File.createTempFile(existingFile.getName(),
".tmp", new File("."));

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 64271] JVM crashes when we write XL file

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64271

--- Comment #6 from Nick Burch <ap...@gagravarr.org> ---
Java programs shouldn't be able to crash the JVM.

I think you'll need to report this to Oracle or OpenJDK (depending on which JDK
you use)

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 64271] JVM crashes when we write XL file

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64271

Axel Howind <ax...@dua3.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #3 from Axel Howind <ax...@dua3.com> ---
This does not look like a POI bug to me, but rather a JVM bug: 

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0x7) at pc=0x00007ff613be8a32, pid=33123, tid=140691906696960
#
# JRE version: Java(TM) SE Runtime Environment (8.0_91-b14) (build
1.8.0_91-b14)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.91-b14 mixed mode linux-amd64
compressed oops)
# Problematic frame:
# C  [libzip.so+0x11a32]  newEntry+0x62
#

Please first update your Java installation to a more recent patch level of Java
8 (current for Java 8 is Java 8 Update 241 CPU) and report back if you can
reproduce the crash.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 64271] JVM crashes when we write XL file

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64271

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INFORMATIONPROVIDED
             Status|NEEDINFO                    |RESOLVED

--- Comment #8 from Dominik Stadler <do...@gmx.at> ---
This seems to be a problem in the JDK itself, so there is nothing that we can
fix in Apache POI as far as I see, thus I am closing this for now.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org