From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5471 invoked by alias); 26 Mar 2014 08:45:45 -0000 Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org Received: (qmail 5442 invoked by uid 48); 26 Mar 2014 08:45:44 -0000 From: "jakub at gcc dot gnu.org" To: java-prs@gcc.gnu.org Subject: [Bug java/60667] New: Undefined behavior in Java FE Date: Wed, 26 Mar 2014 08:45:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: java X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q1/txt/msg00018.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60667 Bug ID: 60667 Summary: Undefined behavior in Java FE Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: java Assignee: unassigned at gcc dot gnu.org Reporter: jakub at gcc dot gnu.org CC: aph at gcc dot gnu.org Undefined behavior in java FE. In --with-build-config=bootstrap-ubsan i686 trunk bootstrap I'm getting several: ../../gcc/double-int.c:1064:33: runtime error: shift exponent -65 is negative errors (and similar), e.g. on: /usr/src/gcc/obj985a/./gcc/gcj -B/usr/src/gcc/obj985a/i686-pc-linux-gnu/libjava/ -B/usr/src/gcc/obj985a/./gcc/ -B/usr/local/i686-pc-linux-gnu/bin/ -B/usr/local/i686-pc-linux-gnu/lib/ -isystem /usr/local/i686-pc-linux-gnu/include -isystem /usr/local/i686-pc-linux-gnu/sys-include -ffloat-store -fomit-frame-pointer -Usun -fclasspath= -fbootclasspath=../../../libjava/classpath/lib --encoding=UTF-8 -Wno-deprecated -fbootstrap-classes -g -O2 -c -fsource-filename=/usr/src/gcc/obj985a/i686-pc-linux-gnu/libjava/classpath/lib/classes -MT gnu/java/awt.lo -MD -MP -MF gnu/java/awt.deps @gnu/java/awt.list -fPIC -o gnu/java/.libs/awt.o This happens on: #0 double_int::set_bit (this=0xffffc920, bitpos=4294967295) at ../../gcc/double-int.c:1064 #1 0x08258b8a in mark_reference_fields (field=0xf79c1844, mask=, pointer_after_end=0xffffc920, all_bits_set=0x8258e06, last_set_index=0xffffc90c, last_view_index=0xffffc910, ubit=32) at ../../gcc/java/boehm.c:110 p int_byte_position (field) $12 = 128 p ubit $13 = 32 p int_size_in_bytes (field->typed.type) $17 = 4 Thus count is 32, ubit 32, size_words 1 and ubit - count - i - 1 is -1, thus *mask = (*mask).set_bit (ubit - count - i - 1); is set_bit (0xffffffff) and attempts to shift up by (int) (0xffffffff - 64). p debug_tree (field) unit size align 32 symtab 0 alias set -1 canonical type 0xf79b1ba0 fields pointer_to_this chain > unsigned SI size unit size align 32 symtab 0 alias set -1 canonical type 0xf79b1c00 pointer_to_this > unsigned decl_5 SI file /usr/src/gcc/libjava/classpath/java/awt/Component.java line 0 col 0 size unit size align 32 offset_align 128 offset constant 128> bit offset constant 0> context chain > $18 = void Can you please fix this, I have no idea what this code tries to do and why.