Buffer Overflow - No available Space crash in Android - android

So, I'm constantly getting this buffer overflow crash (393238).
One example, I've just fixed is, when I run Log.d("test", null) I get the crash.
If I remove this line of code, there's no crash.
As far as I know, every single bug in my code, whether it's an ArrayOutOfBounds, Incorrect Type, Null Exceptions, etc. are all causing Buffer Overflow crashes.
I don't know why this is happening. Why is Android not gracefully handling and returning Exception messages, rather than crashing the program with a Buffer Overflow message all the time?
Also, I've tried running on my own phone through usb debugging, Nexus emulator, etc. Still happens.
Here is the exact message:
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) 

I had the same thing. My app ran fine on my main computer from android studio on both a real android tablet and the tablet emulator. When I did the exact same thing on my laptop I got this crash, for both real device and emulator.
I ended up 'fixing it' by deleting the project build directory, and doing a Tools->AVD Manager->Actions Wipe Data. I then rebuilt/ran the project and it worked. Go figure...

Related

Getting file not found exception while trying to connect with url in android studio.How to solve this?

I am trying to connect to mysql using wampp and the following error is thrown how to solve this?
W/System.err: java.io.FileNotFoundException: http://192.168.2.198/login.php
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:250)
at com.example.mysqltest.BackgroundWorker.doInBackground(BackgroundWorker.java:46)
at com.example.mysqltest.BackgroundWorker.doInBackground(BackgroundWorker.java:19)
at android.os.AsyncTask$2.call(AsyncTask.java:304)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
W/System.err: 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)
There are following possibility to occur this issue
maybe your project or file location is not perfect
maybe because of the port number or IP not match time of calling
First, try to run this page in your mobile browser web browser and it will work in mobile browser then it will work in API definitely if not work then you need to change in your config

FileNotFoundException with Universal Image Loader on Android 7+

I use Universal Image Loader for image loading inside our android app. It works well with usual links, however, since our API has changed, now this link doesn't work: https://img.anews.com?url=https://img.anews.com/media/posts/images/20180419/89413447.jpg&w=1080&h=735
This is the error log:
04-19 11:08:11.717 16501-16779/anews.com E/ImageLoader: https://img.anews.com?url=https://img.anews.com/media/posts/images/20180419/89413447.jpg&w=1080&h=735
java.io.FileNotFoundException: https://img.anews.com?url=https://img.anews.com/media/posts/images/20180419/89413447.jpg&w=1080&h=735
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:250)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java)
at com.nostra13.universalimageloader.core.download.BaseImageDownloader.getStreamFromNetwork(BaseImageDownloader.java:124)
at com.nostra13.universalimageloader.core.download.BaseImageDownloader.getStream(BaseImageDownloader.java:88)
at com.nostra13.universalimageloader.core.decode.BaseImageDecoder.getImageStream(BaseImageDecoder.java:98)
at com.nostra13.universalimageloader.core.decode.BaseImageDecoder.decode(BaseImageDecoder.java:74)
at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.decodeImage(LoadAndDisplayImageTask.java:265)
at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.tryLoadBitmap(LoadAndDisplayImageTask.java:238)
at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.run(LoadAndDisplayImageTask.java:136)
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)
I seem to have this problem only on Android 7+. On all previous versions, images load just fine. Any help or suggestions appreciated.

Convenient way to find a lambda mentioned in log

