mach_vm_map failed (error code=3) - xamarin.ios

After navigating through my iPAD application for a while I have noticed that the responsiveness of the app is getting slower and slower and finally my app crashes with the following error
AppName(1779,0x3d12d18c) malloc: *** mach_vm_map(size=167936) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Jan 7 11:34:30 AppName[1779] <Error>: at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0xffffffff>
Jan 7 11:34:30 AppName[1779] <Error>: at MonoTouch.UIKit.UIApplication.Main (string[],string,string) <0x0012b>
Jan 7 11:34:30 AppName[1779] <Error>: at AppName.Application.Main (string[]) <0x0002f>
Jan 7 11:34:30 AppName[1779] <Error>: at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff>
is this a memory related issue?

Yes, this is a memory issue: you ran out of memory.
I suggest you use Instruments to try to track down any memory leaks.

Related

Xamarin GTK on Linux: "DllNotFoundException: libglib-2.0-0.dll "

I am trying to run a Xamarin test application on a fresh install of Ubuntu 20.04.2
On a windows 10 machine, I am cloning this repo:
https://github.com/jsuarezruiz/xamarin-forms-gtk-movies-sample
Compile it in Visual Studio 2019, it runs perfectly on android and windows GTK
Then I copy the contents of bin/Debug folder to my Linux machine and try running it with mono, it throws an exception:
Unhandled Exception:
System.DllNotFoundException: libglib-2.0-0.dll assembly:<unknown assembly> type:<unknown type> member:(null)
at (wrapper managed-to-native) GLib.Marshaller.g_utf16_to_utf8(char*,intptr,intptr,intptr,intptr&)
at GLib.Marshaller.StringToPtrGStrdup (System.String str) [0x00034] in <d973ca9f8b494b789fba7fe0ad040b14>:0
at GLib.Global.set_ProgramName (System.String value) [0x00001] in <d973ca9f8b494b789fba7fe0ad040b14>:0
at Gtk.Application.SetPrgname () [0x0000d] in <35293b6aa2744433b0e2f41f34e699d5>:0
at Gtk.Application.Init () [0x00001] in <35293b6aa2744433b0e2f41f34e699d5>:0
at Movies.GTK.Program.Main (System.String[] args) [0x00043] in <87211febe55c459f869a2b0842e037c3>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: libglib-2.0-0.dll assembly:<unknown assembly> type:<unknown type> member:(null)
at (wrapper managed-to-native) GLib.Marshaller.g_utf16_to_utf8(char*,intptr,intptr,intptr,intptr&)
at GLib.Marshaller.StringToPtrGStrdup (System.String str) [0x00034] in <d973ca9f8b494b789fba7fe0ad040b14>:0
at GLib.Global.set_ProgramName (System.String value) [0x00001] in <d973ca9f8b494b789fba7fe0ad040b14>:0
at Gtk.Application.SetPrgname () [0x0000d] in <35293b6aa2744433b0e2f41f34e699d5>:0
at Gtk.Application.Init () [0x00001] in <35293b6aa2744433b0e2f41f34e699d5>:0
at Movies.GTK.Program.Main (System.String[] args) [0x00043] in <87211febe55c459f869a2b0842e037c3>:0
Obviously missing a "libglib-2.0-0.dll", which I am not sure how to install on Linux and where mono searches for it.
So far I tried installing mono-devel, mono-complete, gtk-sharp2, libglib2.0-dev
After searching through mono logs I noticed that it's trying to access windows-specific dlls, so I tried setting library reference parameter "Copy Local" to false on these libraries:
atk-sharp
gdk-sharp
glade-sharp
glib-sharp
gtk-dotnet
gtk-sharp
pango-sharp
And it worked on ubuntu 18.04.3 LTS

Fatal signal 11 (SIGSEGV) while running project

I have a weird error and I can't find where it comes from. The only thing that appears in the logcat is :
01-10 17:07:10.665: A/libc(20449): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)

Xamarin installation failed in MAC OS X

