JDK-4369396 : Jar files should be locked by default when working with them
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 3.0,1.3.0
  • Priority: P2
  • Status: Closed
  • Resolution: Won't Fix
  • OS: solaris_2.6,solaris_8
  • CPU: sparc
  • Submitted: 2000-09-08
  • Updated: 2001-04-26
  • Resolved: 2001-04-26
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
JDK 1.3 FCS on Solaris (and I believe Linux) core dumps occasioanlly. I've seen
a similar problem described by Linux users on the alias.

Here is the message from the VM

# # An unexpected exception has been detected in native code outside the VM.# Program counter=0xff02df7c
#
# Problematic Thread: prio=1 tid=0x3033c8 nid=0xf runnable 
#

I've seen the problem most when using Forte4J IDE. I have not found a consistant
way to reliably reproduce the core dump, using Forte4J for develop code for a 
few hours usually results in the hang.

VM is the FCS build for Solaris

summerpalace:38% java -version
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
Java HotSpot(TM) Client VM (build 1.3.0, mixed mode)

The VM is located at /net/java3d/export/jdk_1.3/Release/production/latest

The core file is attached and the bdx dump is below. It looks like native
ZIP code for java.util.zip is causing the problem.

detected a multithreaded program
dbx: program is not active
t@15 (l@160) terminated by signal ABRT (Abort)
(dbx) where 
current thread: t@15
=>[1] __sigprocmask(0x0, 0xf0e80430, 0x0, 0x0, 0x0, 0x0), at 0xff379bf0
  [2] _resetsig(0xff37c510, 0x0, 0x0, 0xf0e81d78, 0xff38e000, 0x0), at 0xff36e0
  [3] _sigon(0xf0e81d78, 0xff395990, 0x6, 0xf0e80504, 0xf0e81d78, 0xf0e80548),t 0xff36dd10
  [4] _thrp_kill(0x0, 0xf, 0x6, 0xff38e000, 0xf, 0xff33a428), at 0xff370e84
  [5] raise(0x6, 0x0, 0x0, 0xffffffff, 0xff33a394, 0xf0e8065c), at 0xff2c9b08
  [6] abort(0xff336000, 0xf0e8065c, 0x0, 0x0, 0x4, 0xf0e8067d), at 0xff2b5124
  [7] __1cbBhandle_unexpected_exception6FpnGThread_ipnHsiginfo_pC4_v_(0xfe773c, 0xa, 0xf0e80bc0, 0xff02df7c, 0xff02df7c, 0x0), at 0xfe5f0198
  [8] JVM_handle_solaris_signal(0xfe773ce8, 0xff02df7c, 0xff02df7c, 0x0, 0xff0f7c, 0x3033c8), at 0xfe5f329c
  [9] __sighndlr(0xa, 0xf0e80bc0, 0xf0e80908, 0xfe5efc10, 0xf0e81e10, 0xf0e81e), at 0xff37bd04
  ---- called from signal handler with signal 10 (SIGBUS) ------
  [10] readLOC(), at 0xff02df7c
  [11] ZIP_GetEntry(0x117, 0xffff, 0x1a5a9f3e, 0x211680, 0x0, 0xf0e80d64), at ff02e274
  [12] Java_java_util_zip_ZipFile_getEntry(0x1fcab0, 0x1f, 0x1f, 0xf0e80d64, 00e81224, 0x30344c), at 0xff023fcc
  [13] 0xfb010740(0xf2da5dc4, 0xf5e16c6a, 0xf2da5e08, 0xc, 0x73, 0xf2da5dc4),  0xfb01073f
  [14] 0xfb01bce4(0xf5e18468, 0xf2da5e08, 0xf2da5d98, 0x10, 0xf5e16c20, 0xf2da98), at 0xfb01bce3
  [15] 0xfb01b8f8(0xf5e18468, 0xf2da5e08, 0xf, 0xf2da5d98, 0x10, 0xf0e8166c),  0xfb01b8f7
  [16] 0xfb01c520(0xf5e18468, 0xf2da5e08, 0x2e, 0x2e, 0x14, 0xfe773ce8), at 0x01c51f
  [17] 0xfb225e64(0xf4788c10, 0xf2da5e08, 0x2f, 0x2e, 0x3033c8, 0xf0e8180c), a0xfb225e63
  [18] 0xfb226164(0xf4788c10, 0xf2da5e08, 0x2e, 0x7c5dc, 0x0, 0xf8f6f690), at fb226163
  [19] 0xfb2232d0(0xf478a860, 0xf2da5e08, 0x8, 0xfe773ce8, 0xf0e819c0, 0xf8f738), at 0xfb2232cf
  [20] 0xfb18d654(0xf6b1bc88, 0x0, 0x0, 0x1, 0x0, 0x0), at 0xfb18d653
  [21] 0xfb18d274(0xf6b1bc88, 0x0, 0x0, 0x1, 0x0, 0xe), at 0xfb18d273
  [22] 0xfb215958(0xf6b1bc88, 0x0, 0xf0e81748, 0xfe773ce8, 0x3033c8, 0x0), at fb215957
  [23] 0xfb21b18c(0xf6b1bc88, 0x0, 0x174, 0xf0e81, 0xfe773ce8, 0xf0e8166c), atxfb21b18b
  [24] 0xfb209788(0xf4821c70, 0x1388, 0xf0e81738, 0x3033c8, 0x14, 0xfe773ce8),t 0xfb209787
  [25] 0xfb224acc(0xf4821c70, 0xf403dc18, 0xf0e8181c, 0xf403dc18, 0x3033c8, 0xe8180c), at 0xfb224acb
  [26] 0xfb2244a0(0xf4823d18, 0x1, 0x3033c8, 0x7c5dc, 0x0, 0xf8f6f690), at 0xf2449f
  [27] 0xfb24239c(0x9, 0x1, 0x8, 0xfe773ce8, 0xf0e819c0, 0xf8f73528), at 0xfb239b
  [28] 0xfb002748(0x0, 0x1, 0xfe77ff20, 0x79e04, 0x1e, 0xe), at 0xfb002747
  [29] 0xfe7a4b34(0xf0e819e0, 0xf0e81c18, 0xa, 0xf8f70a48, 0x732fc, 0xf0e81b64 at 0xfe7a4b33
  [30] __1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArgents_pnGThread__v_(0xf0e81c10, 0xfe773ce8, 0xf0e81b5c, 0x3033c8, 0x732fc, 0xf01c18), at 0xfe549ad4
  [31] __1cJJavaCallsMcall_virtual6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_nRJavaCallArguments_pnGThread__v_(0xf8f70d40, 0xf0e81b48, 0xf0e81b4c, 0xfe773c, 0xf0e81c10, 0xf0e81b5c), at 0xfe54916c
  [32] __1cJJavaCallsMcall_virtual6FpnJJavaValue_nGHandle_nLKlassHandle_nMsymbHandle_5pnGThread__v_(0xf0e81c10, 0xf0e81c0c, 0xf0e81c08, 0xf0e81bfc, 0xf0e81b, 0x3033c8), at 0xfe5491dc
  [33] cMthread_entry6FpnKJavaThread_pnGThread__v_(0xf8c16cc8, 0x3033c8, 0xfe7ce8, 0xf0e81d18, 0x1e, 0xe), at 0xfe57a070
  [34] __1cKJavaThreadDrun6M_v_(0xf0e02000, 0xfe77d744, 0xfe773ce8, 0x80000, 0033c8, 0x80000), at 0xfe651a90
  [35] _start(0xfe773ce8, 0xff255d18, 0x0, 0x5, 0x1, 0xfe401000), at 0xfe5ed3f
(dbx) 


I am still getting core dumps from Forte4j, I can add some more core files
to the bug report if that would help.


JDK 1.3.1 has also coredumped with the same message while running
Forte4j. I've attached the new core file jdk1.3.1-core to this bug report.
This core dump seems to happen regularly in one users environment but not
in another. I can't figure out what is different between the two environments.


Another core dump from JDK 1.3.1 rc1-17, I've attached the error log file
that it produced. Certainly looks like a Zip problem....  hs_err_pid19332.log

Comments
EVALUATION The ZIP code was thoroughly reviewed and overhauled during the Kestrel/Ladybird merge, so this bug might very well have been fixed at that time. Without a reproducible test case I can't verify this, so I'm marking this as incomplete. -- mr@eng 2001/1/12 After much detective work, the cause for core dumps seen in this bug seem to lie in how the forte ide handles files rather than with how the java class libraries access zip and jar files per se. I backported some Merlin changes that increased the error checking code associated with manipulating jar files (4332864, 4332173, 4290060, 4333436). This turned certain conditions that would cause core dumps into conditions which caused exceptions. The throw site for the exceptions is the nextEntry method for an enumeration previously returned for the zip/jar file. The root cause for this exception is the underlying JNI code reading a bad "magic" value out of the file. Paul Byrne, the bug's filer, was eventually able to reliably reproduce the problem by using certain of his jar files which the ide is supposed to re-build. I reproduced the failure exception by using a test program that repeated read entries from rt.jar. While this was occurring, I copied over the rt.jar with another jar file. This immediately caused the exceptional condition to occur. Therefore, I suspect the root cause for this bug is that the forte ide is not doing proper file locking in some circumstances, leading to open files being overwritten at inopportune times. Therefore, I'm transferring the bug to forte4j:core instead of java:classes_util. joe.darcy@eng 2001-03-22 Assigning back to the java:classes_util, because we are working right with the jar files (see attached simple test class which demonstartes the above described problem). I think that jar files should be locked by default when working with them. jan.zajicek@Czech 2001-04-26 Will not fix. We cannot arrange for the VM to lock jar files to prevent this sort of problem because mandatory file locking is not generally available on Solaris and Linux. If you need to rewrite a jar file then it's up to you to make sure that it's not currently being used by a running VM. -- mr@eng 2001/4/26
04-09-0192