This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 27303 - NullReferenceException with ARMv7
Summary: NullReferenceException with ARMv7
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Mono runtime / AOT compiler (show other bugs)
Version: XI 8.6.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: (C7)
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2015-02-23 09:30 UTC by John Miller
Modified: 2016-05-17 15:26 UTC (History)
11 users (show)

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


Attachments

Description John Miller 2015-02-23 09:30:35 UTC
**Overview:**

   User reported that they are not able to step through/into code while debugging with a device. It seems that breakpoints are not being hit, when the code path where the breakpoint is should be executed. 

**Steps to Reproduce:**

   Try and debug on the device the given code in the screencast.

**Actual Results:**

   See private comments.

**Expected Results:**

   Should hit the breakpoints noted in the screencast.

**Build Date & Platform:**

   === Xamarin Studio ===

Version 5.7.1 (build 17)
Installation UUID: d01962dc-848f-4347-9ecb-3117f1cc0fc7
Runtime:
Mono 3.12.0 ((detached/de2f33f)
GTK+ 2.24.23 (Raleigh theme)

Package version: 312000076

=== Apple Developer Tools ===

Xcode 6.0.1 (6528)
Build 6A317

=== Xamarin.Android ===

Version: 4.20.0.28 (Business Edition)
Android SDK: /Users/patrick/Library/Developer/Xamarin/android-sdk-mac_x86
Supported Android versions:
2.1 (API level 7)
2.2 (API level 8)
2.3 (API level 10)
3.1 (API level 12)
4.0 (API level 14)
4.0.3 (API level 15)
4.4 (API level 19)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin.iOS ===

Version: 8.6.1.20 (Business Edition)
Hash: 3b3ef43
Branch:
Build date: 2015-01-24 09:42:21-0500

=== Xamarin.Mac ===

Not Installed

=== Build Information ===

Release ID: 507010017
Git revision: 0bc7d3550b6b088ac25b08dcf7bbe73bcc8658b3
Build date: 2015-02-03 19:43:29-05
Xamarin addins: f7b7d34419c9ec24501bfa7c658e80a6305613e0

=== Operating System ===

Mac OS X 10.10.2

**Additional Information:**

   Debugging with a simulator seems to work fine. 
   Changing the linker settings seems to affect the ability to step into the code. Only changing the settings to Link All allows the user to hit the breakpoints they expect.
Comment 2 Jeffrey Stedfast 2015-02-23 11:31:22 UTC
> Changing the linker settings seems to affect the ability to step into the
> code. Only changing the settings to Link All allows the user to hit the
> breakpoints they expect.

This makes it sound like a runtime issue and not a Xamarin Studio issue to me, but the results they are seeing with the linker seem completely backwards to me, if anything.
Comment 3 Rolf Bjarne Kvinge 2015-02-24 11:41:58 UTC
We'll need a test project for this, the screencast doesn't give me any ideas what it can be.
Comment 4 Patrick Bochud 2015-02-25 04:58:15 UTC
Please find the test project (that I sent to the support) at the following link
https://www.dropbox.com/s/2bhgea2eqg4a7yi/LinkAccountToBASimple.zip?dl=0
Comment 6 Rolf Bjarne Kvinge 2015-02-26 09:15:54 UTC
Patrick, I modified the test project as you mentioned to support (LinkAccountToBrandedApp*Async*), and this happens when I run on device (iPad Air): https://www.dropbox.com/s/iu6jnh3e8j9ykkn/Screenshot%202015-02-26%2015.04.33.png?dl=0 - this is what you expect to see, right?

If that's what you expect (but not what you see), can you take a screenshot of the Projects/Debugger preferences in Xamarin Studio? There are a few options there that may affect debugging.

Also when you hit the NullReferenceException, can you continue (which will crash), and then get the Application Output and attach it here?
Comment 7 Adam Greene 2015-04-15 10:45:17 UTC
Any word on this as I too am not having breakpoints hitting in my project in some (but not all) files.
Comment 8 Rolf Bjarne Kvinge 2015-04-15 11:16:31 UTC
@Adam, these bugs are usually very specific, and it's likely you're running into another bug that just happens to look the same, so can you file a new bug and attach your project so that we can look at it?
Comment 10 Jon Goldberger 2015-09-22 21:05:39 UTC
Making comment 6 public so the customer who reported the bug can see it. 

Here is their response to Kent having sent them the text from comment 6:
Kent:
"1. Is the screenshot from the iPad Air what you expect to see?
2. You can check the debugger settings by going to "Xamarin Studio -> preferences -> projects -> debugger", then send over that info.
3. Can you continue after hitting the NullReferenceException, and attach the application output after the crash"

Customer response:
1) no it isn't what I'm expecting to see -> the exception is in the 
caller, the body of LinkAccountToBrandedAppAsync is unreachable in my 
problem. Unreachable whatever to content of LinkAccountToBrandedAppAsync 
is. The content of LinkAccountToBrandedAppAsync could be 
System.Diagnostics.Debug.WriteLine("nice"); if you prefer.

REM: iPad Air has a M7 processor, which is a ARM64. As I said previously 
the problem occurs on ARMv7 (32 bits) and doesn't occur on ARM64.

2) see attached


3) tested on an iPad 3 (32 bits) !!

>Application output:
>[snip]
>2015-09-22 16:39:00.223 LinkAccountToBASimple[617:262689] Unhandled 
>managed exception:
>Object reference not set to an instance of an object 
>(System.NullReferenceException)
>at 
>LinkAccountToBASimple.LinkAccountToBASimpleViewController.ViewDidLoad () 
>[0x0001f] in 
>/Users/patrick/Work/Dartfish/LinkAccountToBASimple/LinkAccountToBASimple/LinkAccountToBASimpleViewController.cs:38 
>
>at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain 
>(int,string[],intptr,intptr)
>at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, 
>IntPtr delegate) [0x00005] in 
>/Users/builder/data/lanes/2077/d230615b/source/maccore/src/UIKit/UIApplication.cs:74 
>
>at UIKit.UIApplication.Main (System.String[] args, System.String 
>principalClassName, System.String delegateClassName) [0x0001c] in 
>/Users/builder/data/lanes/2077/d230615b/source/maccore/src/UIKit/UIApplication.cs:57 
>
>at LinkAccountToBASimple.Application.Main (System.String[] args) 
>[0x00008] in 
>/Users/patrick/Work/Dartfish/LinkAccountToBASimple/LinkAccountToBASimple/Main.cs:17 
>
>2015-09-22 16:39:00.224 LinkAccountToBASimple[617:262689] critical: 
>Stacktrace:
>
>2015-09-22 16:39:00.224 LinkAccountToBASimple[617:262689] critical:
>Native stacktrace:
>
>2015-09-22 16:39:02.364 LinkAccountToBASimple[617:262689] critical: 
>0 LinkAccountToBASimple 0x02676ae9 
>mono_handle_native_sigsegv + 240
>2015-09-22 16:39:02.364 LinkAccountToBASimple[617:262689] critical: 
>1 LinkAccountToBASimple 0x0267aa31 
>sigabrt_signal_handler + 100
>2015-09-22 16:39:02.365 LinkAccountToBASimple[617:262689] critical: 
>2 libsystem_platform.dylib 0x36bb7077 _sigtramp + 42
>2015-09-22 16:39:02.365 LinkAccountToBASimple[617:262689] critical: 
>3 libsystem_pthread.dylib 0x36bbd74b pthread_kill + 62
>2015-09-22 16:39:02.366 LinkAccountToBASimple[617:262689] critical: 
>4 libsystem_c.dylib 0x36ab1f41 abort + 108
>2015-09-22 16:39:02.366 LinkAccountToBASimple[617:262689] critical: 
>5 LinkAccountToBASimple 0x0272f7cc 
>_ZL15print_exceptionP10MonoObjectbP15NSMutableString + 0
>2015-09-22 16:39:02.366 LinkAccountToBASimple[617:262689] critical: 
>6 LinkAccountToBASimple 0x02677079 
>mono_invoke_unhandled_exception_hook + 76
>2015-09-22 16:39:02.367 LinkAccountToBASimple[617:262689] critical: 
>7 LinkAccountToBASimple 0x0268188b 
>mono_thread_abort_dummy + 62
>2015-09-22 16:39:02.367 LinkAccountToBASimple[617:262689] critical: 
>8 LinkAccountToBASimple 0x02676873 
>mono_handle_exception_internal + 3858
>2015-09-22 16:39:02.367 LinkAccountToBASimple[617:262689] critical: 
>9 LinkAccountToBASimple 0x0267595b mono_handle_exception 
>+ 30
>2015-09-22 16:39:02.368 LinkAccountToBASimple[617:262689] critical: 
>10 LinkAccountToBASimple 0x026702c1 
>handle_signal_exception + 48
>2015-09-22 16:39:02.368 LinkAccountToBASimple[617:262689] critical: 
>11 LinkAccountToBASimple 0x000099a8 
>LinkAccountToBASimple_LinkAccountToBASimpleViewController_ViewDidLoad + 376
>2015-09-22 16:39:02.368 LinkAccountToBASimple[617:262689] critical: 
>12 LinkAccountToBASimple 0x01042d24 
>wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr 
>+ 256
>2015-09-22 16:39:02.369 LinkAccountToBASimple[617:262689] critical: 
>13 LinkAccountToBASimple 0x026810db 
>mono_jit_runtime_invoke + 1150
>2015-09-22 16:39:02.369 LinkAccountToBASimple[617:262689] critical: 
>14 LinkAccountToBASimple 0x026c6841 mono_runtime_invoke + 88
>2015-09-22 16:39:02.369 LinkAccountToBASimple[617:262689] critical: 
>15 LinkAccountToBASimple 0x0261983d 
>_ZL30native_to_managed_trampoline_6P11objc_objectP13objc_selectorPP11_MonoMethodPKcS7_ 
>+ 128
>2015-09-22 16:39:02.370 LinkAccountToBASimple[617:262689] critical: 
>16 LinkAccountToBASimple 0x026252e1 
>-[LinkAccountToBASimpleViewController viewDidLoad] + 52
>2015-09-22 16:39:02.371 LinkAccountToBASimple[617:262689] critical: 
>17 UIKit 0x28ba244d <redacted> + 1108
>2015-09-22 16:39:02.371 LinkAccountToBASimple[617:262689] critical: 
>18 UIKit 0x28ba1fdd <redacted> + 24
>2015-09-22 16:39:02.373 LinkAccountToBASimple[617:262689] critical: 
>19 UIKit 0x28ba8b7d <redacted> + 68
>2015-09-22 16:39:02.374 LinkAccountToBASimple[617:262689] critical: 
>20 UIKit 0x28ba60f5 <redacted> + 284
>2015-09-22 16:39:02.374 LinkAccountToBASimple[617:262689] critical: 
>21 UIKit 0x28c18941 <redacted> + 48
>2015-09-22 16:39:02.374 LinkAccountToBASimple[617:262689] critical: 
>22 UIKit 0x28e340ff <redacted> + 3314
>2015-09-22 16:39:02.374 LinkAccountToBASimple[617:262689] critical: 
>23 UIKit 0x28e37ea3 <redacted> + 1554
>2015-09-22 16:39:02.375 LinkAccountToBASimple[617:262689] critical: 
>24 UIKit 0x28e4adb9 <redacted> + 36
>2015-09-22 16:39:02.375 LinkAccountToBASimple[617:262689] critical: 
>25 UIKit 0x28e353cf <redacted> + 134
>2015-09-22 16:39:02.375 LinkAccountToBASimple[617:262689] critical: 
>26 FrontBoardServices 0x2ca64ccf <redacted> + 230
>2015-09-22 16:39:02.376 LinkAccountToBASimple[617:262689] critical: 
>27 FrontBoardServices 0x2ca64fc1 <redacted> + 48
>2015-09-22 16:39:02.376 LinkAccountToBASimple[617:262689] critical: 
>28 CoreFoundation 0x24aa1c3f <redacted> + 14
>2015-09-22 16:39:02.377 LinkAccountToBASimple[617:262689] critical: 
>29 CoreFoundation 0x24aa182d <redacted> + 452
>2015-09-22 16:39:02.377 LinkAccountToBASimple[617:262689] critical: 
>30 CoreFoundation 0x24a9fb9b <redacted> + 794
>2015-09-22 16:39:02.377 LinkAccountToBASimple[617:262689] critical: 
>31 CoreFoundation 0x249f3249 CFRunLoopRunSpecific 
>+ 520
>2015-09-22 16:39:02.378 LinkAccountToBASimple[617:262689] critical: 
>32 CoreFoundation 0x249f3035 CFRunLoopRunInMode + 108
>2015-09-22 16:39:02.378 LinkAccountToBASimple[617:262689] critical: 
>33 UIKit 0x28c0db2d <redacted> + 524
>2015-09-22 16:39:02.379 LinkAccountToBASimple[617:262689] critical: 
>34 UIKit 0x28c088a9 UIApplicationMain + 144
>2015-09-22 16:39:02.379 LinkAccountToBASimple[617:262689] critical: 
>35 LinkAccountToBASimple 0x00af3c28 
>wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr 
>+ 272
>2015-09-22 16:39:02.379 LinkAccountToBASimple[617:262689] critical: 
>36 LinkAccountToBASimple 0x00335158 
>UIKit_UIApplication_Main_string___intptr_intptr + 52
>2015-09-22 16:39:02.380 LinkAccountToBASimple[617:262689] critical: 
>37 LinkAccountToBASimple 0x00334ffc 
>UIKit_UIApplication_Main_string___string_string + 204
>2015-09-22 16:39:02.380 LinkAccountToBASimple[617:262689] critical: 
>38 LinkAccountToBASimple 0x00009130 
>LinkAccountToBASimple_Application_Main_string__ + 172
>2015-09-22 16:39:02.380 LinkAccountToBASimple[617:262689] critical: 
>39 LinkAccountToBASimple 0x01042d24 
>wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr 
>+ 256
>2015-09-22 16:39:02.381 LinkAccountToBASimple[617:262689] critical: 
>40 LinkAccountToBASimple 0x026810db 
>mono_jit_runtime_invoke + 1150
>2015-09-22 16:39:02.381 LinkAccountToBASimple[617:262689] critical: 
>41 LinkAccountToBASimple 0x026c6841 mono_runtime_invoke + 88
>2015-09-22 16:39:02.381 LinkAccountToBASimple[617:262689] critical: 
>42 LinkAccountToBASimple 0x026c9ecb 
>mono_runtime_exec_main + 282
>2015-09-22 16:39:02.382 LinkAccountToBASimple[617:262689] critical: 
>43 LinkAccountToBASimple 0x026c9d15 mono_runtime_run_main 
>+ 496
>2015-09-22 16:39:02.382 LinkAccountToBASimple[617:262689] critical: 
>44 LinkAccountToBASimple 0x0266f7d1 mono_jit_exec + 48
>2015-09-22 16:39:02.382 LinkAccountToBASimple[617:262689] critical: 
>45 LinkAccountToBASimple 0x02746e74 xamarin_main + 2072
>2015-09-22 16:39:02.384 LinkAccountToBASimple[617:262689] critical: 
>46 LinkAccountToBASimple 0x026514d5 main + 112
>2015-09-22 16:39:02.385 LinkAccountToBASimple[617:262689] critical: 
>47 libdyld.dylib 0x36a4a873 <redacted> + 2
>2015-09-22 16:39:02.386 LinkAccountToBASimple[617:262689] critical:
>=================================================================
>Got a SIGABRT while executing native code. This usually indicates
>a fatal error in the mono runtime or one of the native libraries
>used by your application.
>=================================================================


## Notes

I can confirm this issue when testing on an iPad 2 running iOS 7.1.
Comment 12 Zoltan Varga 2016-02-01 19:53:46 UTC
Fixed in mono master 2b3951446e277279cf2c40b64af59fd7d4023396. Thanks for the testcase. This should be a candidate for cycle6sr2.
Comment 14 GouriKumari 2016-03-03 16:34:35 UTC
This will be included with C7. Hence, I am moving the milestone to Cycle7.
Comment 15 Parmendra Kumar 2016-05-17 15:26:04 UTC
I have checked this issue with latest C7 build and observed that the applicationoutput print SUCCESS many time on ARMv7.

Screencast:

Hence market this issue as verified fixed. 

EnvironmentInfo: http://www.screencast.com/t/O1BFTjTjD

=== Xamarin Studio Enterprise ===

Version 6.0 (build 5156)
Installation UUID: 956d7bf6-5e53-42e5-9fb4-c7d91835f9d7
Runtime:
	Mono 4.4.0 (mono-4.4.0-branch/0f5fdf2) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 404000168

=== Xamarin.Profiler ===

Version: 0.33.1
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 7.3.1 (10188.1)
Build 7D1014

=== Xamarin.iOS ===

Version: 9.8.0.318 (Xamarin Enterprise)
Hash: efefc1e
Branch: cycle7
Build date: 2016-05-13 17:19:05-0400

=== Xamarin.Android ===

Version: 6.1.0.56 (Xamarin Enterprise)
Android SDK: /Users/xamarin_360/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.4   (API level 19)
		5.1   (API level 22)
		6.0   (API level 23)

SDK Tools Version: 25.1.3
SDK Platform Tools Version: 23.1
SDK Build Tools Version: 23.0.3

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Android Player ===

Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: 2.8.0.318 (Xamarin Enterprise)

=== Build Information ===

Release ID: 600005156
Git revision: 6bb41168165682b4ed22a94364bf0cf24e6b1d5c
Build date: 2016-05-13 16:06:44-04
Xamarin addins: 32a8312bbbe9be707b6535e19c0ed3c4e4f27443
Build lane: monodevelop-lion-cycle7

=== Operating System ===

Mac OS X 10.11.4
Darwin Xamarin-360s-iMac.local 15.4.0 Darwin Kernel Version 15.4.0
    Fri Feb 26 22:08:05 PST 2016
    root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64

Note You need to log in before you can comment on or make changes to this bug.