views:

186

answers:

1

I have some code grabbing a JSON array from my server and initially storing it as a string. This all works fine until I try and deserialize it using google's gson fromJson method. LogCat spits out the error:

04-08 17:46:35.163: ERROR/dalvikvm(401): Can't shrink stack: curFrame is in reserved area (0x41049000 0x410491c4)

My code that causes the error is:

String[] results = gson.fromJson(returnString, String[].class);

Can anyone shed some light on what I am doing wrong?

Cheers, Sam

A: 

You may be running into the following open issue: http://code.google.com/p/android/issues/detail?id=6245.

The stack is supposed to expand briefly while the StackOverflowError is being handled, then shrink back down afterward. The problem is that an exception is being thrown during the SOE processing, and we're trying to shrink the stack down when that second exception finishes, instead of waiting until we're wrapping up the SOE itself.

There's also enough going on during the SOE recovery that an extra 512 bytes of stack isn't enough, and it'll encounter a double-SOE.

How large is the JSON that you are trying to de-serialize?

Steve