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

Android App Crash, when tracing with GAPID #1508

Closed
Jakouf opened this issue Dec 15, 2017 · 5 comments
Closed

Android App Crash, when tracing with GAPID #1508

Jakouf opened this issue Dec 15, 2017 · 5 comments

Comments

@Jakouf
Copy link

Jakouf commented Dec 15, 2017

I have currently the problem, when I trace an application with GAPID, that it crashes shortly after the app was launched.

My System: macOS 10.13.2
Android Phone: Pixel 2 XL 8.1.0
GAPID version: 1.0.0

Log from GAPID:

Press enter to stop capturing...
11:05:20.389 I: [gapidapk.EnsureInstalled] <gapit> Examining gapid.apk on host...
11:05:20.395 I: [gapidapk.EnsureInstalled] <gapit> Looking for gapid.apk...
11:05:20.896 I: [gapidapk.EnsureInstalled] <gapit> Found gapid package...
11:05:20.984 I: <gapit> Adding new device
11:05:20.984 I: <gapit> Device list:
11:05:20.984 I: <gapit>   711KPQJ0739004
11:05:21.275 I: <gapit> Package is debuggable
11:05:21.424 I: [start] <gapit> Turning device screen on
11:05:21.490 I: [start] <gapit> Checking for lockscreen
11:05:21.578 W: [start] <gapit> Couldn't determine lockscreen state: 
   Cause: Couldn't get lockscreen state
11:05:21.578 I: [start] <gapit> Checking gapid.apk is installed
11:05:21.578 I: [start] <gapit> Forwarding
11:05:21.669 I: [start] <gapit> Starting activity in debug mode
11:05:22.135 I: [start] <gapit> Forwarding TCP port 57060 -> JDWP pid 14237
11:05:22.151 I: [start] <gapit> Connecting to JDWP
11:05:22.157 I: [start] <gapit> Waiting for ApplicationLoaders.getClassLoader()
11:05:23.829 I: [start] <gapit> Waiting for Application Creation
11:05:23.833 I: [start] <gapit>    Waiting for Application.<init>()
11:05:25.314 I: [start] <gapit>    Waiting for de.jakouf.something_test.Application.onCreate()
11:05:25.411 I: [start] <gapit> Installing interceptor libraries
11:05:27.971 I: [start] <gapit> GVR library not found
11:05:28.382 I: [start] <gapit> Waiting for connection to localhost:57045...
11:05:29.248 I: <gapit> Creating file '/Users/jakouf/Desktop/something_test_20171215_1205.gfxtrace'
11:05:29.473 I: <gapit> Capturing: 65.50KB in 0s
11:05:30.301 I: <gapit> EOF: 2.10MB

Also the Logcat Log from the Android device

