public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/23682] gnu.java.nio.SelectorImpl.select(long) throws ArrayIndexOutOfBoundsException
       [not found] <bug-23682-11287@http.gcc.gnu.org/bugzilla/>
@ 2006-04-03 13:02 ` green at redhat dot com
  2006-04-05 21:38 ` tromey at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: green at redhat dot com @ 2006-04-03 13:02 UTC (permalink / raw)
  To: java-prs



------- Comment #3 from green at redhat dot com  2006-04-03 13:02 -------
Azureus users on FC5 see this as well (gcj 4.1.0).  Here's a slightly 
different stack trace.

[12:31:21.648] {stderr} DEBUG::Mon Apr 03 12:31:21 GMT
2006::com.aelitis.azureus.core.networkmanager.VirtualChannelSelector::select::-1:
[12:31:21.649] {stderr}   Caught exception on selector.select() op: 3
[12:31:21.650] {stderr}    
ReadController::readSelectorLoop::-1,ReadController::access$0::-1,ReadController$1::runSupport::-1,AEThread::run::-1
[12:31:21.718] {stderr} java.lang.ArrayIndexOutOfBoundsException: 3
[12:31:21.719] {stderr}    at gnu.java.nio.SelectorImpl.getFDsAsArray
(libgcj.so.7)
[12:31:21.720] {stderr}    at gnu.java.nio.SelectorImpl.select (libgcj.so.7)
[12:31:21.720] {stderr}    at
com.aelitis.azureus.core.networkmanager.impl.VirtualChannelSelectorImpl.select
(Azureus2.jar.so)
[12:31:21.721] {stderr}    at
com.aelitis.azureus.core.networkmanager.VirtualChannelSelector.select
(Azureus2.jar.so)
[12:31:21.721] {stderr}    at
com.aelitis.azureus.core.networkmanager.impl.ReadController.readSelectorLoop
(Azureus2.jar.so)
[12:31:21.722] {stderr}    at
com.aelitis.azureus.core.networkmanager.impl.ReadController.access$0
(Azureus2.jar.so)
[12:31:21.722] {stderr}    at
com.aelitis.azureus.core.networkmanager.impl.ReadController$1.runSupport
(Azureus2.jar.so)
[12:31:21.723] {stderr}    at org.gudy.azureus2.core3.util.AEThread.run
(Azureus2.jar.so)


-- 


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


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

* [Bug libgcj/23682] gnu.java.nio.SelectorImpl.select(long) throws ArrayIndexOutOfBoundsException
       [not found] <bug-23682-11287@http.gcc.gnu.org/bugzilla/>
  2006-04-03 13:02 ` [Bug libgcj/23682] gnu.java.nio.SelectorImpl.select(long) throws ArrayIndexOutOfBoundsException green at redhat dot com
@ 2006-04-05 21:38 ` tromey at gcc dot gnu dot org
  2006-07-28 22:06 ` tromey at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-04-05 21:38 UTC (permalink / raw)
  To: java-prs



------- Comment #4 from tromey at gcc dot gnu dot org  2006-04-05 21:38 -------
One possible problem I see here is that the 'interestOps' of
a SelectionKeyImpl can change while getFDsAsArray is running.
There are a few possible fixes here, the simplest would be to
avoid having two loops in getFDsAsArray.

If I send a patch can you easily test it?


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-04-05 21:38:39
               date|                            |


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


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

* [Bug libgcj/23682] gnu.java.nio.SelectorImpl.select(long) throws ArrayIndexOutOfBoundsException
       [not found] <bug-23682-11287@http.gcc.gnu.org/bugzilla/>
  2006-04-03 13:02 ` [Bug libgcj/23682] gnu.java.nio.SelectorImpl.select(long) throws ArrayIndexOutOfBoundsException green at redhat dot com
  2006-04-05 21:38 ` tromey at gcc dot gnu dot org
@ 2006-07-28 22:06 ` tromey at gcc dot gnu dot org
  2006-07-31 21:58 ` tromey at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-07-28 22:06 UTC (permalink / raw)
  To: java-prs



------- Comment #5 from tromey at gcc dot gnu dot org  2006-07-28 22:06 -------
I have a patch I'm testing.

This code in classpath looks quite bad :(
I fixed this problem by adding synchronization.
However, really very little synchronization should be needed.
Instead we could be doing something like building a data structure
for poll() ahead of time and tracking changes to the selection
keys more directly; I think this would yield better performance.
Right now we do multiple allocations for every select operation.

Also I suspect that using select(2) instead of poll(2) is bad
for applications making large numbers of connections.  select
has built-in limits on the the number of file descriptors it can use.

Finally. our code to select without waiting actually will wait
for up to 1ms.  This is fixable as well, it looks like the original
author just did it the "simple" way for convenience of writing a
single native method.


-- 

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
   Last reconfirmed|2006-04-05 21:38:39         |2006-07-28 22:06:20
               date|                            |


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


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

* [Bug libgcj/23682] gnu.java.nio.SelectorImpl.select(long) throws ArrayIndexOutOfBoundsException
       [not found] <bug-23682-11287@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2006-07-28 22:06 ` tromey at gcc dot gnu dot org
