JSON 数组反序列化导致 Dalvik VM 崩溃

发布于 2024-08-28 02:09:32 字数 376 浏览 9 评论 0原文

我有一些代码从我的服务器获取 JSON 数组并最初将其存储为字符串。这一切都工作正常,直到我尝试使用谷歌的 gson fromJson 方法对其进行反序列化。 LogCat 吐出错误:

04-08 17:46:35.163: ERROR/dalvikvm(401): Can't Shrink Stack: curFrame is inserved area (0x41049000 0x410491c4)

导致错误的代码是:

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

任何人都可以阐明我做错了什么吗?

干杯, 山姆

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空‖城人不在 2024-09-04 02:09:32

您可能遇到以下未决问题:http://code。 google.com/p/android/issues/detail?id=6245

当 StackOverflowError 发生时,堆栈应该会短暂扩展。
被处理,然后又缩回去。问题是有一个例外
在 SOE 处理过程中被抛出,我们正在尝试缩小堆栈
当第二个异常结束时,而不是等到我们结束
国有企业本身。

SOE 恢复期间发生的事情也足够多,额外的 512 字节堆栈
还不够,还会遇到双重国企。

您尝试反序列化的 JSON 有多大?

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文