所以,我经常得到这个缓冲区溢出崩溃(393238)。
我刚刚解决的一个例子是,当我运行Log.d("test", null)
时,我得到了崩溃。
如果我删除这行代码,就没有崩溃。
据我所知,我的代码中的每个错误,无论是ArrayOutOfBounds
,错误类型,空例外等都会导致缓冲区溢出崩溃。
我不知道为什么会这样。为什么Android没有优雅地处理和返回异常消息,而不是一直使用缓冲区溢出消息使程序崩溃?
此外,我尝试通过USB调试,Nexus模拟器等在我自己的手机上运行。仍然会发生。
这是确切的消息:
W/ErrorProcessor: onFatalError, processing error from engine(4)
com.google.android.apps.gsa.shared.speech.a.g: Error reading from input stream
at com.google.android.apps.gsa.staticplugins.recognizer.i.a.a(SourceFile:342)
at com.google.android.apps.gsa.staticplugins.recognizer.i.a$1.run(SourceFile:1367)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at com.google.android.apps.gsa.shared.util.concurrent.a.ak.run(SourceFile:66)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
at com.google.android.apps.gsa.shared.util.concurrent.a.ad$1.run(SourceFile:85)
Caused by: com.google.android.apps.gsa.shared.exception.GsaIOException: Error code: 393238 | Buffer overflow, no available space.
at com.google.android.apps.gsa.speech.audio.Tee.g(SourceFile:2531)
at com.google.android.apps.gsa.speech.audio.ap.read(SourceFile:555)
at java.io.InputStream.read(InputStream.java:101)
at com.google.android.apps.gsa.speech.audio.al.run(SourceFile:362)
at com.google.android.apps.gsa.speech.audio.ak$1.run(SourceFile:471)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at com.google.android.apps.gsa.shared.util.concurrent.a.ak.run(SourceFile:66)
at com.google.android.apps.gsa.shared.util.concurrent.a.ax.run(SourceFile:139)
at com.google.android.apps.gsa.shared.util.concurrent.a.ax.run(SourceFile:139)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
at com.google.android.apps.gsa.shared.util.concurrent.a.ad$1.run(SourceFile:85)
我有同样的事情。我的应用程序在我的主计算机上从Android工作室运行在一个真正的Android平板电脑和平板电脑模拟器。当我在我的笔记本电脑上做同样的事情时,我得到了这个崩溃,对于真实的设备和模拟器。
我最后通过删除项目构建目录并执行工具 - > AVD管理器 - >操作擦除数据来“修复它”。然后,我重建/运行项目,它工作。去搞清楚...