zbkoong / android-rcs-ims-stack

Automatically exported from code.google.com/p/android-rcs-ims-stack
0 stars 0 forks source link

java.lang.ArrayIndexOutOfBoundsException occured in ChunkReceiver.java:357 while reading the msrp chunks from the server #112

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. When receiving the below MSRP chunks, the we have got he array exception
##############
MSRP 212237354111109657-0 SEND
To-Path: msrp://10.40.50.66:20000/1370594037586;tcp
From-Path: msrp://10.50.4.10:5802/s/8478095978/00BFC3C32FB4000002080001;tcp
Message-ID: 0004BED7D98200004D00000101
Success-Report: yes
Failure-Report: yes
Byte-Range: 1-*/16964
Content-Type: message/cpim; charset="utf-8"

From:  <sip:+18472175858@defaultmmscdomain.com>
To:  <sip:+18478095978@defaultmmscdomain.com>
Subject: 
DateTime: 2013-06-07T07:29:11.488000Z

<content removed>

-------212237354111109657-0$
###########
2. Here receive the msrp chunks in multiple chunks, so each chunk carries 
"Byte-Range:" header with its chunk size as *(means sender does not know the 
exact size of the chunk.)
3. Parse the chunk when exact chunk size is not known call the readChunkedData 
API

What is the expected output? What do you see instead?
msrp layer has to parse the received MSRP SEND message and give the data 
pointer to upper layer

What version of the product are you using? On what operating system?
2.5.2 and I observed that there is no difference in msrp even in 2.5.4

