[jcifs] Re: jcifs-1.1.9 ArrayIndexOutOfBoundsException: -2146866174

madlg3 at vodafone.es madlg3 at vodafone.es
Fri Mar 4 09:26:39 GMT 2005


Hi,

The ArrayIndexOutOfBoundException occurred in Windows, Solaris and HP-
UX. But today I do not get the same exception, I get 
a diffeernt exception for Linux, Windows, solaris and HP-Ux against 2 
different servers, one W2003 and one XP:
----------- START EXCPETION
socket closed: euk/10.11.21.219
java.net.SocketException: Socket closed
smb://euk;euk:stinker@euk/euk-archive/docs/
jcifs.smb.SmbException: Timeout waiting for response from server: 
euk/10.11.21.219
        at jcifs.smb.SmbTransport.send(SmbTransport.java:671)
        at jcifs.smb.SmbSession.send(SmbSession.java:259)
        at jcifs.smb.SmbTree.send(SmbTree.java:103)
        at jcifs.smb.SmbFile.send(SmbFile.java:725)
        at jcifs.smb.SmbFile.close(SmbFile.java:896)
        at jcifs.smb.SmbFile.close(SmbFile.java:902)
        at jcifs.smb.SmbFile.close(SmbFile.java:906)
        at jcifs.smb.SmbFileInputStream.close
(SmbFileInputStream.java:80)
        at T2Crawler$CrawlerThread.run(T2Crawler.java:107)
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:134)
        at jcifs.netbios.SessionServicePacket.readn
(SessionServicePacket.java:70)
        at jcifs.netbios.SessionServicePacket.readPacketType
(SessionServicePacket.java:84)
        at jcifs.netbios.SocketInputStream.read
(SocketInputStream.java:74)
        at jcifs.netbios.SocketInputStream.read
(SocketInputStream.java:40)
        at java.io.FilterInputStream.read(FilterInputStream.java:66)
        at java.io.PushbackInputStream.read
(PushbackInputStream.java:120)
        at jcifs.smb.SmbTransport.run(SmbTransport.java:388)
        at java.lang.Thread.run(Thread.java:534)
-------------------- END EXCEPTION -----------------

I also tried setting the new SmbFile(argv).exists before the loop, but 
the result is the same, I got time-out for all plattforms.

In relation to the fix in 1.1.9, The reason to believe that HP has 
poblems is that the machines running Linux, Windows and Solaris do not 
have any high-load problem(this was fixed in 1.1.9). However, the HP-Ux 
pa-risc and true 64 do have the problem, having better Processors and 
much better memory. The last fix seems to solve the problem, although 
the HP-UX should not need this fix for just 50 users querying an smb 
server when the small Linux monoprocessor based on PIII does not have 
any problem.

The exception that originated this thread was as follows:

---------------------- START EXCPETION ----------------

java.lang.ArrayIndexOutOfBoundsException: -2056724349
        at jcifs.smb.ServerMessageBlock.readInt4
(ServerMessageBlock.java:137)
        at jcifs.smb.Trans2FindFirst2Response.readDataWireFormat
(Trans2FindFirst2Response.java:174)
        at jcifs.smb.SmbComTransactionResponse.readBytesWireFormat
(SmbComTransactionResponse.java:146)
        at jcifs.smb.ServerMessageBlock.readWireFormat
(ServerMessageBlock.java:484)
        at jcifs.smb.SmbTransport.run(SmbTransport.java:455)
        at java.lang.Thread.run(Thread.java:534)
-------------- END EXCEPTION ---------------------------------

I have also got a concurrent modification exception (also sometime, not 
always), but only in HP-Ux:

--------------------------- START EXCEPTION ----------------
java.util.ConcurrentModificationException
        at java.util.LinkedList$ListItr.checkForComodification
(LinkedList.java:552)
        at java.util.LinkedList$ListItr.next(LinkedList.java:488)
        at jcifs.smb.SmbTransport.tryClose(SmbTransport.java:285)
        at jcifs.smb.SmbTransport.sendTransaction(SmbTransport.java:831)
        at jcifs.smb.SmbSession.sendTransaction(SmbSession.java:246)
        at jcifs.smb.SmbTree.sendTransaction(SmbTree.java:74)
        at jcifs.smb.SmbFile.sendTransaction(SmbFile.java:689)
        at jcifs.smb.SmbFile.doFindFirstNext(SmbFile.java:1715)
        at jcifs.smb.SmbFile.listFiles(SmbFile.java:1606)
        at jcifs.smb.SmbFile.listFiles(SmbFile.java:1514)
        at T2Crawler$CrawlerThread.run(T2Crawler.java:75)
-------------------------- END EXCEPTION ----------------

All these exception were gotten running the modified T2 Crawler.The 
test simulates 50 users browsing at same time and fetching some files, 
do you think this is an unrealistic scenario for machines like the HP-
ux or Solaris? Do you usually test jcifs in Solaris and HP-UX? If not, 
I will try to help you with this from now on.

Regards,

Miguel

----- Mensaje Original -----
De: "Michael B Allen" <mba2000 at ioplex.com>
Fecha: Jueves, Marzo 3, 2005 0:52 am
Asunto: Re: jcifs-1.1.9 ArrayIndexOutOfBoundsException: -2146866174

> madlg3 at vodafone.es said:
> > Attached you can find the exception and the T2Crawler.
> 
> I can't reproduce this with your crawler on my Linux system. But I 
> don'thave that much memory. I can only run with -Xmx256M. Can you 
> reduce the
> complexity of the test program by trial and error analysis to see what
> behavior triggers the problem? How long does it take for the 
> problem to
> occur for you?
> 
> I did notice a bug. When connecting to the same share with multiple
> threads simultaniously it is possible for multiple tree connect 
> operationsto be performed for the same tree object. After the 
> first tree operation
> is complete it proceeds to use the last tid value for all subsequent
> operations. From a protocol prespective this bahavior is 
> legitimate but it
> is a concurrency flaw as far as jCIFS is concerted so your problem 
> couldbe an artifact of this unexpected bahavior. If you put:
> 
> (new SmbFile(argv[0])).exists();
>        for(int i=0;i<Integer.parseInt(argv[1]);i++)
> 
> just before you start your multiple crawlers it will initialize 
> the single
> tree before the crawlers start. Does the problem still occur?
> 
> Ironically I'm currently working on a new tranport layer for 2.0 that
> greatly simplifies these sorts of synchronization scenarios.
> 
> Mike
> 



More information about the jcifs mailing list