Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F16F0106BF for ; Tue, 3 Mar 2015 19:27:04 +0000 (UTC) Received: (qmail 3022 invoked by uid 500); 3 Mar 2015 19:26:06 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 2970 invoked by uid 500); 3 Mar 2015 19:26:06 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 2956 invoked by uid 99); 3 Mar 2015 19:26:06 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Mar 2015 19:26:06 +0000 Date: Tue, 3 Mar 2015 19:26:05 +0000 (UTC) From: "Chris Nauroth (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-10027) *Compressor_deflateBytesDirect passes instance instead of jclass to GetStaticObjectField MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HADOOP-10027?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14345570#comment-14345570 ] Chris Nauroth commented on HADOOP-10027: ---------------------------------------- I agree with the plan of fixing the bug across all codecs here, and then deferring bzip2 test coverage to a separate jira. Thanks! > *Compressor_deflateBytesDirect passes instance instead of jclass to GetStaticObjectField > ---------------------------------------------------------------------------------------- > > Key: HADOOP-10027 > URL: https://issues.apache.org/jira/browse/HADOOP-10027 > Project: Hadoop Common > Issue Type: Bug > Components: native > Reporter: Eric Abbott > Assignee: Hui Zheng > Priority: Minor > Attachments: HADOOP-10027.1.patch, HADOOP-10027.2.patch > > > http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/compress/zlib/ZlibCompressor.c?view=markup > This pattern appears in all the native compressors. > // Get members of ZlibCompressor > jobject clazz = (*env)->GetStaticObjectField(env, this, > ZlibCompressor_clazz); > The 2nd argument to GetStaticObjectField is supposed to be a jclass, not a jobject. Adding the JVM param -Xcheck:jni will cause "FATAL ERROR in native method: JNI received a class argument that is not a class" and a core dump such as the following. > (gdb) > #0 0x00007f02e4aef8a5 in raise () from /lib64/libc.so.6 > #1 0x00007f02e4af1085 in abort () from /lib64/libc.so.6 > #2 0x00007f02e45bd727 in os::abort(bool) () from /opt/jdk1.6.0_31/jre/lib/amd64/server/libjvm.so > #3 0x00007f02e43cec63 in jniCheck::validate_class(JavaThread*, _jclass*, bool) () from /opt/jdk1.6.0_31/jre/lib/amd64/server/libjvm.so > #4 0x00007f02e43ea669 in checked_jni_GetStaticObjectField () from /opt/jdk1.6.0_31/jre/lib/amd64/server/libjvm.so > #5 0x00007f02d38eaf79 in Java_org_apache_hadoop_io_compress_zlib_ZlibCompressor_deflateBytesDirect () from /usr/lib/hadoop/lib/native/libhadoop.so.1.0.0 > In addition, that clazz object is only used for synchronization. In the case of the native method _deflateBytesDirect, the result is a class wide lock used to access the instance field uncompressed_direct_buf. Perhaps using the instance as the sync point is more appropriate? -- This message was sent by Atlassian JIRA (v6.3.4#6332)