@ 2006-07-31 21:58 ` tromey at gcc dot gnu dot org
  2006-07-31 22:09 ` cvs-commit at developer dot classpath dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-07-31 21:58 UTC (permalink / raw)
  To: java-prs



------- Comment #6 from tromey at gcc dot gnu dot org  2006-07-31 21:58 -------
*** Bug 26506 has been marked as a duplicate of this bug. ***


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ryanwalklin at orcon dot net
                   |                            |dot nz


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


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

* [Bug libgcj/23682] gnu.java.nio.SelectorImpl.select(long) throws ArrayIndexOutOfBoundsException
       [not found] <bug-23682-11287@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2006-07-31 21:58 ` tromey at gcc dot gnu dot org
@ 2006-07-31 22:09 ` cvs-commit at developer dot classpath dot org
  2006-08-07 22:23 ` cvs-commit at developer dot classpath dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at developer dot classpath dot org @ 2006-07-31 22:09 UTC (permalink / raw)
  To: java-prs



------- Comment #7 from cvs-commit at developer dot classpath dot org  2006-07-31 22:09 -------
Subject: Bug 23682

CVSROOT:        /cvsroot/classpath
Module name:    classpath
Changes by:     Tom Tromey <tromey>     06/07/31 22:08:00

Modified files:
        gnu/java/nio   : SelectionKeyImpl.java SelectorImpl.java 
        java/nio/channels: SelectionKey.java 
        .              : ChangeLog 
        java/nio/channels/spi: AbstractSelectionKey.java 

Log message:
                PR libgcj/23682:
                * java/nio/channels/SelectionKey.java (attach): Now
synchronized.
                (attachment): Likewise.
                * java/nio/channels/spi/AbstractSelectionKey.java (cancel): Now
                synchronized.
                (isValid): Likewise.
                * gnu/java/nio/SelectionKeyImpl.java (impl): Now final
                (ch): Likewise.
                (interestOps): Synchronize.
                (readyOps): Likewise.
                * gnu/java/nio/SelectorImpl.java (register): Synchronize around
                interestOps call.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/nio/SelectionKeyImpl.java?cvsroot=classpath&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/nio/SelectorImpl.java?cvsroot=classpath&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/classpath/java/nio/channels/SelectionKey.java?cvsroot=classpath&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&r1=1.8279&r2=1.8280
http://cvs.savannah.gnu.org/viewcvs/classpath/java/nio/channels/spi/AbstractSelectionKey.java?cvsroot=classpath&r1=1.9&r2=1.10


-- 


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


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

* [Bug libgcj/23682] gnu.java.nio.SelectorImpl.select(long) throws ArrayIndexOutOfBoundsException
       [not found] <bug-23682-11287@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2006-07-31 22:09 ` cvs-commit at developer dot classpath dot org