12-15 12:05:29.970 14269 14269 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
12-15 12:05:29.970 14269 14269 F DEBUG   : Build fingerprint: 'google/taimen/taimen:8.1.0/OPM1.171019.011/4448085:user/release-keys'
12-15 12:05:29.970 14269 14269 F DEBUG   : Revision: 'rev_10'
12-15 12:05:29.970 14269 14269 F DEBUG   : ABI: 'arm64'
12-15 12:05:29.970 14269 14269 F DEBUG   : pid: 14237, tid: 14264, name: RenderThread  >>> de.jakouf.something_test <<<
12-15 12:05:29.970 14269 14269 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
12-15 12:05:29.973 14269 14269 F DEBUG   : Abort message: '[/tmpfs/src/github/src/github.com/google/gapid/gapii/cc/pool.cpp:34] Out of memory allocating 0xd48500 bytes'
12-15 12:05:29.973 14269 14269 F DEBUG   :     x0   0000000000000000  x1   00000000000037b8  x2   0000000000000006  x3   0000000000000008
12-15 12:05:29.973 14269 14269 F DEBUG   :     x4   0000008000000000  x5   0000008000000000  x6   0000008000000000  x7   0000000080000000
12-15 12:05:29.973 14269 14269 F DEBUG   :     x8   0000000000000083  x9   0000000010000000  x10  00000075b55fe6c0  x11  0000000000000001
12-15 12:05:29.973 14269 14269 F DEBUG   :     x12  00000075b55fe7e0  x13  0000000000000020  x14  ffffffffffffffff  x15  00377eaf87f1eacc
12-15 12:05:29.973 14269 14269 F DEBUG   :     x16  0000005a35cdffa8  x17  000000764ff0352c  x18  000000764ff71000  x19  000000000000379d
12-15 12:05:29.973 14269 14269 F DEBUG   :     x20  00000000000037b8  x21  0000000000000083  x22  000000000000918e  x23  0000000000000000
12-15 12:05:29.973 14269 14269 F DEBUG   :     x24  0000000000000000  x25  0000000000000001  x26  00000075ce83c4a0  x27  0000000000009114
12-15 12:05:29.973 14269 14269 F DEBUG   :     x28  00000075b55feed4  x29  00000075b55fe700  x30  000000764feb8760
12-15 12:05:29.973 14269 14269 F DEBUG   :     sp   00000075b55fe6c0  pc   000000764feb8788  pstate 0000000060000000
12-15 12:05:30.005 14269 14269 F DEBUG   : 
12-15 12:05:30.005 14269 14269 F DEBUG   : backtrace:
12-15 12:05:30.005 14269 14269 F DEBUG   :     #00 pc 000000000001d788  /system/lib64/libc.so (abort+120)
12-15 12:05:30.005 14269 14269 F DEBUG   :     #01 pc 0000000000007f08  /system/lib64/liblog.so (__android_log_assert+296)
12-15 12:05:30.005 14269 14269 F DEBUG   :     #02 pc 0000000000556374  /data/app/com.google.android.gapid.aarch64-5rQuQywRc6VOukUv7WWIUg==/lib/arm64/libgapii.so
12-15 12:05:30.005 14269 14269 F DEBUG   :     #03 pc 00000000002b9900  /data/app/com.google.android.gapid.aarch64-5rQuQywRc6VOukUv7WWIUg==/lib/arm64/libgapii.so
12-15 12:05:30.005 14269 14269 F DEBUG   :     #04 pc 00000000003270c8  /data/app/com.google.android.gapid.aarch64-5rQuQywRc6VOukUv7WWIUg==/lib/arm64/libgapii.so
12-15 12:05:30.005 14269 14269 F DEBUG   :     #05 pc 000000000022293c  /data/app/com.google.android.gapid.aarch64-5rQuQywRc6VOukUv7WWIUg==/lib/arm64/libgapii.so
12-15 12:05:30.005 14269 14269 F DEBUG   :     #06 pc 0000000000065da4  /system/lib64/libgui.so (android::GLConsumer::EglImage::createImage(void*, android::sp<android::GraphicBuffer> const&, android::Rect const&)+476)
12-15 12:05:30.005 14269 14269 F DEBUG   :     #07 pc 00000000000642f4  /system/lib64/libgui.so (android::GLConsumer::EglImage::createIfNeeded(void*, android::Rect const&, bool)+252)
12-15 12:05:30.005 14269 14269 F DEBUG   :     #08 pc 0000000000062fb0  /system/lib64/libgui.so (android::GLConsumer::updateAndReleaseLocked(android::BufferItem const&, android::GLConsumer::PendingRelease*)+316)
12-15 12:05:30.005 14269 14269 F DEBUG   :     #09 pc 0000000000062cd4  /system/lib64/libgui.so (android::GLConsumer::updateTexImage()+232)
12-15 12:05:30.005 14269 14269 F DEBUG   :     #10 pc 0000000000084c6c  /system/lib64/libhwui.so (android::uirenderer::DeferredLayerUpdater::doUpdateTexImage()+52)
12-15 12:05:30.005 14269 14269 F DEBUG   :     #11 pc 0000000000084ab8  /system/lib64/libhwui.so (android::uirenderer::DeferredLayerUpdater::apply()+236)
12-15 12:05:30.005 14269 14269 F DEBUG   :     #12 pc 000000000006b5b4  /system/lib64/libhwui.so (android::uirenderer::renderthread::DrawFrameTask::syncFrameState(android::uirenderer::TreeInfo&)+136)
12-15 12:05:30.005 14269 14269 F DEBUG   :     #13 pc 000000000006b454  /system/lib64/libhwui.so (android::uirenderer::renderthread::DrawFrameTask::run()+124)
12-15 12:05:30.005 14269 14269 F DEBUG   :     #14 pc 0000000000072a58  /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+336)
12-15 12:05:30.005 14269 14269 F DEBUG   :     #15 pc 00000000000114e8  /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+280)
12-15 12:05:30.005 14269 14269 F DEBUG   :     #16 pc 00000000000a9814  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+140)
12-15 12:05:30.005 14269 14269 F DEBUG   :     #17 pc 0000000000067d80  /system/lib64/libc.so (__pthread_start(void*)+36)
12-15 12:05:30.005 14269 14269 F DEBUG   :     #18 pc 000000000001ec18  /system/lib64/libc.so (__start_thread+68)

