Bug 12564 - Sometimes the app Crashes on iPad4 right on start
Summary: Sometimes the app Crashes on iPad4 right on start
Status: RESOLVED NORESPONSE
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 6.3.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: 7.2.0 (iOS 7.1)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-06-05 15:28 UTC by Lucian Torje
Modified: 2015-02-23 04:28 UTC (History)
4 users (show)

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


Attachments
stacktrace 1 (39.43 KB, application/octet-stream)
2013-06-05 15:28 UTC, Lucian Torje
Details
crash on initializing delegate (2.71 KB, application/octet-stream)
2013-06-05 15:30 UTC, Lucian Torje
Details
trampoline crash (28.22 KB, application/octet-stream)
2013-06-05 15:31 UTC, Lucian Torje
Details
caught exception (322.32 KB, image/png)
2013-06-05 15:32 UTC, Lucian Torje
Details
another exception (164.47 KB, image/png)
2013-06-06 02:43 UTC, Lucian Torje
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 NORESPONSE

Description Lucian Torje 2013-06-05 15:28:48 UTC
Created attachment 4073 [details]
stacktrace 1

Using the same code sometimes after a rebuild the app fails to start and either I'm getting and exception or I just notice that after the splash screen the app closes (crash).
Comment 1 Lucian Torje 2013-06-05 15:30:21 UTC
Created attachment 4074 [details]
crash on initializing delegate

note that there is no crash reporter used
Comment 2 Lucian Torje 2013-06-05 15:31:12 UTC
Created attachment 4075 [details]
trampoline crash
Comment 3 Lucian Torje 2013-06-05 15:32:07 UTC
Created attachment 4076 [details]
caught exception
Comment 4 Lucian Torje 2013-06-05 15:36:48 UTC
My xamarin installation details:

Xamarin Studio
Version 4.0.8 (build 2)
Installation UUID: a842a272-7569-4eb8-8087-8e915ee1809e
Runtime:
	Mono 3.0.10 ((no/eff4cb5)
	GTK 2.24.18
	GTK# (2.12.0.0)
	Package version: 300100000

Apple Developer Tools
Xcode 4.6.2 (2067.2)
Build 4H1003

Xamarin.Mac
Xamarin.Mac: Not Installed

Xamarin.iOS
Version: 6.3.5.43 (Business Edition)
Hash: 07cde46
Branch: 
Build date: 2013-13-05 14:44:13-0400

Xamarin.Android
Version: 4.7.4 (Business Edition)
Android SDK: /Users/lucian/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)
Java SDK: /usr

Build Information
Release ID: 400080002
Git revision: 0a09117dec1aed78c735ac46f7a50ae7d12f7a7a
Build date: 2013-05-16 19:36:29+0000
Xamarin addins: 78d0437c3f92ae13042f81e5fd9487e2c28d5fbc

Operating System
Mac OS X 10.8.3
Darwin lucian-MacBook-Pro.local 12.3.0 Darwin Kernel Version 12.3.0
    Sun Jan  6 22:37:10 PST 2013
    root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64
Comment 5 Rolf Bjarne Kvinge [MSFT] 2013-06-05 17:14:04 UTC
Can you add "-f" to the additional mtouch arguments in the project's iOS Build options to see if that fixes the issue?
Comment 6 Lucian Torje 2013-06-06 02:14:07 UTC
Already added --nostrip  --nosymbolstrip --force  --dsym=true and now I'm getting another nonsense crash:

Incident Identifier: FEC719B7-AC4D-427A-8915-80B337182B28
CrashReporter Key:   f30371e90e20209cd03d9bc3a596bf6ab9c01ad0
Hardware Model:      iPad3,5
Process:         KnoTextbooks [17887]
Path:            /var/mobile/Applications/032C774F-EC14-4E13-8B8A-2BB57D2B5A5F/KnoTextbooks.app/KnoTextbooks
Identifier:      KnoTextbooks
Version:         ??? (???)
Code Type:       ARM (Native)
Parent Process:  launchd [1]

Date/Time:       2013-06-06 09:11:11.064 +0300
OS Version:      iOS 6.1 (10B141)
Report Version:  104

Exception Type:  EXC_BAD_ACCESS (SIGABRT)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000024
Crashed Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib        	0x399b9350 __pthread_kill + 8
1   libsystem_c.dylib             	0x3992ffb2 pthread_kill + 54
2   libsystem_c.dylib             	0x3996c366 abort + 90
3   KnoTextbooks                  	0x0281205e mono_handle_native_sigsegv (mini-exceptions.c:2363)
4   KnoTextbooks                  	0x0281c39e mono_sigsegv_signal_handler (mini.c:6436)
5   libsystem_c.dylib             	0x39939d38 _sigtramp + 40
6   ???                           	0x2fdff564 0 + 803206500
7   KnoTextbooks                  	0x013fa630 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 196
8   KnoTextbooks                  	0x0281bc8e mono_jit_runtime_invoke (mini.c:6299)
9   KnoTextbooks                  	0x0285a040 mono_runtime_invoke (object.c:2827)
10  KnoTextbooks                  	0x0285e3e0 mono_runtime_class_init_full (object.c:376)
11  KnoTextbooks                  	0x0285e84e mono_runtime_class_init (object.c:261)
12  KnoTextbooks                  	0x0281cc96 mono_resolve_patch_target (mini.c:3241)
13  KnoTextbooks                  	0x027f92c4 load_method (aot-runtime.c:3173)
14  KnoTextbooks                  	0x027f9d36 mono_aot_get_method (aot-runtime.c:3558)
15  KnoTextbooks                  	0x0281d216 mono_jit_compile_method_with_opt (mini.c:5529)
16  KnoTextbooks                  	0x0281b982 mono_jit_runtime_invoke (mini.c:6146)
17  KnoTextbooks                  	0x0285a040 mono_runtime_invoke (object.c:2827)
18  KnoTextbooks                  	0x02894ac4 monotouch_init (monotouch-glue.m:831)
19  KnoTextbooks                  	0x028903c8 main (main.m:434)
20  KnoTextbooks                  	0x00d33838 start + 36

Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0   libsystem_kernel.dylib        	0x399a95d0 kevent64 + 24
1   libdispatch.dylib             	0x398e4d22 _dispatch_mgr_invoke + 806
2   libdispatch.dylib             	0x398e0374 _dispatch_mgr_thread + 32

Thread 2:
0   libsystem_kernel.dylib        	0x399b9d98 __workq_kernreturn + 8
1   libsystem_c.dylib             	0x39907ad6 _pthread_workq_return + 14
2   libsystem_c.dylib             	0x399077f2 _pthread_wqthread + 362
3   libsystem_c.dylib             	0x39907680 start_wqthread + 4

Thread 3:
0   libsystem_kernel.dylib        	0x399b9d98 __workq_kernreturn + 8
1   libsystem_c.dylib             	0x39907ad6 _pthread_workq_return + 14
2   libsystem_c.dylib             	0x399077f2 _pthread_wqthread + 362
3   libsystem_c.dylib             	0x39907680 start_wqthread + 4

Thread 4:
0   libsystem_kernel.dylib        	0x399b9494 __recvfrom + 20
1   libsystem_c.dylib             	0x39912192 recv + 18
2   KnoTextbooks                  	0x028917b4 recv_uninterrupted (debug.m:317)
3   KnoTextbooks                  	0x02892e08 monotouch_process_connection (debug.m:703)
4   KnoTextbooks                  	0x02892ac4 monotouch_connect_usb (debug.m:627)
5   KnoTextbooks                  	0x028915a0 monotouch_configure_debugging (debug.m:263)
6   KnoTextbooks                  	0x02890600 -[CocoaThreadInitializer entryPoint:] (main.m:510)
7   Foundation                    	0x31f4d22c __NSThread__main__ + 968
8   libsystem_c.dylib             	0x399120de _pthread_start + 306
9   libsystem_c.dylib             	0x39911fa4 thread_start + 4

Thread 5:
0   libsystem_kernel.dylib        	0x399b9494 __recvfrom + 20
1   libsystem_c.dylib             	0x39912192 recv + 18
2   KnoTextbooks                  	0x028917b4 recv_uninterrupted (debug.m:317)
3   KnoTextbooks                  	0x028918b8 sdb_recv (debug.m:333)
4   KnoTextbooks                  	0x027fd3ee debugger_thread (debugger-agent.c:1460)
5   KnoTextbooks                  	0x0287ad2e thread_start_routine (wthreads.c:288)
6   KnoTextbooks                  	0x02880c54 inner_start_thread (mono-threads-posix.c:49)
7   KnoTextbooks                  	0x0288e150 GC_start_routine (pthread_support.c:1526)
8   libsystem_c.dylib             	0x399120de _pthread_start + 306
9   libsystem_c.dylib             	0x39911fa4 thread_start + 4

Thread 0 crashed with ARM Thread State (32-bit):
    r0: 0x00000000    r1: 0x00000000      r2: 0x00000000      r3: 0x3b4a8524
    r4: 0x00000006    r5: 0x3b4a8b78      r6: 0x02a0a524      r7: 0x2fdfef60
    r8: 0x02a0a15d    r9: 0x3b4a4898     r10: 0x02a0a579     r11: 0x0838c248
    ip: 0x00000148    sp: 0x2fdfef54      lr: 0x3992ffb7      pc: 0x399b9350
  cpsr: 0x00000010
Comment 7 Lucian Torje 2013-06-06 02:17:36 UTC
The full additional mtouch cmd is:--compiler:clang++ -v -v -v -v --nostrip  --nosymbolstrip --force --dsym=true
Comment 8 Lucian Torje 2013-06-06 02:23:43 UTC
I'm getting this if I compile with linker behaviour "don't link" in the linker build properties:


Your mono runtime and class libraries are out of sync.
The out of sync library is: /Users/lucian/workspace/code/iPad/xamarin/KnoTextbooks.ios/bin/iPhone/Debug/KnoTextbooks.app/mscorlib.dll

When you update one from svn you need to u/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++  -miphoneos-version-min=6.0 -arch armv7  -std=c99 -I/Developer/MonoTouch/SDKs/MonoTouch.iphoneos.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -x assembler-with-cpp -c /var/folders/x8/xwpjrgts5lj0v9pb4fl7f02w0000gp/T/tmp1111a57f.tmp/mscorlib.dll.armv7.s -o /var/folders/x8/xwpjrgts5lj0v9pb4fl7f02w0000gp/T/tmp1111a57f.tmp/mscorlib.dll.armv7.o
pdate, compile and install
the other too.
Do not report this as a bug unless you're sure you have updated correctly:
you probably have a broken mono install.
If you see other errors or faults after this message they are probably related
and you need to fix your mono install first.

