Bug 18331 - Gdb target fails to build in release mode
Summary: Gdb target fails to build in release mode
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.12.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2014-03-12 18:57 UTC by Peter Collins
Modified: 2017-07-06 19:36 UTC (History)
3 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 Peter Collins 2014-03-12 18:57:04 UTC
I was fairly sure that the _Gdb target was valid for Release configurations, however the Gdb target is failing for me with  the standard release configuration.

Diagnostic Output:
https://gist.github.com/pjcollins/33955f2dfd0bf2ea1c68


Environment:
Dell Venue 8 (x86) v4.3

=== Xamarin Studio ===
Version 4.2.3 (build 59)
Installation UUID: 3e169c17-4a09-4d8a-be87-938005114683
Runtime:
	Mono 3.2.6 ((no/9b58377)
	GTK+ 2.24.23 theme: Raleigh
	GTK# (2.12.0.0)
	Package version: 302060000

=== Apple Developer Tools ===
Xcode 5.1 (5084)
Build 5B130a

=== Xamarin.iOS ===
Version: 7.2.0.2 (Business Edition)
Hash: 58c3efa
Branch: 
Build date: 2014-10-03 18:02:26-0400

=== Xamarin.Android ===
Version: 4.12.1 (Starter Edition)
Android SDK: /Users/petercollins/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		1.6   (API level 4)
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

=== Build Information ===
Release ID: 402030059
Git revision: 828c2a91b515daaac7e57bc69fcfda6178d4ec01
Build date: 2014-02-18 18:05:23+0000
Xamarin addins: 3bdcc713bdc4b0c04973f3a31b6d47ad3e205962

=== Operating System ===
Mac OS X 10.9.2
Darwin dynamic-027.bos.xamarin.com 13.1.0 Darwin Kernel Version 13.1.0
    Thu Jan 16 19:40:37 PST 2014
    root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64
Comment 1 Udham Singh 2014-03-14 06:45:25 UTC
I have checked this issue and tried to reproduce it. For me when I build application in release mode Gdb target fails but the error which I got is seems quite different from the error mentioned into the bug description.
 
Diagnostic Output: https://gist.github.com/saurabh360/669d6856213322d7cec1

Environment Info:

=== Xamarin Studio ===

Version 4.2.3 (build 59)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
	Mono 3.2.7 ((no/40f92d5)
	GTK+ 2.24.23 theme: Raleigh
	GTK# (2.12.0.0)
	Package version: 302070000

=== Apple Developer Tools ===

Xcode 4.6.2 (2067.2)
Build 4H1003

=== Xamarin.iOS ===

Version: 7.2.0.2 (Business Edition)
Hash: 58c3efa
Branch: 
Build date: 2014-10-03 18:02:26-0400

=== Xamarin.Android ===

Version: 4.12.1 (Business Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Build Information ===

Release ID: 402030059
Git revision: 828c2a91b515daaac7e57bc69fcfda6178d4ec01
Build date: 2014-02-18 18:05:23+0000
Xamarin addins: 3bdcc713bdc4b0c04973f3a31b6d47ad3e205962

=== Operating System ===

Mac OS X 10.9.2
Darwin MacMini.local 13.1.0 Darwin Kernel Version 13.1.0
    Thu Jan 16 19:40:37 PST 2014
    root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64


Note: I have checked it on both XS 4.2.3 (build 60) and XS 4.2.3 (build 59) and got the same issue.
Comment 2 Jonathan Pryor 2014-03-14 09:48:18 UTC
I investigated making it work for Release builds as part of Bug #14050, making _Gdb work for Release builds is "difficult":

https://bugzilla.xamarin.com/show_bug.cgi?id=14050#c7

So much so that I documented it (wow!):

http://docs.xamarin.com/guides/android/advanced_topics/gdb/#Release_Builds

It's difficult because Release apps don't have a Seppuku task (so no reliable kill + restart on pre-JB targets), and they don't create a .__override__ directory (though setting debug.mono.profile could serve as a workaround; why didn't I think of that before?), and without the .__override__ directory there's no easy way to get gdbserver on-device w/o including it in the .apk in the first place.

I suppose we could make it a JB+ feature (Android JB+ provides a reliable way to kill processes via `adb shell am force-stop`), set debug.mono.profile, and then we can ensure that .__override__ exists and continue as normal.

I'd rather wait on that until the profiler actually works. Setting debug.mono.profile is used to enable the profiler, which (at present) is a flaky proposition at best.
Comment 3 Cody Beyer (MSFT) 2017-07-06 19:36:01 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Android. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.