Bug 3040 - Debugger no longer works after upgrading to 5.2
Summary: Debugger no longer works after upgrading to 5.2
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Mikayla Hutchinson [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2012-01-24 13:31 UTC by Jackson Harper
Modified: 2012-01-26 16:43 UTC (History)
7 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Jackson Harper 2012-01-24 13:31:15 UTC
Since upgrading to MT 5.2 and MD 2.8.6.3 the debugger starts but disconnects as soon as the app starts.

Error Dialog:
The connection with the debugger has been lost. The target application may have exited.


Application Output:
2012-01-24 13:24:44.240 eDictate[13445:1903] MonoTouch: Successfully received USB connection from MonoDevelop on port 10000, fd: 7
2012-01-24 13:24:44.242 eDictate[13445:1903] MonoTouch: Processing: 'start profiler: no'


Console output from xcode:
Jan 24 13:29:31 unknown mobile_storage_proxy[13502] <Error>: handle_lookup_image: Entry 2 of 4 does not have a disk image type
Jan 24 13:29:31 unknown MobileStorageMounter[13503] <Notice>: (0x3f88fce8) verify_dimage_mount_path: /Developer is not empty
Jan 24 13:29:31 unknown MobileStorageMounter[13503] <Notice>: (0x3f88fce8) perform_disk_image_mount: Could not verify the disk image mount path
Jan 24 13:29:31 unknown MobileStorageMounter[13503] <Notice>: (0x3f88fce8) handle_mount_disk_image: The disk image failed to verify and mount
Jan 24 13:29:31 unknown MobileStorageMounter[13503] <Notice>: (0x3f88fce8) handle_mount_disk_image: The disk image could not be verified
Jan 24 13:29:31 unknown mobile_storage_proxy[13502] <Notice>: (0x3f88fce8) MobileStorageMount: Could not extract mount path from response message
Jan 24 13:29:31 unknown mobile_storage_proxy[13502] <Error>: handle_mount_image: Could not mount the disk image
Jan 24 13:29:31 unknown mobile_storage_proxy[13502] <Error>: main: Could not mount the image
Jan 24 13:29:32 unknown com.apple.debugserver-64[13508] <Warning>: debugserver-64 for armv6 Copyright (c) 2007-2009 Apple, Inc.  All Rights Reserved.
Jan 24 13:29:32 unknown com.apple.debugserver-64[13508] <Warning>: Connecting to com.apple.debugserver service...
Jan 24 13:29:32 unknown kernel[0] <Debug>: lockbot[13501] Builtin profile: debugserver (sandbox)
Jan 24 13:29:32 unknown mobile_storage_proxy[13509] <Error>: handle_lookup_image: Entry 2 of 4 does not have a disk image type
Jan 24 13:29:33 unknown MobileStorageMounter[13503] <Notice>: (0x3f88fce8) verify_dimage_mount_path: /Developer is not empty
Jan 24 13:29:33 unknown MobileStorageMounter[13503] <Notice>: (0x3f88fce8) perform_disk_image_mount: Could not verify the disk image mount path
Jan 24 13:29:33 unknown MobileStorageMounter[13503] <Notice>: (0x3f88fce8) handle_mount_disk_image: The disk image failed to verify and mount
Jan 24 13:29:33 unknown MobileStorageMounter[13503] <Notice>: (0x3f88fce8) handle_mount_disk_image: The disk image could not be verified
Jan 24 13:29:33 unknown mobile_storage_proxy[13509] <Notice>: (0x3f88fce8) MobileStorageMount: Could not extract mount path from response message
Jan 24 13:29:33 unknown mobile_storage_proxy[13509] <Error>: handle_mount_image: Could not mount the disk image
Jan 24 13:29:33 unknown mobile_storage_proxy[13509] <Error>: main: Could not mount the image
Jan 24 13:29:33 unknown mobile_storage_proxy[13513] <Error>: handle_lookup_image: Entry 2 of 4 does not have a disk image type
Jan 24 13:29:33 unknown MobileStorageMounter[13503] <Notice>: (0x3f88fce8) verify_dimage_mount_path: /Developer is not empty
Jan 24 13:29:33 unknown MobileStorageMounter[13503] <Notice>: (0x3f88fce8) perform_disk_image_mount: Could not verify the disk image mount path
Jan 24 13:29:33 unknown MobileStorageMounter[13503] <Notice>: (0x3f88fce8) handle_mount_disk_image: The disk image failed to verify and mount
Jan 24 13:29:33 unknown MobileStorageMounter[13503] <Notice>: (0x3f88fce8) handle_mount_disk_image: The disk image could not be verified
Jan 24 13:29:33 unknown mobile_storage_proxy[13513] <Notice>: (0x3f88fce8) MobileStorageMount: Could not extract mount path from response message
Jan 24 13:29:33 unknown mobile_storage_proxy[13513] <Error>: handle_mount_image: Could not mount the disk image
Jan 24 13:29:33 unknown mobile_storage_proxy[13513] <Error>: main: Could not mount the image
Jan 24 13:29:33 unknown com.apple.debugserver-64[13515] <Warning>: debugserver-64 for armv6 Copyright (c) 2007-2009 Apple, Inc.  All Rights Reserved.
Jan 24 13:29:33 unknown com.apple.debugserver-64[13515] <Warning>: Connecting to com.apple.debugserver service...
Jan 24 13:29:33 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:com.entradahealth.edictate-beta[0xb308]) Spawned and waiting for the debugger to attach before continuing...
Jan 24 13:29:34 unknown com.apple.debugserver-64[13515] <Warning>: 1 [34cb/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 13516, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Jan 24 13:29:34 unknown com.apple.debugserver-64[13515] <Warning>: 2 [34cb/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 13516, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Jan 24 13:29:34 unknown com.apple.debugserver-64[13515] <Warning>: 3 [34cb/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 13516, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Jan 24 13:29:34 unknown com.apple.debugserver-64[13515] <Warning>: 4 [34cb/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 13516, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Jan 24 13:29:34 unknown kernel[0] <Debug>: lockbot[13501] Builtin profile: debugserver (sandbox)
Jan 24 13:29:34 unknown kernel[0] <Debug>: launchd[13516] Builtin profile: container (sandbox)
Jan 24 13:29:34 unknown kernel[0] <Debug>: launchd[13516] Container: /private/var/mobile/Applications/1B85C872-5CC4-410B-90E2-56528BCAC91A [69] (sandbox)
Jan 24 13:29:34 unknown com.apple.debugserver-64[13515] <Warning>: 5 [34cb/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 13516, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Jan 24 13:29:34 unknown com.apple.debugserver-64[13515] <Warning>: 6 [34cb/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 13516, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Jan 24 13:29:34 unknown com.apple.debugserver-64[13515] <Warning>: 7 [34cb/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 13516, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Jan 24 13:29:34 unknown com.apple.debugserver-64[13515] <Warning>: 8 [34cb/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 13516, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Jan 24 13:29:34 unknown com.apple.debugserver-64[13515] <Warning>: 9 [34cb/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 13516, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Jan 24 13:29:34 unknown com.apple.debugserver-64[13515] <Warning>: 10 [34cb/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 13516, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Jan 24 13:29:34 unknown com.apple.debugserver-64[13515] <Error>: error: MachTask::StartExceptionThread (): task invalid, exception thread start failed.
Jan 24 13:29:34 unknown eDictate[13516] <Warning>: MonoTouch: Added IP to look for MonoDevelop: 10.0.1.15
Jan 24 13:29:34 unknown eDictate[13516] <Warning>: MonoTouch: MonoDevelop Port: 10000 Transport: USB
Jan 24 13:29:34 unknown com.apple.debugserver-64[13515] <Warning>: 11 [34cb/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 13516, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Jan 24 13:29:35 unknown eDictate[13516] <Warning>: MonoTouch: Successfully received USB connection from MonoDevelop on port 10000, fd: 5
Jan 24 13:29:35 unknown eDictate[13516] <Warning>: MonoTouch: Processing: 'start debugger: sdb'
Jan 24 13:29:35 unknown eDictate[13516] <Warning>: MonoTouch: Successfully received USB connection from MonoDevelop on port 10000, fd: 6
Jan 24 13:29:35 unknown eDictate[13516] <Warning>: MonoTouch: Debugger loaded with custom transport (fd: 5)
Jan 24 13:29:35 unknown eDictate[13516] <Warning>: MonoTouch: Processing: 'connect output'
Jan 24 13:29:35 unknown com.apple.debugserver-64[13515] <Warning>: 12 [34cb/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 13516, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Jan 24 13:29:35 unknown com.apple.debugserver-64[13515] <Warning>: 13 [34cb/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 13516, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Jan 24 13:29:35 unknown com.apple.debugserver-64[13515] <Warning>: 14 [34cb/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 13516, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Jan 24 13:29:35 unknown com.apple.debugserver-64[13515] <Warning>: 15 [34cb/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 13516, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Jan 24 13:29:35 unknown com.apple.debugserver-64[13515] <Warning>: 16 [34cb/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 13516, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Jan 24 13:29:35 unknown com.apple.debugserver-64[13515] <Warning>: 17 [34cb/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 13516, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Jan 24 13:29:35 unknown com.apple.debugserver-64[13515] <Warning>: 18 [34cb/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 13516, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Jan 24 13:29:35 unknown eDictate[13516] <Warning>: MonoTouch: Successfully received USB connection from MonoDevelop on port 10000, fd: 9
Jan 24 13:29:35 unknown eDictate[13516] <Warning>: MonoTouch: Processing: 'start profiler: no'
Jan 24 13:29:35 unknown com.apple.debugserver-64[13515] <Warning>: 19 [34cb/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 13516, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Jan 24 13:29:35 unknown com.apple.debugserver-64[13515] <Warning>: 20 [34cb/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 13516, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Jan 24 13:29:35 unknown com.apple.debugserver-64[13515] <Warning>: 21 [34cb/0303]: RNBRunLoopLaunchInferior DNBProcessLaunch() returned error: 'failed to get the task for process 13516'
Jan 24 13:29:35 unknown com.apple.debugserver-64[13515] <Warning>: error: failed to launch process (null): failed to get the task for process 13516
Jan 24 13:29:35 unknown com.apple.debugserver-64[13515] <Warning>: 22 [34cb/1303]: error: ::read ( 4, 0x2ff789d4, 1024 ) => -1 err = Bad file descriptor (0x00000009)
Jan 24 13:29:35 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.entradahealth.edictate-beta[0xb308]) Bug: launchd_core_logic.c:3730 (25147):3
Jan 24 13:29:35 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.entradahealth.edictate-beta[0xb308]) Assuming job exited: <rdar://problem/5020256>: 10: No child processes
Jan 24 13:29:35 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:com.entradahealth.edictate-beta[0xb308]) Job appears to have crashed: Segmentation fault: 11
Jan 24 13:29:35 unknown SpringBoard[15] <Warning>: Application 'eDictate4' exited abnormally with signal 11: Segmentation fault: 11
Jan 24 13:29:45 unknown mobile_installation_proxy[13511] <Error>: main: Could not receive request from host.
Jan 24 13:29:45 unknown com.apple.debugserver-64[13508] <Warning>: 1 [34c4/0303]: error: ::read ( 4, 0x2fe534b0, 1024 ) => 0 err = Bad file descriptor (0x00000009)
Jan 24 13:29:45 unknown mobile_installation_proxy[13505] <Error>: main: Could not receive request from host.
Comment 1 Jackson Harper 2012-01-24 13:53:50 UTC
Original guess was this fails because the device is setup to be a development device in xcode (hence /Developer is not empty). But I have tested on a development enabled and a development not enabled device, fails on both.
Comment 3 Rolf Bjarne Kvinge [MSFT] 2012-01-24 17:21:02 UTC
The debugger couldn't attach because the app crashed:

Jan 24 13:29:35 unknown SpringBoard[15] <Warning>: Application 'eDictate4' exited abnormally with signal 11: Segmentation fault: 11

do you have a crash log for it? Does it also crash if you run without the debugger?
Comment 4 Jackson Harper 2012-01-24 18:27:45 UTC
App runs fine without debugger and runs fine with 5.0.4's debugger.
Comment 5 Jackson Harper 2012-01-24 19:36:06 UTC
Just for reference this is what the console log looks like when starting with 5.0.4:

Jan 24 19:33:41 unknown com.apple.mobile.lockdown[21] <Notice>: receive secure message timeout!
Jan 24 19:33:43 unknown SpringBoard[15] <Notice>: Posting 'com.apple.iokit.hid.displayStatus' notifyState=1
Jan 24 19:33:43 unknown SpringBoard[15] <Notice>: MultitouchHID: detection mode: 255->0 (deferring until bootloaded)
Jan 24 19:33:43 unknown SpringBoard[15] <Notice>: MultitouchHID: device bootloaded
Jan 24 19:33:43 unknown SpringBoard[15] <Notice>: MultitouchHID: detection mode: 0->0
Jan 24 19:33:44 unknown kernel[0] <Debug>: set_crc_notification_state 0
Jan 24 19:33:48 unknown UIKitApplication:com.entradahealth.edictate-beta[0x8477][13837] <Notice>: Successfully received USB connection from MonoDevelop on port 10001.
Jan 24 19:33:49 unknown kernel[0] <Debug>: launchd[13837] Builtin profile: container (sandbox)
Jan 24 19:33:49 unknown kernel[0] <Debug>: launchd[13837] Container: /private/var/mobile/Applications/74A37A2C-7BF9-45BF-AB13-8468AEE673E8 [69] (sandbox)
Jan 24 19:34:00 unknown timed[13842] <Notice>: (Note ) CoreTime: Received time 01/25/2012 00:34:01±15.00 from "LocationServer"
Jan 24 19:34:00 unknown timed[13842] <Notice>: (Note ) CoreTime: Not setting system time to 01/25/2012 00:34:01 from NTP because time is unchanged
Jan 24 19:34:00 unknown timed[13842] <Notice>: (Note ) CoreTime: Want active time in 37.92hrs. Need active time in 121.26hrs.
Jan 24 19:34:03 unknown timed[13842] <Notice>: (Note ) CoreTime: Want active time in 37.92hrs. Need active time in 121.26hrs.
Jan 24 19:34:13 unknown timed[13842] <Notice>: (Note ) CoreTime: Not setting time zone to America/New_York from Location
Comment 6 Jackson Harper 2012-01-24 19:48:57 UTC
Just as a sanity check, here is a log debugging an obj-c app from xcode:

Jan 24 19:47:49 unknown SpringBoard[15] <Warning>: Killing entrada.test for termination assertion
Jan 24 19:47:49 unknown SpringBoard[15] <Warning>: Reloading application state for 'entrada.test' as its modification date or path has changed
Jan 24 19:47:49 unknown SpringBoard[15] <Warning>: Reloading and rendering all application icons.
Jan 24 19:47:49 unknown com.apple.debugserver-64[13907] <Warning>: debugserver-64 for armv6 Copyright (c) 2007-2009 Apple, Inc.  All Rights Reserved.
Jan 24 19:47:49 unknown com.apple.debugserver-64[13907] <Warning>: Connecting to com.apple.debugserver service...
Jan 24 19:47:50 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:entrada.test[0xb944]) Spawned and waiting for the debugger to attach before continuing...
Jan 24 19:47:50 unknown com.apple.debugserver-64[13907] <Warning>: Got a connection, waiting for debugger instructions for task "(null)".
Jan 24 19:47:50 unknown kernel[0] <Debug>: lockbot[13896] Builtin profile: debugserver (sandbox)
Jan 24 19:47:50 unknown kernel[0] <Debug>: launchd[13908] Builtin profile: container (sandbox)
Jan 24 19:47:50 unknown kernel[0] <Debug>: launchd[13908] Container: /private/var/mobile/Applications/2A8C35C9-0BCE-4E8D-9586-14828C3D73BC [69] (sandbox)
Jan 24 19:48:01 unknown test[13908] <Warning>: Received memory warning.
Comment 8 Jackson Harper 2012-01-25 10:53:30 UTC
One more piece of info: Doing "Run Item" also fails, so its probably not debugger related.
Comment 9 Jackson Harper 2012-01-25 12:03:13 UTC
I can't verify this is the actual problem right now but I think I've found the root issue and its a configuration mistake on my end.

My debug profile is setup to run with a provisioning profile that doesn't have all the permissions needed to use the new app launcher feature. FWIW, Xcode doesn't allow you to do this...or at least I can't figure out how.
Comment 10 Miguel de Icaza [MSFT] 2012-01-25 13:04:29 UTC
What Jackson shared on IRC is that it might be a provisioning profile intended for Ad-Hoc distribution vs a Development profile:

 -    <CodesignKey>iPhone Distribution</CodesignKey>
 +    <CodesignKey>iPhone Developer: FirstName LastName (6AJRF9PO5K)</CodesignKey>

Mike, perhaps something like that happened on your end?
Comment 11 Miguel de Icaza [MSFT] 2012-01-25 13:06:40 UTC
Another bit from Jackson:


<jackson> miguelx: yeah I think the provisioning profile needs <key>get-task-allow</key>

We should modify MonoDevelop to check for this
Comment 12 Mikayla Hutchinson [MSFT] 2012-01-25 13:34:36 UTC
So MD should only support launching apps on device if the app was built with such a profile? Maybe we should should also emit a warning for debuggable builds if the profile does not have that key.
Comment 13 Jackson Harper 2012-01-25 13:54:18 UTC
Another idea might be to just not let debug builds choose those profiles.
Comment 14 Miguel de Icaza [MSFT] 2012-01-25 14:51:19 UTC
Update:

The problem is that in the past we allowed Ad-Hoc or Enterprise apps to be debugged, since we do not really care about Apple's debugger.  We could debug over WiFi or USB and any provisioning profile.

Although most people use Developer Profiles, those that accidentally used Ad-Hoc or Enterprise deployment options could use our debugger.

The new Deploy-and-Run feature in Monodevelop does not work for any application requires a Development Profile to work.

We are adding support for MonoDevelop to warn the user if they use a non-development profile and fall back to the old code that said "Now tap on the app on device to start" so that we do not regress existing workflows.
Comment 15 Mikayla Hutchinson [MSFT] 2012-01-26 16:43:20 UTC
Fixed in master and 2.8.6 branch.