@ 2006-08-07 22:23 ` cvs-commit at developer dot classpath dot org
  2006-08-07 22:24 ` cvs-commit at developer dot classpath dot org
  2007-03-30 21:53 ` tromey at gcc dot gnu dot org
  7 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at developer dot classpath dot org @ 2006-08-07 22:23 UTC (permalink / raw)
  To: java-prs



------- Comment #8 from cvs-commit at developer dot classpath dot org  2006-08-07 22:23 -------
Subject: Bug 23682

CVSROOT:        /cvsroot/classpath
Module name:    classpath
Branch:         classpath-0_92-branch
Changes by:     Mark Wielaard <mark>    06/08/07 22:22:52

Modified files:
        .              : ChangeLog 
        gnu/java/nio   : SelectionKeyImpl.java SelectorImpl.java 
        java/nio/channels: SelectionKey.java 
        java/nio/channels/spi: AbstractSelectionKey.java 

Log message:
        2006-08-07  Tom Tromey  <tromey@redhat.com>

               PR libgcj/23682:
               * java/nio/channels/SelectionKey.java (attach): Now
synchronized.
               (attachment): Likewise.
               * java/nio/channels/spi/AbstractSelectionKey.java (cancel): Now
               synchronized.
               (isValid): Likewise.
               * gnu/java/nio/SelectionKeyImpl.java (impl): Now final
               (ch): Likewise.
               (interestOps): Synchronize.
               (readyOps): Likewise.
               * gnu/java/nio/SelectorImpl.java (register): Synchronize around
               interestOps call.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&only_with_tag=classpath-0_92-branch&r1=1.8251.2.28&r2=1.8251.2.29
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/nio/SelectionKeyImpl.java?cvsroot=classpath&only_with_tag=classpath-0_92-branch&r1=1.9&r2=1.9.10.1
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/nio/SelectorImpl.java?cvsroot=classpath&only_with_tag=classpath-0_92-branch&r1=1.22&r2=1.22.2.1
http://cvs.savannah.gnu.org/viewcvs/classpath/java/nio/channels/SelectionKey.java?cvsroot=classpath&only_with_tag=classpath-0_92-branch&r1=1.8&r2=1.8.10.1
http://cvs.savannah.gnu.org/viewcvs/classpath/java/nio/channels/spi/AbstractSelectionKey.java?cvsroot=classpath&only_with_tag=classpath-0_92-branch&r1=1.9&r2=1.9.10.1


-- 


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


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

* [Bug libgcj/23682] gnu.java.nio.SelectorImpl.select(long) throws ArrayIndexOutOfBoundsException
       [not found] <bug-23682-11287@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2006-08-07 22:23 ` cvs-commit at developer dot classpath dot org
@ 2006-08-07 22:24 ` cvs-commit at developer dot classpath dot org
  2007-03-30 21:53 ` tromey at gcc dot gnu dot org
  7 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at developer dot classpath dot org @ 2006-08-07 22:24 UTC (permalink / raw)
  To: java-prs



------- Comment #9 from cvs-commit at developer dot classpath dot org  2006-08-07 22:24 -------
Subject: Bug 23682

CVSROOT:        /cvsroot/classpath
Module name:    classpath
Branch:         generics-branch
Changes by:     Mark Wielaard <mark>    06/08/07 22:23:02

Modified files:
        .              : ChangeLog 
        gnu/java/nio   : SelectionKeyImpl.java SelectorImpl.java 
        java/nio/channels: SelectionKey.java 
        java/nio/channels/spi: AbstractSelectionKey.java 

Log message:
        2006-08-07  Tom Tromey  <tromey@redhat.com>

               PR libgcj/23682:
               * java/nio/channels/SelectionKey.java (attach): Now
synchronized.
               (attachment): Likewise.
               * java/nio/channels/spi/AbstractSelectionKey.java (cancel): Now
               synchronized.
               (isValid): Likewise.
               * gnu/java/nio/SelectionKeyImpl.java (impl): Now final
               (ch): Likewise.
               (interestOps): Synchronize.
               (readyOps): Likewise.
               * gnu/java/nio/SelectorImpl.java (register): Synchronize around
               interestOps call.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&only_with_tag=generics-branch&r1=1.2386.2.321&r2=1.2386.2.322
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/nio/SelectionKeyImpl.java?cvsroot=classpath&only_with_tag=generics-branch&r1=1.8.2.1&r2=1.8.2.2
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/nio/SelectorImpl.java?cvsroot=classpath&only_with_tag=generics-branch&r1=1.16.2.6&r2=1.16.2.7
http://cvs.savannah.gnu.org/viewcvs/classpath/java/nio/channels/SelectionKey.java?cvsroot=classpath&only_with_tag=generics-branch&r1=1.7.2.1&r2=1.7.2.2
http://cvs.savannah.gnu.org/viewcvs/classpath/java/nio/channels/spi/AbstractSelectionKey.java?cvsroot=classpath&only_with_tag=generics-branch&r1=1.8.2.1&r2=1.8.2.2


-- 


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


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

* [Bug libgcj/23682] gnu.java.nio.SelectorImpl.select(long) throws ArrayIndexOutOfBoundsException
       [not found] <bug-23682-11287@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2006-08-07 22:24 ` cvs-commit at developer dot classpath dot org
@ 2007-03-30 21:53 ` tromey at gcc dot gnu dot org
  7 siblings, 0 replies; 10+ messages in thread
From: tromey at gcc dot gnu dot org @ 2007-03-30 21:53 UTC (permalink / raw)
  To: java-prs



