UnitySendMessage() Crashes with strings bigger than 1MB
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- android, unity
- 领域
- mobile-dev
调研方向
The report identifies mUnityPlayer.UnitySendMessage() and provides Android crash signals, but names no source file or test. Start by locating the Unity-to-Android override and tracing how it handles large strings; the reported failure occurs near 1 MB. Done means large strings can be delivered without crashing, with a regression test or reproducible verification for the reported size.
由索引模型根据 Issue 内容生成。
描述
I am able to send any sizes of strings from Unity to AndroidStudio via override, but I get a crash you you try to send any string close or bigger than 1MB using the mUnityPlayer.UnitySendMessage() method.
This issue was very hard to track, after some debugging the maximum string length I could safely deliver was 1047500. (actually you can fit 1,048,576 characters on 1MB but anything above 1,047,500 may or not crash)
Since there is no fix to this and just one old comment on the forum... (yeah I've lost the link to that)
The workaround:
The way to get around it was to divide the strings into pieces of 1 million or less.
Upon sending the data to Unity I send a message (JSON) to a method saying how many parts it has.
Then I use a cached StringBuilder to append all the parts. Upon appending the last part I proceed with my usual code using the full string.
As this is a private project I will post just a part of the error:
E/CRASH: signal 7 (SIGBUS), code 2 (BUS_ADRERR), fault addr 0x88e07000
E/CRASH: main thread is trapped; signum = 7
E/CRASH: main thread is trapped; signum = 7
E/CRASH: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
E/CRASH: Cause: null pointer dereference
- 主要语言
- Objective-C++
- 星标
- 815
- 派生
- 252
- 平均合并
- 21 小时 42 分钟
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Unity-Technologies/uaal-example 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 25/100
Unity-Technologies/uaal-example#123 · 4 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
Unity-Technologies/uaal-example#122 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 15/100
Unity-Technologies/uaal-example#120 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 28/100
Unity-Technologies/uaal-example#118 · 4 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 25/100
Unity-Technologies/uaal-example#116 · 1 条评论 ·
查看 Unity-Technologies/uaal-example 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
gluestack/gluestack-ui#3469 ·
-
[Bug]: AppiumDriver.PlatformName fails with Appium 4可能已有人在做 @Dor-bl 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
appium/dotnet-client#1177 · 1 个 reaction ·
维护者通常 2 天内回复
-
area:focus area:ui cluster:focus-remote effort:s platform:android-tv platform:fire-tv priority:critical type:bug
难度 2/5 1-3 小时 新手友好度 78/100
fatihmutluu/elv-iptv#425 ·
维护者通常 1 天内回复
-
proposal
难度 1/5 1 小时以内 新手友好度 82/100
beemdevelopment/Aegis#1861 ·
-
难度 2/5 1-3 小时 新手友好度 72/100