From notifications-return-13693-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Tue Aug 21 07:24:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id BF6B4180630 for ; Tue, 21 Aug 2018 07:24:04 +0200 (CEST) Received: (qmail 47174 invoked by uid 500); 21 Aug 2018 05:24:03 -0000 Mailing-List: contact notifications-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list notifications@groovy.apache.org Received: (qmail 47165 invoked by uid 99); 21 Aug 2018 05:24:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Aug 2018 05:24:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id CA0D0C9090 for ; Tue, 21 Aug 2018 05:24:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id XaoCV1uMQ8CS for ; Tue, 21 Aug 2018 05:24:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 36A025F3CE for ; Tue, 21 Aug 2018 05:24:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 64960E00CB for ; Tue, 21 Aug 2018 05:24:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 0E8DE23F98 for ; Tue, 21 Aug 2018 05:24:00 +0000 (UTC) Date: Tue, 21 Aug 2018 05:24:00 +0000 (UTC) From: "Paul King (JIRA)" To: notifications@groovy.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (GROOVY-8758) @WithReadLock in inner class of @CompileStatic class causes java.lang.VerifyError MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/GROOVY-8758?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul King reassigned GROOVY-8758: --------------------------------- Assignee: Paul King > @WithReadLock in inner class of @CompileStatic class causes java.lang.Ver= ifyError > -------------------------------------------------------------------------= -------- > > Key: GROOVY-8758 > URL: https://issues.apache.org/jira/browse/GROOVY-8758 > Project: Groovy > Issue Type: Bug > Components: bytecode, Static compilation > Affects Versions: 2.5.2 > Environment: Ubuntu 18.04 x86_64, OpenJDK 10 > Reporter: Curtis Mackie > Assignee: Paul King > Priority: Major > > Minimal reproduction: > {code:java} > import groovy.transform.CompileStatic > import groovy.transform.WithReadLock > @CompileStatic > class A { > =C2=A0=C2=A0=C2=A0 private class B { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 @WithReadLock > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int getFoo() { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } > =C2=A0=C2=A0=C2=A0 } > =C2=A0=C2=A0=C2=A0 private B b > =C2=A0=C2=A0=C2=A0 A() { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 b =3D new B() > =C2=A0=C2=A0=C2=A0 } > } > def a =3D new A() > {code} > Output from groovy: > {noformat} > Caught: java.lang.VerifyError: Bad type on operand stack > Exception Details: > =C2=A0 Location: > =C2=A0=C2=A0=C2=A0 A$B.getFoo()I @4: invokevirtual > =C2=A0 Reason: > =C2=A0=C2=A0=C2=A0 Type 'A' (current frame, stack[0]) is not assignable t= o 'java/util/concurrent/locks/ReentrantReadWriteLock$ReadLock' > =C2=A0 Current Frame: > =C2=A0=C2=A0=C2=A0 bci: @4 > =C2=A0=C2=A0=C2=A0 flags: { } > =C2=A0=C2=A0=C2=A0 locals: { 'A$B' } > =C2=A0=C2=A0=C2=A0 stack: { 'A' } > =C2=A0 Bytecode: > =C2=A0=C2=A0=C2=A0 0x0000000: 2ab4 0015 b600 2d01 5703 3c00 2ab4 0015 > =C2=A0=C2=A0=C2=A0 0x0000010: b600 3001 5700 1bac 0000 bf00 0000 0000 > =C2=A0=C2=A0=C2=A0 0x0000020: 0000 0000 0000 00bf 4d2a b400 15b6 0030 > =C2=A0=C2=A0=C2=A0 0x0000030: 0157 2cbf 0000 bf=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 =C2=A0 > =C2=A0 Exception Handler Table: > =C2=A0=C2=A0=C2=A0 bci [9, 12] =3D> handler: 40 > =C2=A0=C2=A0=C2=A0 bci [22, 24] =3D> handler: 40 > =C2=A0 Stackmap Table: > =C2=A0=C2=A0=C2=A0 full_frame(@24,{},{Object[#51]}) > =C2=A0=C2=A0=C2=A0 same_locals_1_stack_item_frame(@27,Object[#51]) > =C2=A0=C2=A0=C2=A0 full_frame(@40,{Object[#2]},{Object[#51]}) > =C2=A0=C2=A0=C2=A0 full_frame(@52,{},{Object[#51]}) > java.lang.VerifyError: Bad type on operand stack > Exception Details: > =C2=A0 Location: > =C2=A0=C2=A0=C2=A0 A$B.getFoo()I @4: invokevirtual > =C2=A0 Reason: > =C2=A0=C2=A0=C2=A0 Type 'A' (current frame, stack[0]) is not assignable t= o 'java/util/concurrent/locks/ReentrantReadWriteLock$ReadLock' > =C2=A0 Current Frame: > =C2=A0=C2=A0=C2=A0 bci: @4 > =C2=A0=C2=A0=C2=A0 flags: { } > =C2=A0=C2=A0=C2=A0 locals: { 'A$B' } > =C2=A0=C2=A0=C2=A0 stack: { 'A' } > =C2=A0 Bytecode: > =C2=A0=C2=A0=C2=A0 0x0000000: 2ab4 0015 b600 2d01 5703 3c00 2ab4 0015 > =C2=A0=C2=A0=C2=A0 0x0000010: b600 3001 5700 1bac 0000 bf00 0000 0000 > =C2=A0=C2=A0=C2=A0 0x0000020: 0000 0000 0000 00bf 4d2a b400 15b6 0030 > =C2=A0=C2=A0=C2=A0 0x0000030: 0157 2cbf 0000 bf=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 =C2=A0 > =C2=A0 Exception Handler Table: > =C2=A0=C2=A0=C2=A0 bci [9, 12] =3D> handler: 40 > =C2=A0=C2=A0=C2=A0 bci [22, 24] =3D> handler: 40 > =C2=A0 Stackmap Table: > =C2=A0=C2=A0=C2=A0 full_frame(@24,{},{Object[#51]}) > =C2=A0=C2=A0=C2=A0 same_locals_1_stack_item_frame(@27,Object[#51]) > =C2=A0=C2=A0=C2=A0 full_frame(@40,{Object[#2]},{Object[#51]}) > =C2=A0=C2=A0=C2=A0 full_frame(@52,{},{Object[#51]}) > =C2=A0=C2=A0 =C2=A0at A.(test.groovy:16) > =C2=A0=C2=A0 =C2=A0at test.run(test.groovy:20){noformat} > From a glance at the bytecode, it looks like Groovy is creating the $reen= trantlock field in A$B as it should, but in the actual method it tries to u= se this$0 (i.e. the reference to the enclosing outer A object) as a Reentra= ntReadWriteLock instead. > This error also occurs with @WithWriteLock, but doesn't occur with @Synch= ronized. -- This message was sent by Atlassian JIRA (v7.6.3#76005)