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

Fatal signal 11 with GifDrawable created from InputStream #12

Closed
Wavesonics opened this issue Nov 15, 2013 · 2 comments
Closed

Fatal signal 11 with GifDrawable created from InputStream #12

Wavesonics opened this issue Nov 15, 2013 · 2 comments
Assignees
Labels

Comments

@Wavesonics
Copy link
Contributor

I'm tracking down a crash in the native side.

Repro:
Create a GifDrawable from a ByteArrayInputStream: new GifDrawable( inputStream )

It will appear to create correctly, reporting proper width, height, and no error.

However, once a frame is requested from it, it will crash with the following back trace:

signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 000002c0
00 pc 00001670 /data/app-lib/xxx/libgif.so
01 pc 000028c3 /data/app-lib/xxx/libgif.so (DGifGetRecordType+32)
02 pc 000018ed /data/app-lib/xxx/libgif.so (DDGifSlurp+20)
03 pc 00002123 /data/app-lib/xxx/libgif.so (Java_pl_droidsonroids_gif_GifDrawable_renderFrame+670)

Using the exact same image and loading it either as a Resource, or FileDescriptor works flawlessly. From my investigation so far, it looks like the problem likely resides in:
gif.c :: openStream() the JNI implementation

It's the only part of the code path that is different depending on the source (InputStream VS FileDescriptor)

@Wavesonics
Copy link
Contributor Author

Recompiled with debug symbols, the stack trace looks like this:

Fatal signal 11 (SIGSEGV) at 0x000002c1 (code=1), thread 5097
00 pc 000017fe /data/app-lib/xxx/libgif.so (streamReadFun+25)
01 pc 0000321d /data/app-lib/xxx/libgif.so (DGifGetRecordType+68)
02 pc 00001b75 /data/app-lib/xxx/libgif.so (DDGifSlurp+20)
03 pc 00002903 /data/app-lib/xxx/libgif.so (getBitmap+138)
04 pc 00002a7b /data/app-lib/xxx/libgif.so (Java_pl_droidsonroids_gif_GifDrawable_renderFrame+166)

So looks like streamReadFun() is blowing up. It's not always the exact same stack, but it's always the same terminus, streamReadFun()

@Wavesonics
Copy link
Contributor Author

This was fixed by #11

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

No branches or pull requests

2 participants