Skip to content

ServerSerializationStreamWriter: NumberFormatException for input string "0].concat([7" #9536

@brent777

Description

@brent777

**GWT version: 2.8.1

**Browser (with version): Chrome Version 59.0.3071.115 (Official Build) (64-bit)

**Operating System: Arch Linux 4.11.9-1-ARCH


Description

We ran into a corner case bug with the GWT RPC deserialisation process. The code in question uses GWT portlets. ServerSerializationStreamWriter defines MAXIMUM_ARRAY_LENGTH = 1 << 15.

When the response payload exceeds MAXIMUM_ARRAY_LENGTH by 1, the payload looks something like //OK["random data", 1,2,3,...,0].concat([7]). The response is returned to the client successfully, however when the client tries deserialising this payload it throws a NumberFormatException for input string "0].concat([7". See the stackstrace below. For arrays bigger than MAXIMUM_ARRAY_LENGTH + 1 it successfully deserialises.

 java.lang.NumberFormatException: For input string: "0].concat([7" Unknown.ec(Throwable.java:67) Unknown.Hc(Exception.java:29) Unknown.uo(RuntimeException.java:29) Unknown.rBe(IllegalArgumentException.java:29) Unknown.$Ce(NumberFormatException.java:41) Unknown._Ce(NumberFormatException.java:26) Unknown.oye(Number.java:222) Unknown.NBe(Integer.java:157) Unknown.MBe(Integer.java:153) Unknown.fDd(ClientSerializationStreamReader.java:148) Unknown.WCd(ClientSerializationStreamReader.java:61) Unknown.DDd(RemoteServiceProxy.java:259) Unknown._Dd(RequestCallbackAdapter.java:214) Unknown.MPi(SidRpcRequestBuilder.java:60) Unknown.eQ(Request.java:250) Unknown.UQ(RequestBuilder.java:412) Unknown.anonymous(XMLHttpRequest.java:329) Unknown.Gr(Impl.java:239) Unknown.Jr(Impl.java:291) Unknown.anonymous(Impl.java:77) 
Steps to reproduce

This is difficult to reproduce in a open source demo given that I don't know how to deterministically produce a payload with an array of a specific length, as the serialisation process is not straightforward. Possibly someone that understands the gwt serialisation can give some input here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions