Bug 12266 - Activity is closed on certain breakpoints on the Samsung Galaxy S 4 with API 14+.
Summary: Activity is closed on certain breakpoints on the Samsung Galaxy S 4 with API ...
Status: RESOLVED DUPLICATE of bug 12650
Alias: None
Product: Android
Classification: Xamarin
Component: Debugger ()
Version: 4.6.x
Hardware: Macintosh Mac OS
: High normal
Target Milestone: ---
Assignee: Radek Doulik
URL:
Depends on:
Blocks:
 
Reported: 2013-05-16 11:05 UTC by kissling
Modified: 2013-07-31 17:31 UTC (History)
3 users (show)

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


Attachments
Sample project where the described issue occurs. (5.59 KB, application/zip)
2013-05-16 11:05 UTC, kissling
Details


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 DUPLICATE of bug 12650

Description kissling 2013-05-16 11:05:46 UTC
Created attachment 3976 [details]
Sample project where the described issue occurs.

When using breakpoints on apps deployed to a Samsung Galaxy S 4 with Android 4.2.2, 
the debugger connection is canceled, and the activity is closed. Other activities of
the app continue to run. This only occurs when the Target framework is set to Ice
Cream Sandwich (4.0.0 - API 14) or newer, and only on the Samsung Galaxy S 4.
I have also tested on a Nexus device with 4.2.2, a HTC One with 4.1.2, and a Motorola 
Razr HD (non-US) with 4.1.2. Breakpoints work fine on all of those devices.
Both 4.6.x and 4.7.x versions of Xamarin.Android are affected.

I have attached a minimal app which causes the bug on the Galaxy S 4. To test it,
- Unzip and load the *.sln file in Xamarin Studio
- Open the MainActivity.cs file.
- Set a breakpoint at the beginning of all three methods (lines 12, 21, and 28).
- Deploy the app to a Samsung Galaxy S 4 with Android 4.2.2 and start in debug mode.
- The OnCreate breakpoint should fire, select "Continue Execution".
- The OnCreateOptionsMenu breakpoint should fire, select "Continue Execution".

Now, either
- select the menu button and choose "test entry" on the Galaxy S 4. This will cause
  the breakpoint in OnOptionsItemSelected to crash the app.
OR
- rotate the Galaxy S 4 into landscape mode. This will cause the breakpoint in OnCreate
  to crash the app.

In both cases, when the breakpoints are removed, or when the Target framework is lowered
below Ice Cream Sandwich, the issue does not occur.

Note that when you turn the device after the OnCreate breakpoint is first hit, but prior
to "Continue Execution", the second "OnCreate" works fine. However, as soon as the app
is up and running, the next breakpoint in either "OnCreate" or "OnOptionsItemSelected"
will end the activity and close the debugger connection.
If other activities are open in the app, they continue to run.
Comment 1 kissling 2013-05-16 11:14:52 UTC
Xamarin Studio's "Application Output" logs

[GestureDetector] [Surface Touch Event] mSweepDown False, mLRSDCnt : -1 mTouchCnt : 5 mFalseSizeCnt:0
[mono-rt] Stacktrace:
[mono-rt] 
[mono-rt] 
[mono-rt] =================================================================
[mono-rt] Got a SIGSEGV while executing native code. This usually indicates
[mono-rt] a fatal error in the mono runtime or one of the native libraries 
[mono-rt] used by your application.
[mono-rt] =================================================================
[mono-rt]

when the breakpoint is enabled in OnOptionsItemSelected, and

[GestureDetector] [Surface Touch Event] mSweepDown False, mLRSDCnt : -1 mTouchCnt : 5 mFalseSizeCnt:0
[AbsListView] onDetachedFromWindow
[AbsListView] unregisterIRListener() is called 
[ViewRootImpl] sendUserActionEvent() mView == null

when it is disabled.
Comment 2 Ken Lavigne 2013-06-01 12:44:39 UTC
I have also experienced the same thing on my S4 when I had the target framework set to 2.2, and 2.3. For me, it doesn't seem to matter where the breakpoint is set. I stopped trying different frameworks after that and went back to my old phone (a Samsung Infuse 2.3) and everything works as expected.
Comment 3 Radek Doulik 2013-07-31 17:31:10 UTC
Please look at #12650 for workarounds.

*** This bug has been marked as a duplicate of bug 12650 ***