Could that be a problem, that I render from a different thread than the main thread?

When I start this with GAPID 0.9.0 this is working. But already not working anymore in 0.9.6 (I skipped 0.9.6, so therefore I run with 1.0.0 into this problem only now)

@ben-clayton
Copy link
Contributor

Hi @Jakouf,

I'm sorry you're having this issue. Do you have a minimal app you could share that exhibits this crash?

If so, are you comfortable sending it to me at myemail ?

Many thanks,
Ben

@andreygorand
Copy link

Hi All.
I am having the same issue with GAPID v 0.9.6 and v 1.0.0. In 0.9.0 everything is fine.

My System: Windows 7 64bit
Android Phone: Samsung Galaxy Note 8
GAPID version: 1.0.0 and 0.9.6

Looks like the issue connected with surfaceTexture.updateTexImage()

Code is:

           int  mTextureID = createExternalTextureObject(); // Create texture GLES11Ext.GL_TEXTURE_EXTERNAL_OES

            SurfaceTexture surfaceTexture = new SurfaceTexture(mTextureID);
            surfaceTexture.setDefaultBufferSize(1280, 720);
            Surface surface = new Surface(surfaceTexture);

            final Bitmap bitmap = BitmapFactory.decodeStream(mContext.getResources().openRawResource(R.raw.image), null, DEFAULT_BITMAP_OPTIONS);

            try {
                final Canvas canvas = surface.lockCanvas(null);
                canvas.drawBitmap(bitmap, 0, 0, null);
                surface.unlockCanvasAndPost(canvas);

            } catch (Exception e) {
                e.printStackTrace();
            }

            bitmap.recycle();
            surfaceTexture.updateTexImage();

LogCat


12-18 17:05:20.960 26127-26127/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
12-18 17:05:20.969 26127-26127/? A/DEBUG: Abort message: '[T:\src\github\src\github.com\google\gapid\gapii\cc\pool.cpp:34] Out of memory allocating 0x384000 bytes'

