GDBserver Failed to start after update to Nsight Tegra 3.3

Just installed latest Nsight Tegra v3.3 and now I get “can not launch gdbserver: all options failed”

It was working fine with Nsight v1.4. Heres the log.

06-21 09:36:34.426 6946 6946 D AndroidRuntime: Calling main entry com.android.commands.am.Am
06-21 09:36:34.323 6946 6946 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
06-21 09:36:34.326 6946 6946 D AndroidRuntime: CheckJNI is ON
06-21 09:36:34.400 6946 6946 E PointerIcon: mRotation = 0
06-21 09:36:34.428 3129 3527 I ActivityManager: Force stopping data.dev.zxspectrum appid=10089 user=0: from pid 6946
06-21 09:36:34.429 6946 6946 D AndroidRuntime: Shutting down VM
06-21 09:36:34.851 6959 6959 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
06-21 09:36:34.854 6959 6959 D AndroidRuntime: CheckJNI is ON
06-21 09:36:34.928 6959 6959 E PointerIcon: mRotation = 0
06-21 09:36:34.953 6959 6959 D AndroidRuntime: Calling main entry com.android.commands.am.Am
06-21 09:36:34.958 3129 3511 I ActivityManager: Force stopping data.dev.zxspectrum appid=10089 user=-1: set debug app
06-21 09:36:34.958 3129 3511 I ActivityManager: START u0 {flg=0x10000000 cmp=data.dev.zxspectrum/android.app.NativeActivity} from uid 0 on display 0
06-21 09:36:34.958 3129 3511 V WindowManager: addAppToken: AppWindowToken{21b1b90d token=Token{3cd997a4 ActivityRecord{a080637 u0 data.dev.zxspectrum/android.app.NativeActivity t163}}} to stack=1 task=163 at 0
06-21 09:36:34.961 6959 6959 D AndroidRuntime: Shutting down VM
06-21 09:36:34.962 3129 3178 V WindowManager: Adding window Window{34cced3 u0 Starting data.dev.zxspectrum} at 2 of 8 (after Window{3701891c u0 com.android.launcher/com.android.launcher2.Launcher})
06-21 09:36:34.985 6972 6972 I art : Not late-enabling -Xcheck:jni (already on)
06-21 09:36:34.987 3129 3550 I ActivityManager: Start proc 6972:data.dev.zxspectrum/u0a89 for activity data.dev.zxspectrum/android.app.NativeActivity
06-21 09:36:35.009 6972 6972 W ActivityThread: Application data.dev.zxspectrum is waiting for the debugger on port 8100…
06-21 09:36:35.011 6972 6972 I System.out: Sending WAIT chunk
06-21 09:36:35.051 3129 3271 I OpenGLRenderer: Initialized EGL, version 1.4
06-21 09:36:36.133 7078 7078 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
06-21 09:36:36.135 7078 7078 D AndroidRuntime: CheckJNI is ON
06-21 09:36:36.206 7078 7078 E PointerIcon: mRotation = 0
06-21 09:36:36.231 7078 7078 D AndroidRuntime: Calling main entry com.android.commands.am.Am
06-21 09:36:36.233 3129 3527 I ActivityManager: Force stopping data.dev.zxspectrum appid=10089 user=0: from pid 7078
06-21 09:36:36.233 3129 3527 I ActivityManager: Killing 6972:data.dev.zxspectrum/u0a89 (adj 0): stop data.dev.zxspectrum
06-21 09:36:36.338 3129 3527 I ActivityManager: Force finishing activity 3 ActivityRecord{a080637 u0 data.dev.zxspectrum/android.app.NativeActivity t163}
06-21 09:36:36.345 3129 3249 W ActivityManager: Spurious death for ProcessRecord{22b3e76c 6972:data.dev.zxspectrum/u0a89}, curProc for 6972: null
06-21 09:36:36.345 7078 7078 D AndroidRuntime: Shutting down VM
06-21 09:36:36.360 3129 3173 E WindowState: getStack: Window{34cced3 u0 Starting data.dev.zxspectrum} couldn’t find taskId=163 Callers=com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLockedInner:9767 com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLockedLoop:8806 com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLocked:8748 com.android.server.wm.WindowManagerService.executeAppTransition:4168
06-21 09:36:36.361 3129 3173 E WindowState: getStack: Window{34cced3 u0 Starting data.dev.zxspectrum} couldn’t find taskId=163 Callers=com.android.server.wm.WindowState.getDisplayContent:782 com.android.server.wm.WindowStateAnimator.updateSurfaceWindowCrop:1290 com.android.server.wm.WindowStateAnimator.setSurfaceBoundariesLocked:1465 com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLockedInner:9855
06-21 09:36:36.361 3129 3173 E WindowState: getStack: Window{34cced3 u0 Starting data.dev.zxspectrum} couldn’t find taskId=163 Callers=com.android.server.wm.WindowState.getDisplayContent:782 com.android.server.wm.WindowState.isDefaultDisplay:1286 com.android.server.wm.WindowStateAnimator.updateSurfaceWindowCrop:1300 com.android.server.wm.WindowStateAnimator.setSurfaceBoundariesLocked:1465
06-21 09:36:36.362 3129 3173 E WindowState: getStack: Window{34cced3 u0 Starting data.dev.zxspectrum} couldn’t find taskId=163 Callers=com.android.server.wm.WindowState.getDisplayContent:782 com.android.server.wm.WindowState.getDisplayId:787 com.android.server.wm.InputMonitor.updateInputWindowsLw:294 com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLockedInner:10106
06-21 09:36:36.366 3129 3173 E WindowState: getStack: Window{34cced3 u0 Starting data.dev.zxspectrum} couldn’t find taskId=163 Callers=com.android.server.wm.DisplayContent.setTouchExcludeRegion:237 com.android.server.wm.WindowManagerService.setFocusedStackFrame:4011 com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLockedInner:10182 com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLockedLoop:8806
06-21 09:36:36.368 3129 3178 E WindowState: getStack: Window{34cced3 u0 Starting data.dev.zxspectrum} couldn’t find taskId=163 Callers=com.android.server.wm.WindowState.getDisplayContent:782 com.android.server.wm.WindowState.getWindowList:1354 com.android.server.wm.WindowManagerService.removeWindowInnerLocked:2791 com.android.server.wm.WindowManagerService.removeWindowLocked:2692
06-21 09:36:36.368 3129 3178 E WindowState: getStack: Window{34cced3 u0 Starting data.dev.zxspectrum} couldn’t find taskId=163 Callers=com.android.server.wm.WindowState.getDisplayContent:782 com.android.server.wm.WindowManagerService.removeWindowInnerLocked:2796 com.android.server.wm.WindowManagerService.removeWindowLocked:2692 com.android.server.wm.WindowManagerService.removeWindow:2614
06-21 09:36:36.377 3129 3511 W InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@38ae0e58 attribute=null, token = android.os.BinderProxy@362b728f
06-21 09:36:36.898 3551 3681 W OpenGLRenderer: Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer…