------- Comment #10 from tromey at gcc dot gnu dot org  2007-03-30 22:53 -------
The fix went in a while back.

Really someone ought to port classpath's newer poll/epoll-based
nio selector to CNI.  That would be more efficient than what
we have now.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.0


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


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

* [Bug libgcj/23682] gnu.java.nio.SelectorImpl.select(long) throws ArrayIndexOutOfBoundsException
  2005-09-01 17:58 [Bug libgcj/23682] New: " gcc-bugzilla at future dot shiny dot co dot il
  2005-09-01 18:53 ` [Bug libgcj/23682] " pinskia at gcc dot gnu dot org
@ 2005-09-01 19:11 ` gcc-bugzilla at future dot shiny dot co dot il
  1 sibling, 0 replies; 10+ messages in thread
From: gcc-bugzilla at future dot shiny dot co dot il @ 2005-09-01 19:11 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From gcc-bugzilla at future dot shiny dot co dot il  2005-09-01 19:11 -------
Here's what Azureus (a free Java Bittorrent client) reported me:
[9:07:22] DEBUG::Thu Sep 01 09:07:22 GMT+03:00
2005::com.aelitis.azureus.core.networkmanager.VirtualChannelSelector::select(long)::-1:
[9:07:22]   Caught exception on selector.select() op: 1
[9:07:22]    
ReadController::readSelectorLoop()::-1,ReadController::access$0(com.aelitis.azureus.core.networkmanager.impl.ReadController)::-1,ReadController$1::runSupport()::-1,AEThread::run()::-1,::GC_start_routine::-1,::__clone::-1
[9:07:22] java.lang.ArrayIndexOutOfBoundsException: 1
   at gnu.java.nio.SelectorImpl.select(long) (/usr/lib64/libgcj.so.6.0.0)
   at
com.aelitis.azureus.core.networkmanager.impl.VirtualChannelSelectorImpl.select(long)
(Unknown Source)
   at
com.aelitis.azureus.core.networkmanager.VirtualChannelSelector.select(long)
(Unknown Source)
   at
com.aelitis.azureus.core.networkmanager.impl.ReadController.readSelectorLoop()
(Unknown Source)
   at
com.aelitis.azureus.core.networkmanager.impl.ReadController.access$0(com.aelitis.azureus.core.networkmanager.impl.ReadController)
(Unknown Source)
   at com.aelitis.azureus.core.networkmanager.impl.ReadController$1.runSupport()
(Unknown Source)
   at org.gudy.azureus2.core3.util.AEThread.run() (Unknown Source)
   at .GC_start_routine (/usr/lib64/libgcj.so.6.0.0)
   at .__clone (/lib64/libc-2.3.5.so)


-- 


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


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

* [Bug libgcj/23682] gnu.java.nio.SelectorImpl.select(long) throws ArrayIndexOutOfBoundsException
  2005-09-01 17:58 [Bug libgcj/23682] New: " gcc-bugzilla at future dot shiny dot co dot il
@ 2005-09-01 18:53 ` pinskia at gcc dot gnu dot org
  2005-09-01 19:11 ` gcc-bugzilla at future dot shiny dot co dot il
  1 sibling, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-01 18:53 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-01 18:53 -------
ArrayIndexOutOfBoundsException is thrown for no reason as far as I can see from the source?
Do you have an example where it is thrown?

-- 


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


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

end of thread, other threads:[~2007-03-30 21:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-23682-11287@http.gcc.gnu.org/bugzilla/>
2006-04-03 13:02 ` [Bug libgcj/23682] gnu.java.nio.SelectorImpl.select(long) throws ArrayIndexOutOfBoundsException green at redhat dot com
2006-04-05 21:38 ` tromey at gcc dot gnu dot org
2006-07-28 22:06 ` tromey at gcc dot gnu dot org
2006-07-31 21:58 ` tromey at gcc dot gnu dot org
2006-07-31 22:09 ` cvs-commit at developer dot classpath dot org
2006-08-07 22:23 ` cvs-commit at developer dot classpath dot org
2006-08-07 22:24 ` cvs-commit at developer dot classpath dot org
2007-03-30 21:53 ` tromey at gcc dot gnu dot org
2005-09-01 17:58 [Bug libgcj/23682] New: " gcc-bugzilla at future dot shiny dot co dot il
2005-09-01 18:53 ` [Bug libgcj/23682] " pinskia at gcc dot gnu dot org
2005-09-01 19:11 ` gcc-bugzilla at future dot shiny dot co dot il

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).