Your mono runtime and class libraries are out of sync.
The out of sync library is: /Users/lucian/workspace/code/iPad/xamarin/KnoTextbooks.ios/bin/iPhone/Debug/KnoTextbooks.app/mscorlib.dll
Comment 9 Lucian Torje 2013-06-06 02:43:11 UTC
Created attachment 4079 [details]
another exception
Comment 10 Rolf Bjarne Kvinge [MSFT] 2013-06-06 07:00:46 UTC
This looks like memory corruption, and I'd have to reproduce the problem myself in order to track it down. Could you attach your project  (or a test project) I can use?
Comment 11 Lucian Torje 2013-06-07 05:35:49 UTC
I cannot attach the project. It may have been generated with the  wrong xamarin license (somehow although I have a valid business license it shows on store.xamarin.com as expired - xamarin support is aware of this) - after a complete system erase/reinstall compiling the same code and running it did not crash the app on start but after I've changed the compile flags from "--compiler:clang++ -v -v -v -v --nostrip 
--nosymbolstrip --force --dsym=true" to "--compiler:clang++ -v -v -v -v" with Linker "don't link" and debug checkbox enabled it did so I've changed them back and after a complete rebuild everything was fine.

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0:
0   libsystem_kernel.dylib        	0x399b908c __psynch_cvwait + 24
1   libsystem_c.dylib             	0x3990aafc _pthread_cond_wait + 644
2   libsystem_c.dylib             	0x39914cf8 pthread_cond_wait + 36
3   KnoTextbooks                  	0x03e079e4 suspend_current (debugger-agent.c:2842)
4   KnoTextbooks                  	0x03e07c0e suspend_current (debugger-agent.c:6295)
5   KnoTextbooks                  	0x03e07c0e suspend_current (debugger-agent.c:6295)
6   KnoTextbooks                  	0x03e07c0e suspend_current (debugger-agent.c:6295)
7   KnoTextbooks                  	0x03e07c0e suspend_current (debugger-agent.c:6295)
8   KnoTextbooks                  	0x03e07c0e suspend_current (debugger-agent.c:6295)
9   KnoTextbooks                  	0x03e07c0e suspend_current (debugger-agent.c:6295)
10  KnoTextbooks                  	0x03e07c0e suspend_current (debugger-agent.c:6295)
11  KnoTextbooks                  	0x03e07c0e suspend_current (debugger-agent.c:6295)
12  KnoTextbooks                  	0x03e07c0e suspend_current (debugger-agent.c:6295)
13  KnoTextbooks                  	0x03e07c0e suspend_current (debugger-agent.c:6295)
14  KnoTextbooks                  	0x03e08cae process_event (debugger-agent.c:3643)
15  KnoTextbooks                  	0x03e08f5c mono_debugger_agent_handle_exception (debugger-agent.c:5329)
16  KnoTextbooks                  	0x03e108ca mono_handle_exception_internal + 866
17  KnoTextbooks                  	0x03e10e7e mono_handle_exception (mini-exceptions.c:1955)
18  KnoTextbooks                  	0x03e0aca4 mono_arm_throw_exception (exceptions-arm.c:161)
19  KnoTextbooks                  	0x03b67618 throw_exception + 64
20  KnoTextbooks                  	0x03e1b032 mono_resolve_patch_target (mini.c:3303)
21  KnoTextbooks                  	0x03df5478 mono_aot_plt_resolve (aot-runtime.c:3708)
22  KnoTextbooks                  	0x03e15cba mono_aot_plt_trampoline (mini-trampolines.c:867)
23  KnoTextbooks                  	0x03b67158 generic_trampoline_aot_plt + 120
24  KnoTextbooks                  	0x027379b0 KnoTextbooks_DatabaseWrapper__Initializem__1_MonoTouch_Foundation_NSString_int + 284
25  KnoTextbooks                  	0x00dd7d18 BindingTextbooks_KnoAppDelegateImpl__AgoraSQLiteDelegate_OnOpenWithFlags_MonoTouch_Foundation_NSString_int + 196
26  KnoTextbooks                  	0x03ab57fc wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 196
27  KnoTextbooks                  	0x03e19f36 mono_jit_runtime_invoke (mini.c:6299)
28  KnoTextbooks                  	0x03e5cae8 mono_runtime_invoke (object.c:2827)
29  KnoTextbooks                  	0x03db9984 native_to_managed_trampoline_BindingTextbooks_KnoAppDelegateImpl__AgoraSQLiteDelegate_OnOpenWithFlags + 276
Comment 12 Rolf Bjarne Kvinge [MSFT] 2013-06-07 06:28:33 UTC
Closing then.
Comment 13 Lucian Torje 2013-06-07 08:03:29 UTC
Reopening - the license is fine now but the app from time to time crashes after a full rebuild from the same code. This could be a problem with the debugger attaching itself to the app or the way the code is built/linked (after a complete system wipe and reinstall from fresh xamarin I'm still getting in the build output error like mono is corrupted although sometimes the app starts).

Is there a tool that I can use to check my system's health in respect to mono & xamarin installation and maybe fix and issues found?

Please investigate further since this definitely impacts my productivity and it is not acceptable that from the same code after a complete rebuild the app works and other times crashes on start. I will try to create a reproducer.


Xamarin Studio
Version 4.0.8 (build 2)
Installation UUID: 480641ea-25a7-4d52-8b33-04edae97af3a
Runtime:
	Mono 3.0.10 ((no/eff4cb5)
	GTK 2.24.18
	GTK# (2.12.0.0)
	Package version: 300100000

Apple Developer Tools
Xcode 4.6.2 (2067.2)
Build 4H1003

Xamarin.Mac
Xamarin.Mac: Not Installed

Xamarin.iOS
Version: 6.3.5.43 (Business Edition)
Hash: 07cde46
Branch: 
Build date: 2013-13-05 14:44:13-0400

Xamarin.Android
Version: 4.7.4
Android SDK: /Users/lucian/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)
Java SDK: /usr

Build Information
Release ID: 400080002
Git revision: 0a09117dec1aed78c735ac46f7a50ae7d12f7a7a
Build date: 2013-05-16 19:36:29+0000
Xamarin addins: 78d0437c3f92ae13042f81e5fd9487e2c28d5fbc

Operating System
Mac OS X 10.8.4
Darwin Lucians-MacBook-Pro.local 12.4.0 Darwin Kernel Version 12.4.0
    Wed May  1 17:57:12 PDT 2013
    root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64
Comment 14 Rolf Bjarne Kvinge [MSFT] 2013-06-07 08:13:04 UTC
Sorry, I misunderstood your comment #10.

Can you try to create a new project from a template, and see if that works?

If that works the problem is not with your system, but something in your main project instead.
Comment 15 Lucian Torje 2013-06-07 09:06:23 UTC
My Xcode version is 4.6.2 (4H1003) - are there any known issues with this version?
About the template project, can you please pin point me one that I should try and that uses complex bindings like delegates, view controllers etc defined in objective c and used from C#.
Comment 16 Rolf Bjarne Kvinge [MSFT] 2013-06-07 09:22:13 UTC
There are no known issues with the latest version (4.6.2) of Xcode.

Since the purpose of trying with a new project is to determine if the problem is with your system or your main project, any template will do.
Comment 18 PJ 2013-07-09 05:31:27 UTC
Hi Lucian, we're closing in on the 6.4 release so any last minute feedback would be much appreciated. 

Did the base template fail for you? Did you get any behavior change with the 6.3.6 release? There's also a 6.3.7 coming out tomorrow that will be very close to the eventual 6.4 release, if you have a chance to try that.
Comment 19 PJ 2013-11-19 16:44:48 UTC
This bug was targeted for a past milestone, moving to the next non-hotfix active milestone.
Comment 20 Chandan Dey 2015-02-20 07:38:45 UTC
unable to run xamarin.ios hello world application on device. but running emulator.

Xcode - 6.1.1
Xamarin- 3.9.302.0
VS- 2012/2013

Device iPad - 8.0, iPhone 4S - 8.1

my appliaction having a label only.
When i run from visual studio and click to launch from device its open and then close.
Comment 21 Rolf Bjarne Kvinge [MSFT] 2015-02-23 04:28:05 UTC
@Chandan, I suggest you contact support (you can use the support links in your Xamarin Account: https://store.xamarin.com/account/my/subscription).

I'm closing this bug report, it's been over a year in NEEDINFO.