12-18 17:05:20.970 26127-26127/? A/DEBUG:     r0 00000000  r1 0000660c  r2 00000006  r3 00000008
12-18 17:05:20.970 26127-26127/? A/DEBUG:     r4 c7b97978  r5 00000006  r6 c7b97920  r7 0000010c
12-18 17:05:20.970 26127-26127/? A/DEBUG:     r8 00000000  r9 00384000  sl 0000023a  fp 00000001
12-18 17:05:20.970 26127-26127/? A/DEBUG:     ip 0000000c  sp c7b96490  lr e9b61097  pc e9b638f4  cpsr 200f0010
12-18 17:05:21.443 26127-26127/? A/DEBUG: backtrace:
12-18 17:05:21.444 26127-26127/? A/DEBUG:     #00 pc 0004a8f4  /system/lib/libc.so (tgkill+12)
12-18 17:05:21.444 26127-26127/? A/DEBUG:     #01 pc 00048093  /system/lib/libc.so (pthread_kill+34)
12-18 17:05:21.444 26127-26127/? A/DEBUG:     #02 pc 0001db6d  /system/lib/libc.so (raise+10)
12-18 17:05:21.444 26127-26127/? A/DEBUG:     #03 pc 00019271  /system/lib/libc.so (__libc_android_abort+34)
12-18 17:05:21.444 26127-26127/? A/DEBUG:     #04 pc 0001718c  /system/lib/libc.so (abort+4)
12-18 17:05:21.444 26127-26127/? A/DEBUG:     #05 pc 00005931  /system/lib/liblog.so (__android_log_assert+112)
12-18 17:05:21.444 26127-26127/? A/DEBUG:     #06 pc 00220657  /data/app/com.google.android.gapid.armeabi-1/lib/arm/libgapii.so
12-18 17:05:21.444 26127-26127/? A/DEBUG:     #07 pc 002205eb  /data/app/com.google.android.gapid.armeabi-1/lib/arm/libgapii.so
12-18 17:05:21.444 26127-26127/? A/DEBUG:     #08 pc 0015b1b3  /data/app/com.google.android.gapid.armeabi-1/lib/arm/libgapii.so
12-18 17:05:21.444 26127-26127/? A/DEBUG:     #09 pc 000b9fcb  /data/app/com.google.android.gapid.armeabi-1/lib/arm/libgapii.so
12-18 17:05:21.444 26127-26127/? A/DEBUG:     #10 pc 00044889  /system/lib/libgui.so (_ZN7android10GLConsumer8EglImage11createImageEPvRKNS_2spINS_13GraphicBufferEEERKNS_4RectE+356)
12-18 17:05:21.444 26127-26127/? A/DEBUG:     #11 pc 000433a1  /system/lib/libgui.so (_ZN7android10GLConsumer8EglImage14createIfNeededEPvRKNS_4RectEb+164)
12-18 17:05:21.444 26127-26127/? A/DEBUG:     #12 pc 00042793  /system/lib/libgui.so (_ZN7android10GLConsumer22updateAndReleaseLockedERKNS_10BufferItemEPNS0_14PendingReleaseE+186)
12-18 17:05:21.444 26127-26127/? A/DEBUG:     #13 pc 0004258f  /system/lib/libgui.so (_ZN7android10GLConsumer14updateTexImageEv+178)
12-18 17:05:21.444 26127-26127/? A/DEBUG:     #14 pc 000b0075  /system/lib/libandroid_runtime.so
12-18 17:05:21.444 26127-26127/? A/DEBUG:     #15 pc 02308197  /system/framework/arm/boot-framework.oat (offset 0x1f72000) (android.graphics.SurfaceTexture.nativeUpdateTexImage+74)

Many thanks,
Andrei

@ben-clayton
Copy link
Contributor

Thank you for the additional info.

As we're now so close to the festive period, most of the GAPID have now gone on vacation. We'll be sure to look into this with priority in the new year.

Thank you for your patience,
Ben

@Jakouf
Copy link
Author

Jakouf commented Jan 15, 2018

@ben-clayton: I sent you an email with an apk, where you can reproduce the bug.

@ben-clayton
Copy link
Contributor

Thank you @Jakouf, I'll take a look now.

ben-clayton added a commit to ben-clayton/gapid that referenced this issue Jan 15, 2018
I have no excuses for why I got this wrong first time.

Fixes: google#1508
ben-clayton added a commit that referenced this issue Jan 16, 2018
I have no excuses for why I got this wrong first time.

Fixes: #1508
ben-clayton added a commit to ben-clayton/gapid that referenced this issue Jan 17, 2018
I have no excuses for why I got this wrong first time.

Fixes: google#1508
ben-clayton added a commit that referenced this issue Jan 17, 2018
I have no excuses for why I got this wrong first time.

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

No branches or pull requests

3 participants