Also just found this in a log file …

2016-06-21 10:01:59.4166|INFO|Nvidia.PentaK.Utilities.RedirProcess|20-exited: code 0, finished in 47 ms
2016-06-21 10:01:59.4166|INFO|Nvidia.PentaK.Utilities.RedirProcess|21-launch: E:\Our_Files\android\android-sdk-windows\platform-tools\adb.exe “-s HKC213254DFD1A85 push “E:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 10.0\COMMON7\IDE\EXTENSIONS\NVIDIA\NSIGHT TEGRA\3.3\Debuggers\arm\gdbserver” “/data/local/tmp/gdbserver”” [E:\Our_Files\android\android-sdk-windows\platform-tools]
2016-06-21 10:01:59.6038|INFO|Nvidia.PentaK.Utilities.RedirProcess|21-stdout:

2016-06-21 10:01:59.6038|INFO|Nvidia.PentaK.Utilities.RedirProcess|21-stderr:
6607 KB/s (1161108 bytes in 0.171s)

2016-06-21 10:01:59.6038|INFO|Nvidia.PentaK.Utilities.RedirProcess|21-exited: code 0, finished in 187 ms
2016-06-21 10:01:59.6038|INFO|Nvidia.PentaK.Utilities.RedirProcess|22-launch: E:\Our_Files\android\android-sdk-windows\platform-tools\adb.exe “-s HKC213254DFD1A85 shell chmod 777 /data/local/tmp/gdbserver” [E:\Our_Files\android\android-sdk-windows\platform-tools]
2016-06-21 10:01:59.6350|INFO|Nvidia.PentaK.Utilities.RedirProcess|22-stderr:

2016-06-21 10:01:59.6350|INFO|Nvidia.PentaK.Utilities.RedirProcess|22-stdout:

