Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library crashes on Samsung gt i9195 - Galaxy Mini (Android 6.0.1) #19

Open
willblaschko opened this issue May 26, 2016 · 6 comments
Open

Comments

@willblaschko
Copy link

Crash below, it looks like it's failing to properly grab the external files dir.

Non-fatal Exception: java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
       at android.app.ContextImpl.getExternalFilesDir(ContextImpl.java:468)
       at android.content.ContextWrapper.getExternalFilesDir(ContextWrapper.java:219)
       at edu.cmu.pocketsphinx.Assets.<init>(Assets.java:95)
       at com.willblaschko.android.alexalistens.MainActivity$SettingsFragment$6.doInBackground(MainActivity.java:253)
       at com.willblaschko.android.alexalistens.MainActivity$SettingsFragment$6.doInBackground(MainActivity.java:245)
       at android.os.AsyncTask$2.call(AsyncTask.java:295)
       at java.util.concurrent.FutureTask.run(FutureTask.java:237)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
       at java.lang.Thread.run(Thread.java:818)
@mbait
Copy link
Contributor

mbait commented May 26, 2016

This stems from the Android sources and isn't the project's bug - we, obviously, can't check for every single possible bug that Android developers introduce.

@willblaschko
Copy link
Author

Nor am I requesting such a thing, I was wondering if there's something different that can be done in the Assets() init, if not, I'll just wrap it with a try/catch. Mostly I just wanted to let your team know about the crash (since I don't know how often you get bug reports).

@mbait
Copy link
Contributor

mbait commented May 26, 2016

Sure, thanks for the feedback! Probably it's worth to check why that happens, because Android docs say nothing about possible absence of the external storage. Also, if it doesn't exist it doesn't make sense to call to Assets because it basically unpacks models files on the external storage, and if the storage doesn't exist, there's nothing to unpack.

@willblaschko
Copy link
Author

Agreed. So based on the documentation I see: "Shared storage may not always be available, since removable media can be ejected by the user. Media state can be checked using getExternalStorageState(File)." Perhaps this is what causes that out of bounds exception?

@willblaschko
Copy link
Author

I've only seen this crash happen to one user on one device, so who knows what modded firmware they are using. If you want to address this particular issue, it's probably low priority.

@mbait
Copy link
Contributor

mbait commented May 26, 2016

According to this code
https://github.com/cmusphinx/pocketsphinx-android/blob/master/src/main/java/edu/cmu/pocketsphinx/Assets.java#L95
getExternalStorageDir probably used to return null in case of failure.
We can issue a quick patch that fixes the issue by examining the output of
getExternalStorageState.

On Thu, May 26, 2016 at 2:31 PM, Will Blaschko [email protected]
wrote:

I've only seen this crash happen to one user on one device, so who knows
what modded firmware they are using. If you want to address this particular
issue, it's probably low priority.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#19 (comment)

Sincerely, Alexander

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants