JDK-8003413 : jni_md.h JNI Header has wrong definition for jlong
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2012-11-14
  • Updated: 2012-11-16
  • Resolved: 2012-11-16
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.7.0_10-ea"
Java(TM) SE Runtime Environment (build 1.7.0_10-ea-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
OS X 10.8.2

A DESCRIPTION OF THE PROBLEM :
With Java 6 jlong was always defined as "long long"

Java 7 conditionally defines it as either "long" or "long long" and clearly gets it wrong sometimes.

REGRESSION.  Last worked in version 6u31

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile a C++ method that uses a jlong argument using the header from Apple's Java 6.  Try to link it with code that compiles with the header from Java 7.

(using -m64 for 64 bit code in both cases)

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
jlong should be defined the same in both cases
ACTUAL -
Java7 7 header defines jlong as "long" instead of "long long" and the code can't find a matching method signature to link with.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Undefined symbols for architecture x86_64:
  "KayakDataTypeWrapper::get_long(JNIEnv_*, wchar_t const*, long)", referenced from:
      ANCProcessor::fillDataType(JNIEnv_*, KayakDataTypeWrapper, KayakDataTypeWrapper&, MetaInfo*)in ANCProcessor.o


REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Compile always using the JNI headers from Apple's Java 6
Comments
We are aware of this issue and the need to fix it.
16-11-2012

I've moved this to hotspot/runtime as there is no longer a jni subcomponent.
15-11-2012