I am facing problem to instal Xamarin in my Mac machine. It's giving problem in monotouch framework installation.
I have down loaded from http://xamarin.com and
down loaded file name is : XamarinInstaller.dmg
My Mac book specifications : lion 10.8.2
Please help me out..
I am getting below error.
Mono Framework installation failed with more than one exception (Attempt #Mono Framework)
Some installation errors are present.
Exception type: System.AggregateException
Message: Some installation errors are present.
Exception type: Xamarin.Web.Installer.InstallException
Message: Failed to attach DMG image '/Users/abcd.is/Library/Caches/XamarinInstaller/Universal/downloads/MonoFramework-MDK-2.10.12.macos10.xamarin.x86.dmg'. Error code 1.
at Xamarin.Web.Installer.MacInstallationArchiveHandler.MountDmg (System.String path) [0x00000] in :0
at Xamarin.Web.Installer.MacInstallationArchiveHandler.InstallDmg (System.String path, Boolean needsPrivileges) [0x00000] in :0
at Xamarin.Web.Installer.Installer.InstallationArchiveHandler.Install (System.String path, Boolean needsPrivileges) [0x00000] in :0
Exception type: Xamarin.Web.Installer.InstallException
Message: Failed to attach DMG image '/Users/abcd.is/Library/Caches/XamarinInstaller/Universal/downloads/MonoFramework-MDK-2.10.12.macos10.xamarin.x86.dmg'. Error code 1.
Actually, restarting the installer worked for me.

ServiceStack.Text.MonoTouch "Could not AOT the assembly"

I am getting an issue compiling my application for a device in debug mode only. It will work in release mode. I am linking every assembly.
error MT3001: Could not AOT the assembly '/Users/Paul/Git/MedXChange.iOS/Src/MedXChange.iOS/bin/iPhone/Debug/MedXVue.app/ServiceStack.Text.MonoTouch.dll'
at MTouch.GetObjectFileForAssembly (System.String assemblyName, Abi abi) [0x00000] in <filename unknown>:0
at MTouch+<CompileAssemblies>c__AnonStorey11.<>m__1C (System.String s) [0x00000] in <filename unknown>:0
at System.Threading.Tasks.Parallel+<ForEach>c__AnonStorey36`1[System.String].<>m__34 (System.String e, System.Threading.Tasks.ParallelLoopState s, System.Object l) [0x00000] in <filename unknown>:0
at System.Threading.Tasks.Parallel+<ForEach>c__AnonStorey35`2[System.String,System.Object].<>m__32 () [0x00000] in <filename unknown>:0
at System.Threading.Tasks.TaskActionInvoker+ActionInvoke.Invoke (System.Threading.Tasks.Task owner, System.Object state, System.Threading.Tasks.Task context) [0x00000] in <filename unknown>:0
at System.Threading.Tasks.Task.InnerInvoke () [0x00000] in <filename unknown>:0
at System.Threading.Tasks.Task.ThreadStart () [0x00000] in <filename unknown>:0
I suspect the issue can be found here when trying to AOT compile the assembly.
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -miphoneos-version-min=5.0 -arch armv7s -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/yn/cx1bv3414z938rqkk72fyngw0000gn/T/tmpe7f19b4.tmp/Noodle.iOS.dll.armv7s.s -o /var/folders/yn/cx1bv3414z938rqkk72fyngw0000gn/T/tmpe7f19b4.tmp/Noodle.iOS.dll.armv7s.o
MONO_PATH=/Users/Paul/Git/MedXChange.iOS/Src/MedXChange.iOS/bin/iPhone/Debug/MedXVue.app /Developer/MonoTouch/usr/bin/arm-darwin-mono --debug --aot=mtriple=armv7-darwin,full,static,asmonly,direct-icalls,soft-debug,no-direct-calls,iphone-abi,outfile=/var/folders/yn/cx1bv3414z938rqkk72fyngw0000gn/T/tmpe7f19b4.tmp/ServiceStack.Text.MonoTouch.dll.armv7.s "/Users/Paul/Git/MedXChange.iOS/Src/MedXChange.iOS/bin/iPhone/Debug/MedXVue.app/ServiceStack.Text.MonoTouch.dll"
Mono Ahead of Time compiler - compiling assembly /Users/Paul/Git/MedXChange.iOS/Src/MedXChange.iOS/bin/iPhone/Debug/MedXVue.app/ServiceStack.Text.MonoTouch.dll
Code: 15446124 Info: 420334 Ex Info: 3554193 Unwind Info: 5197 Class Info: 2808 PLT: 13884 GOT Info: 805930 GOT: 224904 Offsets: 177903
Output file: '/var/folders/yn/cx1bv3414z938rqkk72fyngw0000gn/T/tmpe7f19b4.tmp/ServiceStack.Text.MonoTouch.dll.armv7.s'.
Linking symbol: '_mono_aot_module_ServiceStack_Text_MonoTouch_info'.
Compiled 24658 out of 24658 methods (100%)
Methods without GOT slots: 0 (0%)
Direct calls: 0 (0%)
JIT time: 4185 ms, Generation time: 7613 ms, Assembly+Link time: 3 ms.
Here is the AOT compiling of the ServiceStack.Text.MonoTouch assembly when the build SUCCEEDS in release mode.
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -miphoneos-version-min=5.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/yn/cx1bv3414z938rqkk72fyngw0000gn/T/tmp47cefef2.tmp/System.Core.dll.armv7.s -o /var/folders/yn/cx1bv3414z938rqkk72fyngw0000gn/T/tmp47cefef2.tmp/System.Core.dll.armv7.o
MONO_PATH=/Users/Paul/Git/MedXChange.iOS/Src/MedXChange.iOS/bin/iPhone/Release/MedXVue.app /Developer/MonoTouch/usr/bin/arm-darwin-mono --aot=mtriple=armv7-darwin,full,static,asmonly,direct-icalls,nodebug,outfile=/var/folders/yn/cx1bv3414z938rqkk72fyngw0000gn/T/tmp47cefef2.tmp/ServiceStack.Text.MonoTouch.dll.armv7.s "/Users/Paul/Git/MedXChange.iOS/Src/MedXChange.iOS/bin/iPhone/Release/MedXVue.app/ServiceStack.Text.MonoTouch.dll"
Mono Ahead of Time compiler - compiling assembly /Users/Paul/Git/MedXChange.iOS/Src/MedXChange.iOS/bin/iPhone/Release/MedXVue.app/ServiceStack.Text.MonoTouch.dll
Code: 5584144 Info: 301083 Ex Info: 111005 Unwind Info: 7670 Class Info: 2808 PLT: 11634 GOT Info: 709474 GOT: 117328 Offsets: 128308
Output file: '/var/folders/yn/cx1bv3414z938rqkk72fyngw0000gn/T/tmp47cefef2.tmp/ServiceStack.Text.MonoTouch.dll.armv7.s'.
Linking symbol: '_mono_aot_module_ServiceStack_Text_MonoTouch_info'.
Compiled 24367 out of 24367 methods (100%)
Methods without GOT slots: 11790 (48%)
Direct calls: 2466 (16%)
JIT time: 3470 ms, Generation time: 2578 ms, Assembly+Link time: 5 ms.
The only thing that looks different is the "Direct calls" and "Methods without GOT slots". Mind you, I did not change any code, just changing configurations back and forth, building and cleaning.

Cannot uplaod Monotouch project to device anymore - Null reference in installer

I have recently downloaded and installed Xcode 3 (!) together with SDK 4.3 (was on 4.2 before). Now i cannot deploy my app to iPad 2 (4.3.1) anymore. I get this error:
Please ensure your device is connected...
Connected to: René’s iPad
Initializing file service...
Uploading application
Finalizing file service...
Connected to: René’s iPad
Installing application
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
at MonoTouch.Installation.Installer.InstallApplication (object,System.EventArgs) <0x001b6>
at MonoTouch.Installation.Device.NotificationCallback (MonoTouch.Installation.Device/am_device_notification_callback_info&) <0x0006e>
at (wrapper native-to-managed) MonoTouch.Installation.Device.NotificationCallback (MonoTouch.Installation.Device/am_device_notification_callback_info&) <0x0003d>
at (wrapper managed-to-native) MonoTouch.CoreFoundation.CFRunLoop.CFRunLoopRun () <0x00003>
at MonoTouch.CoreFoundation.CFRunLoop.Run () <0x0000d>
at MonoTouch.Installation.Installer.InstallApplication (string) <0x00151>
at MTouch.Main (string[]) <0x032d1>
The application was terminated by a signal: SIGHUP
Your application name or path have a space in it. Remove the space and it should work.

Resources