2016-06-21 10:01:59.6350|INFO|Nvidia.PentaK.Utilities.RedirProcess|22-exited: code 0, finished in 32 ms
2016-06-21 10:01:59.6350|INFO|Nvidia.PentaK.Target.Android.AndroidDebuggingStrategy|Trying /data/local/tmp/gdbserver
2016-06-21 10:01:59.6506|WARN|Nvidia.PentaK.Target.Android.AndroidDebuggingStrategy|Failed: Process exited with code 0
2016-06-21 10:01:59.6506|INFO|Nvidia.PentaK.Utilities.RedirProcess|23-launch: E:\Our_Files\android\android-sdk-windows\platform-tools\adb.exe “-s HKC213254DFD1A85 shell su -c cp /data/local/tmp/gdbserver /data/data/data.dev.zxspectrum/gdbserver” [E:\Our_Files\android\android-sdk-windows\platform-tools]
2016-06-21 10:01:59.6818|INFO|Nvidia.PentaK.Utilities.RedirProcess|23-stderr:

2016-06-21 10:01:59.6818|INFO|Nvidia.PentaK.Utilities.RedirProcess|23-stdout:
Unknown id: /data/local/tmp/gdbserver

2016-06-21 10:01:59.6818|INFO|Nvidia.PentaK.Utilities.RedirProcess|23-exited: code 0, finished in 31 ms
2016-06-21 10:01:59.6818|INFO|Nvidia.PentaK.Utilities.RedirProcess|24-launch: E:\Our_Files\android\android-sdk-windows\platform-tools\adb.exe “-s HKC213254DFD1A85 shell su -c chmod 777 /data/data/data.dev.zxspectrum/gdbserver” [E:\Our_Files\android\android-sdk-windows\platform-tools]
2016-06-21 10:01:59.7130|INFO|Nvidia.PentaK.Utilities.RedirProcess|24-stdout:
Usage: chmod [OPTION]
-R, --recursive change files and directories recursively
–help display this help and exit

2016-06-21 10:01:59.7130|INFO|Nvidia.PentaK.Utilities.RedirProcess|24-stderr:

2016-06-21 10:01:59.7130|INFO|Nvidia.PentaK.Utilities.RedirProcess|24-exited: code 0, finished in 32 ms
2016-06-21 10:01:59.7130|INFO|Nvidia.PentaK.Target.Android.AndroidDebuggingStrategy|Trying /data/data/data.dev.zxspectrum/gdbserver
2016-06-21 10:01:59.7442|INFO|Nvidia.PentaK.Target.Android.Tools.GdbServer|[GDBSERVER] stdout: Unknown id: :2020
2016-06-21 10:01:59.7442|WARN|Nvidia.PentaK.Target.Android.AndroidDebuggingStrategy|Failed: Unknown id: :2020
2016-06-21 10:01:59.7442|INFO|Nvidia.PentaK.Utilities.RedirProcess|25-launch: E:\Our_Files\android\android-sdk-windows\platform-tools\adb.exe “-s HKC213254DFD1A85 shell cat /data/local/tmp/gdbserver | run-as data.dev.zxspectrum sh -c ‘cat > /data/data/data.dev.zxspectrum/gdbserver’” [E:\Our_Files\android\android-sdk-windows\platform-tools]
2016-06-21 10:01:59.7754|INFO|Nvidia.PentaK.Utilities.RedirProcess|25-stdout:

2016-06-21 10:01:59.7754|INFO|Nvidia.PentaK.Utilities.RedirProcess|25-stderr:

2016-06-21 10:01:59.7754|INFO|Nvidia.PentaK.Utilities.RedirProcess|25-exited: code 0, finished in 31 ms
2016-06-21 10:01:59.7754|INFO|Nvidia.PentaK.Utilities.RedirProcess|26-launch: E:\Our_Files\android\android-sdk-windows\platform-tools\adb.exe “-s HKC213254DFD1A85 shell su -c chmod 777 /data/data/data.dev.zxspectrum/gdbserver” [E:\Our_Files\android\android-sdk-windows\platform-tools]
2016-06-21 10:01:59.8066|INFO|Nvidia.PentaK.Utilities.RedirProcess|26-stdout:
Usage: chmod [OPTION]
-R, --recursive change files and directories recursively
–help display this help and exit

2016-06-21 10:01:59.8066|INFO|Nvidia.PentaK.Utilities.RedirProcess|26-stderr:

2016-06-21 10:01:59.8066|INFO|Nvidia.PentaK.Utilities.RedirProcess|26-exited: code 0, finished in 31 ms
2016-06-21 10:01:59.8066|INFO|Nvidia.PentaK.Target.Android.AndroidDebuggingStrategy|Trying /data/data/data.dev.zxspectrum/gdbserver
2016-06-21 10:01:59.8222|INFO|Nvidia.PentaK.Target.Android.Tools.GdbServer|[GDBSERVER] stdout: Unknown id: :2020
2016-06-21 10:01:59.8222|WARN|Nvidia.PentaK.Target.Android.AndroidDebuggingStrategy|Failed: Unknown id: :2020
2016-06-21 10:01:59.8222|INFO|Nvidia.PentaK.Target.Android.AndroidDebuggingStrategy|Trying /data/data/data.dev.zxspectrum/lib/gdbserver
2016-06-21 10:01:59.8534|INFO|Nvidia.PentaK.Target.Android.Tools.GdbServer|[GDBSERVER] stdout: Unknown id: :2020
2016-06-21 10:01:59.8534|WARN|Nvidia.PentaK.Target.Android.AndroidDebuggingStrategy|Failed: Unknown id: :2020
2016-06-21 10:01:59.8534|WARN|Nvidia.PentaK.Target.Android.AndroidDebuggingStrategy|All options have failed
2016-06-21 10:01:59.8534|INFO|Nvidia.PentaK.Utilities.RedirProcess|27-launch: E:\Our_Files\android\android-sdk-windows\platform-tools\adb.exe “-s HKC213254DFD1A85 shell am force-stop data.dev.zxspectrum” [E:\Our_Files\android\android-sdk-windows\platform-tools]
2016-06-21 10:01:59.8534|INFO|Nvidia.PentaK.PentaKPackage|[PentaKPackage] Mode changed to DBGMODE_Design
2016-06-21 10:02:00.4774|INFO|Nvidia.PentaK.Utilities.RedirProcess|27-stdout:

2016-06-21 10:02:00.4774|INFO|Nvidia.PentaK.Utilities.RedirProcess|27-stderr:

2016-06-21 10:02:00.4774|INFO|Nvidia.PentaK.Utilities.RedirProcess|27-exited: code 0, finished in 624 ms
2016-06-21 10:02:01.8424|INFO|Nvidia.PentaK.Utilities.RedirProcess|18-canceled: was running for 2590 ms
2016-06-21 10:02:01.8424|INFO|Nvidia.PentaK.Utilities.RedirProcess|17-canceled: was running for 2590 ms
2016-06-21 10:02:01.8424|INFO|Nvidia.PentaK.Utilities.RedirProcess|12-canceled: was running for 4087 ms
2016-06-21 10:02:01.8424|INFO|Nvidia.PentaK.Utilities.RedirProcess|16-canceled: was running for 2590 ms
2016-06-21 10:02:01.8424|INFO|Nvidia.PentaK.Utilities.RedirProcess|11-canceled: was running for 4618 ms

Hi RichUK,

What devices and OS Images do you use? It seems an issue we have fixed in Our Dev branch.

Victor

Hi Victor,
The devices are both ODROID Rooted

Device 1 is a X2 with Android 4.4
http://www.hardkernel.com/main/products/prdt_info.php?g_code=G135235611947
Device 2 is a C2 with Android 5.1
http://www.hardkernel.com/main/products/prdt_info.php?g_code=G145457216438

Since starting the thread I have tried several different versions of Nsight tegra and got some interesting results.

v1.4 - Working fine on X2, but failed on the C2 (unable to set break points)
v1.51 - Same as 1.4 above
v2.0 - Failed to build project (Compile: header errors)
v2.2 - Working on both X2 and C2
v3.1 - Failed on both Invalid ELF header.
v3.2 - Failed on both “Unable to Attach to Debugger”
v3.3 - As 3.2 above.

the log above is from the 3.3 latest.

So Im now using v2.2 as it works.

Hi RichUK,

Thank you for your patient triage on it.
The vendor has customized OS image which caused some shell cmd execution failure.
2016-06-21 10:01:59.7754|INFO|Nvidia.PentaK.Utilities.RedirProcess|26-launch:[b] E:\Our_Files\android\android-[b]sdk-windows\platform-tools\adb.exe “-s HKC213254DFD1A85 shell su -c chmod 777 /data/data/data.dev.zxspectrum/gdbserver” [E:\Our_Files\android\android-sdk-windows\platform-tools]
2016-06-21 10:01:59.8066|INFO|Nvidia.PentaK.Utilities.RedirProcess|26-stdout:
Usage: chmod [OPTION]
-R, --recursive change files and directories recursively

[/b]
We don’t have these devices. As it is rooted, you rename the old cmd and make a wrapper as a workaround.
If you could provide us the repro samples, we can fix it.

Victor