Is native debugging on Pixel C supported?

I have Shield TV and Pixel C. Both seem to me to have the same hardware Tegra X1. If I create a native application with the wizard in Nsight Tegra and then start a debugging session - on the Shield TV debugging works. On the Pixel C - I get the same error message as in this post: [url]https://devtalk.nvidia.com/default/topic/897667/cannot-launch-gdbserver/[/url]

“Cannot launch gdbserver: all options have failed.”
“Failed to attch: Failed to start debug server on the device”

External Media

log.txt (9.76 KB)

And this is the Android log. I don’t see anyhthing strange.

06-03 17:15:06.261  1128  1303 W OpenGLRenderer: Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer...
06-03 17:14:55.639  1242  1242 I Auth    : [AuthDelegateWrapper] Service intent: Intent { cmp=com.google.android.gms/.auth.account.authenticator.DefaultAuthDelegateService }.
06-03 17:14:55.650  1242  1242 I Auth    : [AuthDelegateWrapper] Service intent: Intent { cmp=com.google.android.gms/.auth.account.authenticator.DefaultAuthDelegateService }.
06-03 17:14:55.652  1242  1242 I Auth    : [AuthDelegateWrapper] Service intent: Intent { cmp=com.google.android.gms/.auth.account.authenticator.DefaultAuthDelegateService }.
06-03 17:15:01.622  4004  4004 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
06-03 17:15:01.624  4004  4004 D AndroidRuntime: CheckJNI is OFF
06-03 17:15:01.643  4004  4004 D ICU     : No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
06-03 17:15:01.662  4004  4004 I Radio-JNI: register_android_hardware_Radio DONE
06-03 17:15:01.675  4004  4004 D AndroidRuntime: Calling main entry com.android.commands.am.Am
06-03 17:15:01.676   530  1147 I ActivityManager: Force stopping Ashkolsum.v appid=10080 user=0: from pid 4004
06-03 17:15:01.676   530  1147 I ActivityManager: Killing 3959:Ashkolsum.v/u0a80 (adj 9): stop Ashkolsum.v
06-03 17:15:01.682   530  1070 W ActivityManager: Spurious death for ProcessRecord{3c19891 0:Ashkolsum.v/u0a80}, curProc for 3959: null
06-03 17:15:01.682  4004  4004 D AndroidRuntime: Shutting down VM
06-03 17:15:02.188  4013  4013 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
06-03 17:15:02.191  4013  4013 D AndroidRuntime: CheckJNI is OFF
06-03 17:15:02.209  4013  4013 D ICU     : No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
06-03 17:15:02.228  4013  4013 I Radio-JNI: register_android_hardware_Radio DONE
06-03 17:15:02.242  4013  4013 D AndroidRuntime: Calling main entry com.android.commands.am.Am
06-03 17:15:02.243   530   689 I ActivityManager: Force stopping Ashkolsum.v appid=10080 user=-1: set debug app
06-03 17:15:02.243   530   689 I ActivityManager: START u0 {flg=0x10000000 cmp=Ashkolsum.v/android.app.NativeActivity} from uid 2000 on display 0
06-03 17:15:02.246  4013  4013 D AndroidRuntime: Shutting down VM
06-03 17:15:02.252  4022  4022 I art     : Late-enabling -Xcheck:jni
06-03 17:15:02.257   530  1145 I ActivityManager: Start proc 4022:Ashkolsum.v/u0a80 for activity Ashkolsum.v/android.app.NativeActivity
06-03 17:15:02.277  4022  4022 W ActivityThread: Application Ashkolsum.v is waiting for the debugger on port 8100...
06-03 17:15:02.284  4022  4022 I System.out: Sending WAIT chunk
06-03 17:15:02.297   530  3908 I OpenGLRenderer: Initialized EGL, version 1.4
06-03 17:15:03.323  4047  4047 W ls      : type=1400 audit(0.0:54): avc: denied { getattr } for path="/system/bin/blkid" dev="dm-0" ino=285 scontext=u:r:shell:s0 tcontext=u:object_r:blkid_exec:s0 tclass=file permissive=0
06-03 17:15:03.323  4047  4047 W ls      : type=1400 audit(0.0:55): avc: denied { getattr } for path="/system/bin/bootanimation" dev="dm-0" ino=288 scontext=u:r:shell:s0 tcontext=u:object_r:bootanim_exec:s0 tclass=file permissive=0
06-03 17:15:03.323  4047  4047 W ls      : type=1400 audit(0.0:56): avc: denied { getattr } for path="/system/bin/clatd" dev="dm-0" ino=300 scontext=u:r:shell:s0 tcontext=u:object_r:clatd_exec:s0 tclass=file permissive=0
06-03 17:15:03.324  4047  4047 W ls      : type=1400 audit(0.0:57): avc: denied { getattr } for path="/system/bin/crash_collector32" dev="dm-0" ino=307 scontext=u:r:shell:s0 tcontext=u:object_r:crash_collector_exec:s0 tclass=file permissive=0
06-03 17:15:03.324  4047  4047 W ls      : type=1400 audit(0.0:58): avc: denied { getattr } for path="/system/bin/crash_collector64" dev="dm-0" ino=308 scontext=u:r:shell:s0 tcontext=u:object_r:crash_collector_exec:s0 tclass=file permissive=0
06-03 17:15:03.324  4047  4047 W ls      : type=1400 audit(0.0:59): avc: denied { getattr } for path="/system/bin/crash_dispatcher" dev="dm-0" ino=309 scontext=u:r:shell:s0 tcontext=u:object_r:crash_collector_exec:s0 tclass=file permissive=0
06-03 17:15:03.324  4047  4047 W ls      : type=1400 audit(0.0:60): avc: denied { getattr } for path="/system/bin/debuggerd" dev="dm-0" ino=316 scontext=u:r:shell:s0 tcontext=u:object_r:debuggerd_exec:s0 tclass=file permissive=0
06-03 17:15:03.325  4047  4047 W ls      : type=1400 audit(0.0:61): avc: denied { getattr } for path="/system/bin/debuggerd64" dev="dm-0" ino=317 scontext=u:r:shell:s0 tcontext=u:object_r:debuggerd_exec:s0 tclass=file permissive=0
06-03 17:15:03.325  4047  4047 W ls      : type=1400 audit(0.0:62): avc: denied { getattr } for path="/system/bin/dhcpcd" dev="dm-0" ino=320 scontext=u:r:shell:s0 tcontext=u:object_r:dhcp_exec:s0 tclass=file permissive=0
06-03 17:15:03.325  4047  4047 W ls      : type=1400 audit(0.0:63): avc: denied { getattr } for path="/system/bin/dnsmasq" dev="dm-0" ino=323 scontext=u:r:shell:s0 tcontext=u:object_r:dnsmasq_exec:s0 tclass=file permissive=0
06-03 17:15:03.325  4047  4047 W ls      : type=1400 audit(0.0:64): avc: denied { getattr } for path="/system/bin/drmserver" dev="dm-0" ino=326 scontext=u:r:shell:s0 tcontext=u:object_r:drmserver_exec:s0 tclass=file permissive=0
06-03 17:15:03.325  4047  4047 W ls      : type=1400 audit(0.0:65): avc: denied { getattr } for path="/system/bin/dump_bq25892.sh" dev="dm-0" ino=328 scontext=u:r:shell:s0 tcontext=u:object_r:dump_bq25892_exec:s0 tclass=file permissive=0
06-03 17:15:03.325  4047  4047 W ls      : type=1400 audit(0.0:66): avc: denied { getattr } for path="/system/bin/dumpstate" dev="dm-0" ino=329 scontext=u:r:shell:s0 tcontext=u:object_r:dumpstate_exec:s0 tclass=file permissive=0
06-03 17:15:03.325  4047  4047 W ls      : type=1400 audit(0.0:67): avc: denied { getattr } for path="/system/bin/e2fsck" dev="dm-0" ino=331 scontext=u:r:shell:s0 tcontext=u:object_r:fsck_exec:s0 tclass=file permissive=0
06-03 17:15:03.326  4047  4047 W ls      : type=1400 audit(0.0:68): avc: denied { getattr } for path="/system/bin/fsck.f2fs" dev="dm-0" ino=343 scontext=u:r:shell:s0 tcontext=u:object_r:fsck_exec:s0 tclass=file permissive=0
06-03 17:15:03.326  4047  4047 W ls      : type=1400 audit(0.0:69): avc: denied { getattr } for path="/system/bin/fsck_msdos" dev="dm-0" ino=344 scontext=u:r:shell:s0 tcontext=u:object_r:fsck_exec:s0 tclass=file permissive=0
06-03 17:15:03.326  4047  4047 W ls      : type=1400 audit(0.0:70): avc: denied { getattr } for path="/system/bin/fwtool" dev="dm-0" ino=345 scontext=u:r:shell:s0 tcontext=u:object_r:fwtool_exec:s0 tclass=file permissive=0
06-03 17:15:03.326  4047  4047 W ls      : type=1400 audit(0.0:71): avc: denied { getattr } for path="/system/bin/gatekeeperd" dev="dm-0" ino=346 scontext=u:r:shell:s0 tcontext=u:object_r:gatekeeperd_exec:s0 tclass=file permissive=0
06-03 17:15:03.327  4047  4047 W ls      : type=1400 audit(0.0:72): avc: denied { getattr } for path="/system/bin/hostapd" dev="dm-0" ino=355 scontext=u:r:shell:s0 tcontext=u:object_r:hostapd_exec:s0 tclass=file permissive=0
06-03 17:15:03.328  4047  4047 W ls      : type=1400 audit(0.0:73): avc: denied { getattr } for path="/system/bin/init_regions.sh" dev="dm-0" ino=363 scontext=u:r:shell:s0 tcontext=u:object_r:locale_exec:s0 tclass=file permissive=0
06-03 17:15:04.848  4054  4054 W run-as  : type=1400 audit(0.0:98): avc: denied { execute } for name="gdbserver" dev="dm-2" ino=114695 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0
06-03 17:15:05.641  4072  4072 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
06-03 17:15:05.643  4072  4072 D AndroidRuntime: CheckJNI is OFF
06-03 17:15:05.662  4072  4072 D ICU     : No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
06-03 17:15:05.681  4072  4072 I Radio-JNI: register_android_hardware_Radio DONE
06-03 17:15:05.694  4072  4072 D AndroidRuntime: Calling main entry com.android.commands.am.Am
06-03 17:15:05.695   530   661 I ActivityManager: Force stopping Ashkolsum.v appid=10080 user=0: from pid 4072
06-03 17:15:05.695   530   661 I ActivityManager: Killing 4022:Ashkolsum.v/u0a80 (adj 0): stop Ashkolsum.v
06-03 17:15:05.706  4081  4081 I art     : Late-enabling -Xcheck:jni
06-03 17:15:05.711   530   661 I ActivityManager: Start proc 4081:Ashkolsum.v/u0a80 for activity Ashkolsum.v/android.app.NativeActivity
06-03 17:15:05.712   530   661 I ActivityManager:   Force finishing activity ActivityRecord{71053f6 u0 Ashkolsum.v/android.app.NativeActivity t6}
06-03 17:15:05.714  4072  4072 D AndroidRuntime: Shutting down VM
06-03 17:15:05.715   530  2440 W ActivityManager: Spurious death for ProcessRecord{d5ee47e 0:Ashkolsum.v/u0a80}, curProc for 4022: null
06-03 17:15:05.738  3511  3511 W Settings: Setting bugreport_in_power_menu has moved from android.provider.Settings.Secure to android.provider.Settings.Global.
06-03 17:15:05.762   530  1160 W InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@54b692e attribute=null, token = android.os.BinderProxy@d919f4c
06-03 17:15:05.930   530   548 W AppOps  : Finishing op nesting under-run: uid 1000 pkg android code 24 time=0 duration=0 nesting=0
06-03 17:16:02.435  1242  1380 E ctxmgr  : [BaseServerTask]Failed network request due to no network connectivity.
06-03 17:16:02.436  1242  1380 E ctxmgr  : [BaseServerTask]Failed network request due to no network connectivity.
06-03 17:16:02.436  1242  1380 E ctxmgr  : [SyncServerInterestRecordsOperation]Failure response from WriteInterestRecord. StatusCode = 1
06-03 17:16:02.447  1242  1380 W ctxmgr  : [DeviceRegistrationSync]Failed device registration sync (statusCode=NO_NETWORK_CONNECTIVITY).  Giving up.