Lambda expressions are easy to write, easy to read but hard to find when we talk about logs.
I got next stack trace in the Fabric Crashlytics (and I could see such errors in Android Monitor). The question is if there is some convenient way to find this "Lambda #7" in the class?
Non-fatal Exception: java.lang.NullPointerException: The mapper function returned a null value.
at io.reactivex.internal.functions.a.a(ObjectHelper.java:39)
at io.reactivex.internal.operators.observable.ay$a.onNext(ObservableMap.java:59)
...
at java.lang.Thread.run(Thread.java:761)
---> at com.myapp.MyClass$$Lambda$7.accept(Unknown Source)
at io.reactivex.internal.observers.LambdaObserver.onError(LambdaObserver.java:77)
at io.reactivex.internal.observers.BasicFuseableObserver.onError(BasicFuseableObserver.java:100)
at io.reactivex.internal.observers.BasicFuseableObserver.fail(BasicFuseableObserver.java:110)
at io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(ObservableMap.java:61)
at io.reactivex.internal.operators.observable.ObservableCreate$CreateEmitter.onNext(ObservableCreate.java:67)
at io.objectbox.rx.RxQuery$4$1.onData(RxQuery.java:95)
at io.objectbox.rx.RxQuery$4$1.onData(RxQuery.java:91)
at io.objectbox.query.QueryPublisher$2.run(QueryPublisher.java:68)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
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)
It is possible using the Android Studio's Navigate -> File Structure view (MacOs: Cmd+F12, Windows: Ctrl+F12). You should check Lambdas checkbox there and then you will see the lamdas with theis numbers:

Android SQLite exceptions caused by firebase modules

We recently added Firebase to our app and noticed a high increase of SQLite exceptions.
Logs:
android.database.sqlite.SQLiteReadOnlyDatabaseException:
at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method:0)
at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:788)
at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788)
at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1474)
at bkf.a(:com.google.android.gms.DynamiteModulesC:70)
at bkw.run(:com.google.android.gms.DynamiteModulesC:32)
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)>
or
android.database.sqlite.SQLiteDiskIOException:
at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method:0)
at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:788)
at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788)
at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1472)
at bkf.a(:com.google.android.gms.DynamiteModulesC:70)
at bkw.run(:com.google.android.gms.DynamiteModulesC:46)
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)
In our app we're using SQLite too (multiple threads, single instances of SQLiteOpenHelper), however we don't get any exceptions there.
We also noticed that these exceptions were thrown for about 90% on Sony devices. (SDK 23 and above)
Which comes first in my mind, is a failed SQLite implementation on these devices but I'm not able to reproduce it on our Sony devices, so my questions are:
is this a known Firebase issue?
can anyone confirm my guess?
and well,
what will be a possible workaround
Any help would be appreciated.
Edit:
For sure it's related to SQLiteReadOnlyDatabaseException (it's mentioned in the logs ;) ) but it affects mostly Sony devices and it's not our db which fails but Googles, so I don't think it's duplicated to SQLiteReadOnlyDatabaseException: attempt to write a readonly database

GsaIOException Buffer overflow, no available space

I have a MediaPlayer app with a live streaming function. When I test the app with a physically device(API 22 Lollipop and API 23 Marshmallow) there are no problems with starting of the stream.
Today I want to test the application with a Emulator (API 25 Nougat). Stream is not working and I get the following error:
(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) 
02-23 23:58:09.834 2166-3554/com.google.android.googlequicksearchbox:search 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) 
I can recognize only one thing where I think it is important.
GsaIOException: Error code: 393238 | Buffer overflow, no available space
But I don't know what it could mean. Can anyone explain what kind of Exception it is. And where I can search at the code to find the problem?
I had a similar issue, for me it was crashing on devices too, with the same error. This is how I fixed it for devices:
<uses-permission android:name="android.permission.RECORD_AUDIO" />
More details here: Looping Error on Android Emulator
To make the app work on simulator, after applying the fix from the above link, I had to create a new simulator based on x86 architecture (not x86_64 as before) and it worked.
I was getting these exact messages while trying to debug my device with logcat. Could not figure out where they were coming from. Finally realized that a preceding debug session with the emulator was generating these. I simply quit the emulator to stop them.
I did receive the same issue, and i did the following things to make this crash occurs.
Few api's that i wrote needed to allocate some memory since a file needed to be parsed and kept in that buffer. I started parsing the file without allocating the buffer hence received that message.
So you could look into similar code where you might be doing the same.
I've resolved this by deleting the apk files that i have created before and they still remain in Project Files list.

Categories

Resources