public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/11241] New: WeakHashMap throws a "/ zero" ArithmeticException when initialCapacity is explicitly zero
@ 2003-06-18 15:33 mikeb at lshift dot net
  2003-08-01  3:44 ` [Bug libgcj/11241] " tromey at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: mikeb at lshift dot net @ 2003-06-18 15:33 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11241

           Summary: WeakHashMap throws a "/ zero" ArithmeticException when
                    initialCapacity is explicitly zero
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: libgcj
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mikeb@lshift.net
                CC: gcc-bugs@gcc.gnu.org

When a java.util.WeakHashMap is constructed with the initial capacity explicitly
zero, using get() can throw a "/ zero" java.lang.ArithmeticException.  The
problem is in the private hash function, which uses "x % buckets.length".  In
the case of an initial capacity of zero, buckets.length is zero.

I've fixed that immediate problem (test cases and patch coming RSN).  There
appear to be some other problems with WeakHashMap in the same circumstances
though.  I'll work through those now ...


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libgcj/11241] WeakHashMap throws a "/ zero" ArithmeticException when initialCapacity is explicitly zero
  2003-06-18 15:33 [Bug libgcj/11241] New: WeakHashMap throws a "/ zero" ArithmeticException when initialCapacity is explicitly zero mikeb at lshift dot net
@ 2003-08-01  3:44 ` tromey at gcc dot gnu dot org
  2003-08-01 13:24 ` mikeb at lshift dot net
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tromey at gcc dot gnu dot org @ 2003-08-01  3:44 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11241



------- Additional Comments From tromey at gcc dot gnu dot org  2003-08-01 03:44 -------
Did you ever come up with a test case and patch?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libgcj/11241] WeakHashMap throws a "/ zero" ArithmeticException when initialCapacity is explicitly zero
  2003-06-18 15:33 [Bug libgcj/11241] New: WeakHashMap throws a "/ zero" ArithmeticException when initialCapacity is explicitly zero mikeb at lshift dot net
  2003-08-01  3:44 ` [Bug libgcj/11241] " tromey at gcc dot gnu dot org
@ 2003-08-01 13:24 ` mikeb at lshift dot net
  2003-08-01 15:23 ` pinskia at physics dot uc dot edu
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mikeb at lshift dot net @ 2003-08-01 13:24 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11241



------- Additional Comments From mikeb at lshift dot net  2003-08-01 13:24 -------
Created an attachment (id=4546)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4546&action=view)
Simple test case for defect

A fairly amateur test case for the defect described.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libgcj/11241] WeakHashMap throws a "/ zero" ArithmeticException when initialCapacity is explicitly zero
  2003-06-18 15:33 [Bug libgcj/11241] New: WeakHashMap throws a "/ zero" ArithmeticException when initialCapacity is explicitly zero mikeb at lshift dot net
  2003-08-01  3:44 ` [Bug libgcj/11241] " tromey at gcc dot gnu dot org
  2003-08-01 13:24 ` mikeb at lshift dot net
@ 2003-08-01 15:23 ` pinskia at physics dot uc dot edu
  2003-08-01 21:20 ` tromey at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-08-01 15:23 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11241


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-08-01 15:23:11
               date|                            |


------- Additional Comments From pinskia at physics dot uc dot edu  2003-08-01 15:23 -------
I can confirm this in the mainline (20030801).


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libgcj/11241] WeakHashMap throws a "/ zero" ArithmeticException when initialCapacity is explicitly zero
  2003-06-18 15:33 [Bug libgcj/11241] New: WeakHashMap throws a "/ zero" ArithmeticException when initialCapacity is explicitly zero mikeb at lshift dot net
                   ` (2 preceding siblings ...)
  2003-08-01 15:23 ` pinskia at physics dot uc dot edu
@ 2003-08-01 21:20 ` tromey at gcc dot gnu dot org
  2003-08-01 21:22 ` tromey at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tromey at gcc dot gnu dot org @ 2003-08-01 21:20 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11241


tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |tromey at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libgcj/11241] WeakHashMap throws a "/ zero" ArithmeticException when initialCapacity is explicitly zero
  2003-06-18 15:33 [Bug libgcj/11241] New: WeakHashMap throws a "/ zero" ArithmeticException when initialCapacity is explicitly zero mikeb at lshift dot net
                   ` (3 preceding siblings ...)
  2003-08-01 21:20 ` tromey at gcc dot gnu dot org
@ 2003-08-01 21:22 ` tromey at gcc dot gnu dot org
  2003-08-01 21:30 ` cvs-commit at gcc dot gnu dot org
  2003-10-17 19:20 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: tromey at gcc dot gnu dot org @ 2003-08-01 21:22 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11241


tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


------- Additional Comments From tromey at gcc dot gnu dot org  2003-08-01 21:22 -------
I'm checking in a fix for this.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libgcj/11241] WeakHashMap throws a "/ zero" ArithmeticException when initialCapacity is explicitly zero
  2003-06-18 15:33 [Bug libgcj/11241] New: WeakHashMap throws a "/ zero" ArithmeticException when initialCapacity is explicitly zero mikeb at lshift dot net
                   ` (4 preceding siblings ...)
  2003-08-01 21:22 ` tromey at gcc dot gnu dot org
@ 2003-08-01 21:30 ` cvs-commit at gcc dot gnu dot org
  2003-10-17 19:20 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-08-01 21:30 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11241



------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-08-01 21:30 -------
Subject: Bug 11241

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tromey@gcc.gnu.org	2003-08-01 21:30:14

Modified files:
	libjava        : ChangeLog 
	libjava/java/util: WeakHashMap.java 

Log message:
	Fix for PR libgcj/11241:
	* java/util/WeakHashMap.java (WeakHashMap(int,float)): If
	initialCapacity is 0, set it to 1.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.2078&r2=1.2079
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/java/util/WeakHashMap.java.diff?cvsroot=gcc&r1=1.6&r2=1.7


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libgcj/11241] WeakHashMap throws a "/ zero" ArithmeticException when initialCapacity is explicitly zero
  2003-06-18 15:33 [Bug libgcj/11241] New: WeakHashMap throws a "/ zero" ArithmeticException when initialCapacity is explicitly zero mikeb at lshift dot net
                   ` (5 preceding siblings ...)
  2003-08-01 21:30 ` cvs-commit at gcc dot gnu dot org
@ 2003-10-17 19:20 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-10-17 19:20 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11241


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |scgmille at freenetproject
                   |                            |dot org


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-10-17 18:59 -------
*** Bug 12664 has been marked as a duplicate of this bug. ***


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-10-17 18:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-18 15:33 [Bug libgcj/11241] New: WeakHashMap throws a "/ zero" ArithmeticException when initialCapacity is explicitly zero mikeb at lshift dot net
2003-08-01  3:44 ` [Bug libgcj/11241] " tromey at gcc dot gnu dot org
2003-08-01 13:24 ` mikeb at lshift dot net
2003-08-01 15:23 ` pinskia at physics dot uc dot edu
2003-08-01 21:20 ` tromey at gcc dot gnu dot org
2003-08-01 21:22 ` tromey at gcc dot gnu dot org
2003-08-01 21:30 ` cvs-commit at gcc dot gnu dot org
2003-10-17 19:20 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).