log.txt (9.76 KB)

Well, this is unrelated to the above but still. If I create an Android application with the wizard (java only) on Pixel C and Shield TV:

External Media
log-PixelC.txt (11 KB)
log-ShieldTV.txt (124 KB)

Hi Zimgam,

From the logcat log, It seems caused by SELinux policy enforced on that device:
06-03 17:15:04.848 4054 4054 W run-as : type=1400 audit(0.0:98): avc: denied { execute } for name=“gdbserver” dev=“dm-2” ino=114695 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0

could you try disable SELinux enforcement via “adb shell setenforce 0”?

If it’s still occuring, please send us the log of Nsight Tegra at %APPDATA%NVIDIA Corporation\Nsight Tegra\Logs\Nsight Tegra.log and device OS info via adb shell getprop ?

Hello, Victor,

Thank you for your advice. I tried what you told me but I probably need to root the device. So I prefer to wait for the Android N to try then.

It appears to be a problem with Pixel C’s Android. Debugging is not possible even with Google’s Android Studio and LLDB, so I filed a bug report.

I am currently only researching Android/Shield as a second tier target platform for our product after we finish our main target platforms later this year. I hope that the tools/Android will be in much better shape when we start porting to Shield and probably Vulkan on Shield too.

Does my issue have anything in common with this issue: [url]https://github.com/android-ndk/ndk/issues/118[/url]

Hi Zingam,
Could you send me your log? Just from the error message, it seems to be caused by access provilidge issue like the link you mentioned.

Victor

This is a problem with Pixel C and was fixed in Android N. Now all debugging on Pixel C with Android N is functional. Java debugging still does not work on SHIELD TV as the bug in 6.0.1 is ART related and Google won’t fix it for API 23.

Now I just hope that you’ll release an update to Android N for SHIELD TV soon and Nsight Tegra with NDK 12/13 as soon as possible.
I couldn’t get Nsight Tegra to work with NDK 12. So I just hope we won’t need to wait for support that long after new NDK is released.

This is the bug if you are interested: Google Issue Tracker

Thank you very much, Victor!

NDK-r12b support would be in the next release, Please be patient.