Please provide any additional information below.
Below are the logs for the 
################
06-10 12:04:33.570: V/[RCS][SipInterface](32214): <<< Receive SIP 200 response
06-10 12:04:33.570: I/System.out(32214): <<< SIP/2.0 200 OK
06-10 12:04:33.570: I/System.out(32214): Call-ID: 4RXvs8TXAA@10.40.50.66
06-10 12:04:33.570: I/System.out(32214): CSeq: 9 REGISTER
06-10 12:04:33.570: I/System.out(32214): From: 
<sip:8478095978@mpvm10.mp.ics.com>;tag=bAxys8T7AA
06-10 12:04:33.570: I/System.out(32214): To: 
<sip:8478095978@mpvm10.mp.ics.com>;tag=685110094757529027
06-10 12:04:33.570: I/System.out(32214): Via: SIP/2.0/TCP 
10.40.50.66:5060;branch=z9hG4bK49da52926ac730bf0e672ce82e43c993343331;rport=5060
;received=10.40.50.66
06-10 12:04:33.570: I/System.out(32214): Contact: 
<sip:10.40.50.66:5060;transport=TCP>;+sip.instance="<urn:uuid:3210b525-5ab6-3827
-9be4-061c83b8cbb1>";+g.oma.sip-im;+g.3gpp.iari-ref="urn%3Aurn-7%3A3gpp-applicat
ion.ims.iari.rcse.ft";+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.oma.
cpm.msg";urn%3Aurn-7%3A3gpp-application.ims.iari.rcs.geopush;expires=220
06-10 12:04:33.570: I/System.out(32214): Server: IM-serv/OMA1.0
06-10 12:04:33.570: I/System.out(32214): Flow-Timer: 1500
06-10 12:04:33.570: I/System.out(32214): Allow: REGISTER,INVITE,ACK,BYE,MESSAGE
06-10 12:04:33.570: I/System.out(32214): Date: Mon, 10 Jun 2013 06:35:47 GMT
06-10 12:04:33.570: I/System.out(32214): Content-Length: 0
06-10 12:04:33.570: I/System.out(32214): 
06-10 12:04:33.570: I/System.out(32214): 
-----------------------------------------------------------------------------
06-10 12:04:33.570: V/[RCS][SipInterface](32214): Callback object found for 
transaction 4RXvs8TXAA@10.40.50.66
06-10 12:04:33.570: I/[RCS][RegistrationManager](32214): 200 OK response 
received
06-10 12:04:33.570: V/[RCS][RegistrationManager](32214): NAT traversal 
detection: false
06-10 12:04:33.570: V/[RCS][RegistrationManager](32214): Start timer at 
period=110s (expiration=220s)
06-10 12:04:33.570: V/[RCS][RcsCoreService](32214): Handle event registration ok
06-10 12:04:33.870: V/[RCS][SipInterface](32214): Transaction terminated
06-10 12:05:12.740: V/[RCS][SipInterface](32214): <<< Receive SIP INVITE
06-10 12:05:12.750: I/System.out(32214): <<< INVITE 
sip:+18478095978@10.40.50.66:5060 SIP/2.0
06-10 12:05:12.750: I/System.out(32214): To: 
<sip:+18478095978@defaultmmscdomain.com>
06-10 12:05:12.750: I/System.out(32214): From: 
<sip:+18472175858@defaultmmscdomain.com>;tag=00FA74BBC143000004080001
06-10 12:05:12.750: I/System.out(32214): Via: SIP/2.0/TCP 
mpvm10.mp.ics.com:5060;branch=z9hG4bK10.40.50.66_5060_MMS-ACK_62915328_0004FA74B
B980000E700000101;received=10.50.4.10;rport=5060
06-10 12:05:12.750: I/System.out(32214): CSeq: 1 INVITE
06-10 12:05:12.750: I/System.out(32214): Max-Forwards: 70
06-10 12:05:12.750: I/System.out(32214): Request-Disposition: no-fork
06-10 12:05:12.750: I/System.out(32214): P-Asserted-Identity: 
<sip:+18472175858@defaultmmscdomain.com>
06-10 12:05:12.750: I/System.out(32214): P-Charging-Vector: icid-value=XYZ123
06-10 12:05:12.750: I/System.out(32214): Call-ID: 00FA74BBC143000004080001
06-10 12:05:12.750: I/System.out(32214): User-Agent: IM-serv/OMA1.0
06-10 12:05:12.750: I/System.out(32214): Allow: REGISTER,INVITE,ACK,BYE,MESSAGE
06-10 12:05:12.750: I/System.out(32214): Priority: normal
06-10 12:05:12.750: I/System.out(32214): Contact: 
<sip:00FA74BBC143000004080001@mpvm10.mp.ics.com>;+sip.instance="<urn:uuid:3210b5
25-5ab6-3827-9be4-061c83b8cbb1>";+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.im
s.icsi.oma.cpm.largemsg"
06-10 12:05:12.750: I/System.out(32214): Accept-Contact: 
*;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.oma.cpm.largemsg"
06-10 12:05:12.750: I/System.out(32214): Contribution-ID: 
232d5e40be21596b9f578c5b3a5b8fc0
06-10 12:05:12.750: I/System.out(32214): Route: 
<sip:10.40.50.66:5060;transport=TCP>
06-10 12:05:12.750: I/System.out(32214): Content-Type: application/sdp
06-10 12:05:12.750: I/System.out(32214): Content-Length: 338
06-10 12:05:12.750: I/System.out(32214): 
06-10 12:05:12.750: I/System.out(32214): v=0
06-10 12:05:12.750: I/System.out(32214): o=- 212237606186619312 
212237606186619312 IN IP4 mpvm10.mp.ics.com
06-10 12:05:12.750: I/System.out(32214): s=0004FA74BB980000E7000001
06-10 12:05:12.750: I/System.out(32214): c=IN IP4 10.50.4.10
06-10 12:05:12.750: I/System.out(32214): t=0 0
06-10 12:05:12.750: I/System.out(32214): a=setup:passive
06-10 12:05:12.750: I/System.out(32214): m=message 5804 TCP/MSRP *
06-10 12:05:12.750: I/System.out(32214): 
a=path:msrp://10.50.4.10:5804/s/8478095978/00FA74BBC143000004080001;tcp
06-10 12:05:12.750: I/System.out(32214): a=accept-types:message/cpim text/* 
image/jpeg
06-10 12:05:12.750: I/System.out(32214): a=accept-wrapped-types:*
06-10 12:05:12.750: I/System.out(32214): a=max-size:102400
06-10 12:05:12.750: I/System.out(32214): 
-----------------------------------------------------------------------------
06-10 12:05:12.750: V/[RCS][SipInterface](32214): Notify a SIP listener
06-10 12:05:12.760: V/[RCS][ImsServiceDispatcher](32214): Receive INVITE request
06-10 12:05:12.760: V/[RCS][SipInterface](32214): >>> Send SIP 100 response
06-10 12:05:12.760: I/System.out(32214): >>> SIP/2.0 100 Trying
06-10 12:05:12.760: I/System.out(32214): To: 
<sip:+18478095978@defaultmmscdomain.com>
06-10 12:05:12.760: I/System.out(32214): From: 
<sip:+18472175858@defaultmmscdomain.com>;tag=00FA74BBC143000004080001
06-10 12:05:12.760: I/System.out(32214): Via: SIP/2.0/TCP 
mpvm10.mp.ics.com:5060;branch=z9hG4bK10.40.50.66_5060_MMS-ACK_62915328_0004FA74B
B980000E700000101;received=10.50.4.10;rport=5060
06-10 12:05:12.760: I/System.out(32214): CSeq: 1 INVITE
06-10 12:05:12.760: I/System.out(32214): Call-ID: 00FA74BBC143000004080001
06-10 12:05:12.760: I/System.out(32214): Content-Length: 0
06-10 12:05:12.760: I/System.out(32214): 
06-10 12:05:12.760: I/System.out(32214): 
-----------------------------------------------------------------------------
06-10 12:05:12.780: V/[RCS][ImsServiceDispatcher](32214): Received CPM Large 
Message
06-10 12:05:12.780: I/[RCS][InstantMessagingService](32214): Receive a Large 
Message session invitation
06-10 12:05:12.800: V/[RCS][ListOfParticipant](32214): Add participant 
+18472175858 to the list
06-10 12:05:12.810: V/[RCS][InstantMessagingService](32214): Add new session 
1370623931874
06-10 12:05:12.810: V/[RCS][RcsCoreService](32214): Handle event receive Large 
Message session invitation
06-10 12:05:12.810: I/[RCS][TerminatingLargeMessageSession](32214): Initiate a 
new Large Message session as terminating
06-10 12:05:12.810: I/[RCS][MessagingApiService](32214): Receive new Large 
Message invitation from <sip:+18472175858@defaultmmscdomain.com>
06-10 12:05:12.810: V/[RCS][MessagingApiService](32214): Add a standalone 
session in the list (size=1)
06-10 12:05:12.810: V/[RCS][TerminatingLargeMessageSession](32214): Auto accept 
Large Message invitation
06-10 12:05:12.830: V/[RCS][TerminatingLargeMessageSession](32214): Remote 
setup attribute is passive
06-10 12:05:12.830: V/[RCS][TerminatingLargeMessageSession](32214): Local setup 
attribute is active
06-10 12:05:12.830: I/[RCS][TerminatingLargeMessageSession](32214): Send 200 OK
06-10 12:05:12.840: V/[RCS][SipInterface](32214): Create a transaction context 
00FA74BBC143000004080001
06-10 12:05:12.840: V/[RCS][SipInterface](32214): >>> Send SIP 200 response
06-10 12:05:12.840: I/System.out(32214): >>> SIP/2.0 200 OK
06-10 12:05:12.840: I/System.out(32214): To: 
<sip:+18478095978@defaultmmscdomain.com>;tag=rw6ys8T8AA
06-10 12:05:12.840: I/System.out(32214): From: 
<sip:+18472175858@defaultmmscdomain.com>;tag=00FA74BBC143000004080001
06-10 12:05:12.840: I/System.out(32214): Via: SIP/2.0/TCP 
mpvm10.mp.ics.com:5060;branch=z9hG4bK10.40.50.66_5060_MMS-ACK_62915328_0004FA74B
B980000E700000101;received=10.50.4.10;rport=5060
06-10 12:05:12.840: I/System.out(32214): CSeq: 1 INVITE
06-10 12:05:12.840: I/System.out(32214): Call-ID: 00FA74BBC143000004080001
06-10 12:05:12.840: I/System.out(32214): Contact: 
<sip:10.40.50.66:5060;transport=TCP>;+sip.instance="<urn:uuid:3210b525-5ab6-3827
-9be4-061c83b8cbb1>";+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.oma.c
pm.largemsg"
06-10 12:05:12.840: I/System.out(32214): Accept-Contact: 
*;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.oma.cpm.largemsg"
06-10 12:05:12.840: I/System.out(32214): Allow: 
INVITE,UPDATE,ACK,BYE,NOTIFY,OPTIONS,MESSAGE,REFER
06-10 12:05:12.840: I/System.out(32214): Server: IM-client/OMA1.0 
OrangeLabs-RCS-client/2.5.2
06-10 12:05:12.840: I/System.out(32214): Content-Type: application/sdp
06-10 12:05:12.840: I/System.out(32214): Content-Length: 346
06-10 12:05:12.840: I/System.out(32214): 
06-10 12:05:12.840: I/System.out(32214): v=0
06-10 12:05:12.840: I/System.out(32214): o=- 3579834912 3579834912 IN IP4 
10.40.50.66
06-10 12:05:12.840: I/System.out(32214): s=-
06-10 12:05:12.840: I/System.out(32214): c=IN IP4 10.40.50.66
06-10 12:05:12.840: I/System.out(32214): t=0 0
06-10 12:05:12.840: I/System.out(32214): m=message 9 TCP/MSRP *
06-10 12:05:12.840: I/System.out(32214): a=accept-types:message/cpim 
application/im-iscomposing+xml
06-10 12:05:12.840: I/System.out(32214): a=accept-wrapped-types:text/plain 
application/im-iscomposing+xml application/rcspushlocation+xml
06-10 12:05:12.840: I/System.out(32214): a=setup:active
06-10 12:05:12.840: I/System.out(32214): 
a=path:msrp://10.40.50.66:20000/1370846112807;tcp
06-10 12:05:12.840: I/System.out(32214): a=recvonly
06-10 12:05:12.840: I/System.out(32214): 
-----------------------------------------------------------------------------
06-10 12:05:12.870: I/[RCS][ImsApiService](32214): Is client connected to IMS
06-10 12:05:12.870: I/[RCS][MessagingApiService](32214): Get chat session 
1370623931874
06-10 12:05:12.870: I/[RCS][StandaloneSession](32214): Add an event listener
06-10 12:05:13.540: V/[RCS][SipInterface](32214): <<< Receive SIP ACK
06-10 12:05:13.540: I/System.out(32214): <<< ACK 
sip:+18478095978@10.40.50.66:5060 SIP/2.0
06-10 12:05:13.540: I/System.out(32214): To: 
<sip:+18478095978@defaultmmscdomain.com>;tag=rw6ys8T8AA
06-10 12:05:13.540: I/System.out(32214): From: 
<sip:+18472175858@defaultmmscdomain.com>;tag=00FA74BBC143000004080001
06-10 12:05:13.540: I/System.out(32214): Via: SIP/2.0/TCP 
mpvm10.mp.ics.com:5060;branch=z9hG4bK10.40.50.66_5060_MMS-ACK_62915328_0004FA74B
B980000E700000101;received=10.50.4.10;rport=5060
06-10 12:05:13.540: I/System.out(32214): CSeq: 1 ACK
06-10 12:05:13.540: I/System.out(32214): Max-Forwards: 70
06-10 12:05:13.540: I/System.out(32214): Request-Disposition: no-fork
06-10 12:05:13.540: I/System.out(32214): Call-ID: 00FA74BBC143000004080001
06-10 12:05:13.540: I/System.out(32214): Route: 
<sip:10.40.50.66:5060;transport=TCP>
06-10 12:05:13.540: I/System.out(32214): Content-Length: 0
06-10 12:05:13.540: I/System.out(32214): 
06-10 12:05:13.540: I/System.out(32214): 
-----------------------------------------------------------------------------
06-10 12:05:13.540: V/[RCS][SipInterface](32214): Callback object found for 
transaction 00FA74BBC143000004080001
06-10 12:05:13.540: I/[RCS][TerminatingLargeMessageSession](32214): ACK request 
received
06-10 12:05:13.540: I/[RCS][MsrpManager](32214): Create MSRP client end point 
at 10.50.4.10:5804
06-10 12:05:13.540: V/[RCS][MsrpClientConnection](32214): Open client socket to 
10.50.4.10:5804
06-10 12:05:13.580: D/dalvikvm(32214): GC_CONCURRENT freed 1075K, 46% free 
4440K/8135K, external 1883K/3163K, paused 3ms+4ms
06-10 12:05:13.990: V/[RCS][MsrpClientConnection](32214): Socket connected to 
10.50.4.10:5804
06-10 12:05:13.990: V/[RCS][ChunkReceiver](32214): Receiver is started
06-10 12:05:13.990: V/[RCS][MsrpClientConnection](32214): Connection has been 
openned
06-10 12:05:13.990: I/[RCS][MsrpSession](32214): Send an empty chunk
06-10 12:05:13.990: I/System.out(32214): >>> Send MSRP message:
06-10 12:05:13.990: I/System.out(32214): MSRP 133c8ba16597c69f SEND
06-10 12:05:13.990: I/System.out(32214): To-Path: 
msrp://10.50.4.10:5804/s/8478095978/00FA74BBC143000004080001;tcp
06-10 12:05:13.990: I/System.out(32214): From-Path: 
msrp://10.40.50.66:20000/1370846112807;tcp
06-10 12:05:13.990: I/System.out(32214): Message-ID: 1e138564a43bf339
06-10 12:05:13.990: I/System.out(32214): -------133c8ba16597c69f$
06-10 12:05:13.990: V/[RCS][ChunkSender](32214): Sender is started
06-10 12:05:14.400: V/[RCS][ChunkReceiver](32214): Read a new chunk
06-10 12:05:14.400: V/[RCS][ChunkReceiver](32214): Transaction-ID: 
133c8ba16597c69f
06-10 12:05:14.400: V/[RCS][ChunkReceiver](32214): Response: 200
06-10 12:05:14.410: V/[RCS][ChunkReceiver](32214): Header: To-Path
06-10 12:05:14.410: V/[RCS][ChunkReceiver](32214): Header: From-Path
06-10 12:05:14.410: V/[RCS][ChunkReceiver](32214): Continuous flag: $
06-10 12:05:14.410: I/System.out(32214): <<< Receive MSRP response:
06-10 12:05:14.410: I/System.out(32214): MSRP 133c8ba16597c69f 200 OK
06-10 12:05:14.410: I/System.out(32214): To-Path: 
msrp://10.40.50.66:20000/1370846112807;tcp
06-10 12:05:14.410: I/System.out(32214): From-Path: 
msrp://10.50.4.10:5804/s/8478095978/00FA74BBC143000004080001;tcp
06-10 12:05:14.410: I/System.out(32214): -------133c8ba16597c69f$
06-10 12:05:14.410: I/[RCS][MsrpSession](32214): Response received (code=200, 
transaction=133c8ba16597c69f)
06-10 12:05:14.410: I/[RCS][StandaloneSession](32214): Session started
06-10 12:05:14.410: V/[RCS][SessionTimerManager](32214): Session timer not 
activated
06-10 12:05:14.420: V/[RCS][ChunkReceiver](32214): Read a new chunk
06-10 12:05:14.420: V/[RCS][ChunkReceiver](32214): Transaction-ID: 
212237606188385596-0
06-10 12:05:14.420: V/[RCS][ChunkReceiver](32214): Method: SEND
06-10 12:05:14.420: V/[RCS][ChunkReceiver](32214): Header: To-Path
06-10 12:05:14.420: V/[RCS][ChunkReceiver](32214): Header: From-Path
06-10 12:05:14.430: V/[RCS][ChunkReceiver](32214): Header: Message-ID
06-10 12:05:14.430: V/[RCS][ChunkReceiver](32214): Header: Success-Report
06-10 12:05:14.430: V/[RCS][ChunkReceiver](32214): Header: Failure-Report
06-10 12:05:14.430: V/[RCS][ChunkReceiver](32214): Header: Byte-Range
06-10 12:05:14.430: V/[RCS][ChunkReceiver](32214): Header: Content-Type
06-10 12:05:14.430: V/[RCS][ChunkReceiver](32214): Read data (0)
06-10 12:05:14.430: E/[RCS][ChunkReceiver](32214): Chunk receiver has failed
06-10 12:05:14.430: W/System.err(32214): 
java.lang.ArrayIndexOutOfBoundsException
06-10 12:05:14.430: W/System.err(32214):    at 
com.orangelabs.rcs.core.ims.protocol.msrp.ChunkReceiver.readChunkedData(ChunkRec
eiver.java:357)
06-10 12:05:14.430: W/System.err(32214):    at 
com.orangelabs.rcs.core.ims.protocol.msrp.ChunkReceiver.run(ChunkReceiver.java:1
83)
06-10 12:05:14.430: I/[RCS][TerminatingLargeMessageSession](32214): Data 
transfer error null
06-10 12:05:14.430: I/[RCS][StandaloneSession](32214): IM error received
06-10 12:05:14.440: V/[RCS][MessagingApiService](32214): Remove a chat session 
from the list (size=0)
06-10 12:05:21.280: V/[RCS][SipInterface](32214): Transaction terminated
06-10 12:05:23.180: W/KeyCharacterMap(32214): Can't open keycharmap file
06-10 12:05:23.180: W/KeyCharacterMap(32214): Using default keymap: 
/system/usr/keychars/qwerty.kcm.bin
06-10 12:05:23.880: I/[RCS][MessagingApiService](32214): Remove a message 
delivery listener
06-10 12:05:23.890: I/Activity(32214): Warning: Adapter is NOT Null!
################

Original issue reported on code.google.com by appapur...@gmail.com on 10 Jun 2013 at 11:53