Forums - Adreno Profiler crash on Mac

6 posts / 0 new
Last post
Adreno Profiler crash on Mac
mark3
Join Date: 23 Apr 15
Posts: 4
Posted: Wed, 2015-05-13 06:55

Hi,

I'm getting a crash in the Scrubber GL in Adreno Profiler 4.0.5511.28036 running on Mac OS X.  When I click "Capture Frame" it seems to get quite far, including capturing lots of textures, but then crashes.  Running the profiler from the command line shows this when it crashes:

Stacktrace:

  at (wrapper managed-to-native) GLESWrapper.gl2.BufferData (uint,int,byte[],uint) <0xffffffff>
  at QXProfiler.Tokens.TokenGLDataPerBufferObject.ExecuteGLES20 () <0x00043>
  at QXProfilerControls.ScrubberViewES20.PrivateRender (QXProfiler.Containers.IContainerDataPlaybackGLES20) <0x0161d>
  at QXProfilerControls.ScrubberViewES20.CalculateUselessClear () <0x002fb>
  at QXProfilerControls.ScrubberViewES20.ScrubberViewES20_Paint (object,System.Windows.Forms.PaintEventArgs) <0x004c7>
  at System.Windows.Forms.Control.OnPaint (System.Windows.Forms.PaintEventArgs) <0x00052>
  at System.Windows.Forms.Control.WmPaint (System.Windows.Forms.Message&) <0x0019e>
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message&) <0x0019f>
  at System.Windows.Forms.ScrollableControl.WndProc (System.Windows.Forms.Message&) <0x00013>
  at System.Windows.Forms.ContainerControl.WndProc (System.Windows.Forms.Message&) <0x00057>
  at System.Windows.Forms.UserControl.WndProc (System.Windows.Forms.Message&) <0x00063>
  at System.Windows.Forms.Control/ControlWindowTarget.OnMessage (System.Windows.Forms.Message&) <0x0001a>
  at System.Windows.Forms.Control/ControlNativeWindow.WndProc (System.Windows.Forms.Message&) <0x0002b>
  at System.Windows.Forms.NativeWindow.WndProc (intptr,System.Windows.Forms.Msg,intptr,intptr) <0x0028c>
  at System.Windows.Forms.XplatUIX11.DispatchMessage (System.Windows.Forms.MSG&) <0x00023>
  at System.Windows.Forms.XplatUI.DispatchMessage (System.Windows.Forms.MSG&) <0x0001a>
  at System.Windows.Forms.Application.RunLoop (bool,System.Windows.Forms.ApplicationContext) <0x00a1f>
  at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext) <0x0005b>
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form) <0x00037>
  at QXProfilerFrontEnd.Program.Main (string[]) <0x00377>
  at (wrapper runtime-invoke) .runtime_invoke_void_object (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

	0   mono                                0x000b98e6 mono_handle_native_sigsegv + 422
	1   mono                                0x000048fe mono_sigsegv_signal_handler + 334
	2   libsystem_platform.dylib            0x9603003b _sigtramp + 43
	3   ???                                 0xffffffff 0x0 + 4294967295
	4   libGPUSupportMercury.dylib          0x900123cb gpusCheckResource + 31
	5   libGPUSupportMercury.dylib          0x9000b540 gldTestMemoryPlugin + 31
	6   GLEngine                            0x9c237872 gleGetFreeOrphanNode + 305
	7   GLEngine                            0x9c16e342 gleAcquireBufferData + 136
	8   GLEngine                            0x9c16e0cf glBufferData_Exec + 402
	9   libGL.dylib                         0x961acaa9 glBufferData + 55
	10  libGLESv2.dylib                     0x0ee2a95b _Z13mglBufferDatajlPKvj + 491
	11  ???                                 0x36b9a4c0 0x0 + 918136000
	12  ???                                 0x36b9a464 0x0 + 918135908
	13  ???                                 0x36b99d9e 0x0 + 918134174
	14  ???                                 0x36bd0fcc 0x0 + 918360012
	15  ???                                 0x0fe5ac50 0x0 + 266710096
	16  ???                                 0x0572c40b 0x0 + 91407371
	17  ???                                 0x05729d47 0x0 + 91397447
	18  ???                                 0x053096e0 0x0 + 87070432
	19  ???                                 0x05718bec 0x0 + 91327468
	20  ???                                 0x05718bb0 0x0 + 91327408
	21  ???                                 0x05e78604 0x0 + 99059204
	22  ???                                 0x0530953b 0x0 + 87070011
	23  ???                                 0x05309514 0x0 + 87069972
	24  ???                                 0x0530835d 0x0 + 87065437
	25  ???                                 0x05728f7c 0x0 + 91393916
	26  ???                                 0x05de3f9b 0x0 + 98451355
	27  ???                                 0x05dda5f8 0x0 + 98412024
	28  ???                                 0x05dd9b84 0x0 + 98409348
	29  ???                                 0x05dd9828 0x0 + 98408488
	30  ???                                 0x004ad2b8 0x0 + 4903608
	31  ???                                 0x004ad4df 0x0 + 4904159
	32  mono                                0x00010624 mono_jit_runtime_invoke + 164
	33  mono                                0x001c1032 mono_runtime_invoke + 137
	34  mono                                0x001c3940 mono_runtime_exec_main + 669
	35  mono                                0x001c2c7a mono_runtime_run_main + 843
	36  mono                                0x0008943d mono_main + 7773
	37  mono                                0x00002db5 start + 53

Debug info from gdb:


=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Abort trap: 6

I've had the profiler work fine on simpler scenes, but something in the main scene for the game I'm working on is triggering a bug somewhere.

Is this a known issue?  Is there a newer version of the profiler or Mono or the OpenGL libraries I should try instead?

Thanks,
Mark

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Wed, 2015-05-13 07:27

What device are you trying to profile on and what OS version does it have?

Here are some instructions for profiling on Mac devices....

* Mono Framework 2.10.5
   It is important to get that particular version of the Mono Framework and can be downloaded from:
   Steps:
   - Download Mono Framework 2.10.5 from http://mono-project.com/OldReleases
   - Mount the .dmg image by clicking it on the finder.
   - Double click the Mono Framework 2.10.5 .pkg file and follow the installer instructions.
   
 * xQuartz 
   - Download latest xQuartz from http://xquartz.macosforge.org/landing/
   - Mount the .dmg image by clicking it on the finder.
   - Double click the XQuartz.pkg file and follow the installer instructions.
   
To Run Adreno Profiler in OS X:
1. Verify ADB is available in your system PATH
2. Open a Terminal window
3. Navigate to the location where the Adreno Profiler.app bundle is installed
4. Use the open command 'open AdrenoProfiler.app' to run Adreno Profiler

 

 

 

  • Up0
  • Down0
mark3
Join Date: 23 Apr 15
Posts: 4
Posted: Wed, 2015-05-13 10:20

This is happeng for both an LG Nexus 5 running Android 5.0.1 and an Asus Nexus 7 (2013) running Android 5.1.  My computer is an iMac Retina 5K running OS X Yosemite 10.10.3.  I've installed the exact version of Mono mentioned in the instructions and XQuartz.

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Tue, 2015-05-26 14:52

We would like to do some testing with the apk, if that's possible and you can share the apk and simple instructions to get to the point where you are profiling.

Also have you tried profiling from a Windows PC?

  • Up0
  • Down0
mark3
Join Date: 23 Apr 15
Posts: 4
Posted: Fri, 2015-06-12 04:02

Hi,

I've been busy with a milestone recently, but have some time today to look at this again. I've been trying to put together a minimal APK to demonstrate the problem, but have thus far failed to reproduce the exact problem as described above :-(. The app is built using Unity 5.0 and the problem only seemed to occur if the "Dynamic Batching" option was enabled in in Unity's "Player Settings" pane. What I have encountered though is a crash on device in the graphics library, and a backtrace from the system logs is below. Again, this happened when Unity's dynamic batching was enabled, but didn't occur when that was disabled.

06-12 11:34:52.749 I/DEBUG   (24647): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
06-12 11:34:52.749 I/DEBUG   (24647): Build fingerprint: 'google/hammerhead/hammerhead:5.0.1/LRX22C/1602158:user/release-keys'
06-12 11:34:52.749 I/DEBUG   (24647): Revision: '11'
06-12 11:34:52.749 I/DEBUG   (24647): ABI: 'arm'
06-12 11:34:52.749 I/DEBUG   (24647): pid: 15988, tid: 16216, name: UnityGfxDeviceW  >>> com.XXXXXXXX.XXXXXXXX <<<
06-12 11:34:52.749 I/DEBUG   (24647): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x3756
06-12 11:34:52.782 I/DEBUG   (24647):     r0 9debe93e  r1 9debe93c  r2 00003756  r3 00000528
06-12 11:34:52.782 I/DEBUG   (24647):     r4 00000528  r5 00003756  r6 9f0e8874  r7 00003756
06-12 11:34:52.783 I/DEBUG   (24647):     r8 00000000  r9 9f0e8000  sl 00000001  fp 00000000
06-12 11:34:52.783 I/DEBUG   (24647):     ip 00000028  sp 9debe8e0  lr ab8c3e4d  pc ab8c3786  cpsr 600e0030
06-12 11:34:52.783 I/DEBUG   (24647):
06-12 11:34:52.783 I/DEBUG   (24647): backtrace:
06-12 11:34:52.783 I/DEBUG   (24647):     #00 pc 00056786  /system/vendor/lib/egl/libGLESv2_adreno.so (neon_pld_min_max_16+5)
06-12 11:34:52.783 I/DEBUG   (24647):     #01 pc 00056e49  /system/vendor/lib/egl/libGLESv2_adreno.so (cache_vertex_elements+80)
06-12 11:34:52.783 I/DEBUG   (24647):     #02 pc 0005a4d9  /system/vendor/lib/egl/libGLESv2_adreno.so (core_glDrawElementsInstancedXXX+324)
06-12 11:34:52.783 I/DEBUG   (24647):     #03 pc 0005a671  /system/vendor/lib/egl/libGLESv2_adreno.so (core_glDrawElements+10)
06-12 11:34:52.783 I/DEBUG   (24647):     #04 pc 000499a3  /system/vendor/lib/egl/libGLESv2_adreno.so (glDrawElements+28)
06-12 11:34:52.783 I/DEBUG   (24647):     #05 pc 004be114  /data/app/com.XXXXXXXX.XXXXXXXX-2/lib/arm/libunity.so (GfxDeviceGLES::DrawBuffers(IndexBuffer*, VertexStreamSource const*, int, DrawBuffersRange const*, int, VertexDeclaration*, ChannelAssigns const&)+528)
06-12 11:34:52.783 I/DEBUG   (24647):     #06 pc 004ab1d8  /data/app/com.XXXXXXXX.XXXXXXXX-2/lib/arm/libunity.so (GfxDeviceWorker::RunCommand(ThreadedStreamBuffer&)+13752)
06-12 11:34:52.784 I/DEBUG   (24647):     #07 pc 004ad3f0  /data/app/com.XXXXXXXX.XXXXXXXX-2/lib/arm/libunity.so (GfxDeviceWorker::Run()+20)
06-12 11:34:52.784 I/DEBUG   (24647):     #08 pc 004a7c08  /data/app/com.XXXXXXXX.XXXXXXXX-2/lib/arm/libunity.so (GfxDeviceWorker::RunGfxDeviceWorker(void*)+84)
06-12 11:34:52.784 I/DEBUG   (24647):     #09 pc 0042b3e0  /data/app/com.XXXXXXXX.XXXXXXXX-2/lib/arm/libunity.so (Thread::RunThreadWrapper(void*)+84)
06-12 11:34:52.784 I/DEBUG   (24647):     #10 pc 000162e3  /system/lib/libc.so (__pthread_start(void*)+30)
06-12 11:34:52.784 I/DEBUG   (24647):     #11 pc 000142d3  /system/lib/libc.so (__start_thread+6)

I'll keep trying to recreate the state where it runs on device, but a capture crashes the profiler.  However if I don't manage to in a couple of hours then I'll have to move on to other things.

Mark

  • Up0
  • Down0
mark3
Join Date: 23 Apr 15
Posts: 4
Posted: Fri, 2015-06-12 07:18

OK, I've managed to produce an APK which causes the Adreno profiler to crash when capturing a frame.  Unfortunately it's an intermittent crash, however it will usually will crash on the second frame capture if it doesn't on the first.  Also I think Unity "Dynamic Batching" setting is a red herring as the crashes now happen both with and without it.

Furthermore there seem to be multiple places in the code within the profiler where crashes can occur.  Most crashes have a callstack like the one at the top of this thread, but I've also seen crashes with the following two callstacks:

0   mono                                0x000b98e6 mono_handle_native_sigsegv + 422
1   mono                                0x000048fe mono_sigsegv_signal_handler + 334
2   libsystem_platform.dylib            0x938a703b _sigtramp + 43
3   ???                                 0xffffffff 0x0 + 4294967295
4   libGLESv2.dylib                     0x0ee1165e _ZN3Fbo22CheckFramebufferStatusEj + 510
5   libGLESv2.dylib                     0x0ee050ac _Z25mglCheckFramebufferStatusj + 492
6   libGLESv2.dylib                     0x0ee052a2 _Z21mglReadPixelsInternaliiiijjPvi + 146
7   libGLESv2.dylib                     0x0ee2a0d3 glReadPixelsDepthReadEnabledPROFILER + 67
8   ???                                 0x0ac24f30 0x0 + 180506416
9   ???                                 0x0ebe4f04 0x0 + 247353092
10  ???                                 0x30cefdce 0x0 + 818871758
11  ???                                 0x30d17dc4 0x0 + 819035588
12  ???                                 0x0f0708a8 0x0 + 252119208
13  ???                                 0x060f63db 0x0 + 101671899
14  ???                                 0x060f3d17 0x0 + 101661975
15  ???                                 0x04ccc6e0 0x0 + 80529120
16  ???                                 0x060e4bec 0x0 + 101600236
17  ???                                 0x060e4bb0 0x0 + 101600176
18  ???                                 0x06640e3c 0x0 + 107220540
19  ???                                 0x04ccc53b 0x0 + 80528699
20  ???                                 0x04ccc514 0x0 + 80528660
21  ???                                 0x04ccb35d 0x0 + 80524125
22  ???                                 0x060f3034 0x0 + 101658676
23  ???                                 0x065aa7cb 0x0 + 106604491
24  ???                                 0x065a0f00 0x0 + 106565376
25  ???                                 0x065a048c 0x0 + 106562700
26  ???                                 0x065a0130 0x0 + 106561840
27  ???                                 0x004ad2b8 0x0 + 4903608
28  ???                                 0x004ad4df 0x0 + 4904159
29  mono                                0x00010624 mono_jit_runtime_invoke + 164
30  mono                                0x001c1032 mono_runtime_invoke + 137
31  mono                                0x001c3940 mono_runtime_exec_main + 669
32  mono                                0x001c2c7a mono_runtime_run_main + 843
33  mono                                0x0008943d mono_main + 7773
34  mono                                0x00002db5 start + 53
0   mono                                0x000b98e6 mono_handle_native_sigsegv + 422
1   mono                                0x000048fe mono_sigsegv_signal_handler + 334
2   libsystem_platform.dylib            0x938a703b _sigtramp + 43
3   ???                                 0xffffffff 0x0 + 4294967295
4   libgdiplus.dylib                    0x05b9ef0f _mono_cairo_xlib_surface_finish + 271
5   libgdiplus.dylib                    0x05b92c33 mono_cairo_surface_finish + 67
6   libgdiplus.dylib                    0x05b92d08 mono_cairo_surface_destroy + 120
7   libgdiplus.dylib                    0x05b652c5 _mono_cairo_gstate_fini + 133
8   libgdiplus.dylib                    0x05ba4b0f mono_cairo_destroy + 95
9   libgdiplus.dylib                    0x05b1f857 GdipDeleteGraphics + 151
10  ???                                 0x067bcb24 0x0 + 108776228
11  ???                                 0x067bcaac 0x0 + 108776108
12  ???                                 0x067bca18 0x0 + 108775960
13  ???                                 0x067e450c 0x0 + 108938508
14  ???                                 0x067e4448 0x0 + 108938312
15  ???                                 0x067e1d70 0x0 + 108928368
16  ???                                 0x067ad6e0 0x0 + 108713696
17  ???                                 0x067d0bec 0x0 + 108858348
18  ???                                 0x067d0bb0 0x0 + 108858288
19  ???                                 0x0781a814 0x0 + 125937684
20  ???                                 0x067ad53b 0x0 + 108713275
21  ???                                 0x067ad514 0x0 + 108713236
22  ???                                 0x067ac35d 0x0 + 108708701
23  ???                                 0x067e0f7c 0x0 + 108924796
24  ???                                 0x07785f9b 0x0 + 125329307
25  ???                                 0x0777c5f8 0x0 + 125289976
26  ???                                 0x0777bb84 0x0 + 125287300
27  ???                                 0x0777b828 0x0 + 125286440
28  ???                                 0x004ad2b8 0x0 + 4903608
29  ???                                 0x004ad4df 0x0 + 4904159
30  mono                                0x00010624 mono_jit_runtime_invoke + 164
31  mono                                0x001c1032 mono_runtime_invoke + 137
32  mono                                0x001c3940 mono_runtime_exec_main + 669
33  mono                                0x001c2c7a mono_runtime_run_main + 843
34  mono                                0x0008943d mono_main + 7773
35  mono                                0x00002db5 start + 53

Anyway, please can you message me with details of where to upload the APK for you to test?

Thanks,
Mark

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.