https://bugzilla.novell.com/show_bug.cgi?id=676891
https://bugzilla.novell.com/show_bug.cgi?id=676891#c0 Summary: Marshal.Copy works in simulator, but fails on iOS device... Classification: Mono Product: MonoTouch Version: SVN Platform: iPhone OS/Version: Apple iOS 4.2 Status: NEW Severity: Critical Priority: P5 - None Component: Class Libraries AssignedTo: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: --- Blocker: --- Created an attachment (id=417493) --> (http://bugzilla.novell.com/attachment.cgi?id=417493) Marshal Copy crash on device TestCase. User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b12) Gecko/20100101 Firefox/4.0b12 Essentially code that uses a Marshal.Copy to extract pixel information form an IntPtr buffer, works perfectly well in the simulator, but crashes when the same code is deployed to an iOS device. I've tested this on both iPhone and iPad, with the same crash. Reproducible: Always Steps to Reproduce: 1. Load up attached project 2. Build for Simulator 3. Run, a spinning quad will appear 4. Build for Device 5. Run, and the app will crash on the case statement inside OnLoad() just below case SurfaceFormat.Rgba32 /*kTexture2DPixelFormat_RGBA8888*/: case SurfaceFormat.Dxt3 : When the Marshal.Copy call is made. Actual Results: As described above. Expected Results: I expected it to work exactly like it does in the simulator. This only seems to crash with 32bit images. Crash log/stack trace below User assembly '/Users/sandy/Projects/SPXMonitor/MonoTouch.Dialog/bin/iPhone/Debug/MonoTouch.Dialog.dll' is missing. Debugger will now debug all code, not just user code. Loaded assembly: /private/var/mobile/Applications/0F80CAD6-818A-43AB-9C97-70FE712F8147/MarshalCopyTestCase.app/System.dll Loaded assembly: /private/var/mobile/Applications/0F80CAD6-818A-43AB-9C97-70FE712F8147/MarshalCopyTestCase.app/monotouch.dll Loaded assembly: /private/var/mobile/Applications/0F80CAD6-818A-43AB-9C97-70FE712F8147/MarshalCopyTestCase.app/OpenTK.dll Loaded assembly: /private/var/mobile/Applications/0F80CAD6-818A-43AB-9C97-70FE712F8147/MarshalCopyTestCase.app/MarshalCopyTestCase.exe Could not insert pending breakpoint at 'Main.cs:122'. Perhaps the source line does not contain any statements, or the source does not correspond to the current binary. Thread started: Could not insert pending breakpoint at 'Main.cs:122'. Perhaps the source line does not contain any statements, or the source does not correspond to the current binary. Resolved pending breakpoint at 'EAGLView.cs:317' to Void MarshalCopyTestCase.EAGLView:OnLoad () [0x000fa]. Resolved pending breakpoint at 'EAGLView.cs:333' to Void MarshalCopyTestCase.EAGLView:OnLoad () [0x0018a]. Stacktrace: at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal.copy_from_unmanaged (intptr,int,System.Array,int) <0xffffffff> at System.Runtime.InteropServices.Marshal.Copy (intptr,byte[],int,int) <0x0003c> at MarshalCopyTestCase.EAGLView.OnLoad (System.EventArgs) [0x00092] in /Users/sandy/Projects/SPXMonitor/MarshalCopyTestCase/EAGLView.cs:304 at OpenTK.Platform.iPhoneOS.iPhoneOSGameView.Run (double) <0x0009f> at MarshalCopyTestCase.AppDelegate.FinishedLaunching (MonoTouch.UIKit.UIApplication) [0x00000] in /Users/sandy/Projects/SPXMonitor/MarshalCopyTestCase/Main.cs:23 at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0x000cb> at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0xffffffff> at MonoTouch.UIKit.UIApplication.Main (string[],string,string) <0x000e8> at MonoTouch.UIKit.UIApplication.Main (string[]) <0x0002b> at MarshalCopyTestCase.Application.Main (string[]) [0x00000] in /Users/sandy/Projects/SPXMonitor/MarshalCopyTestCase/Main.cs:13 at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0x000cb> Native stacktrace: 0 MarshalCopyTestCase 0x003229a0 mono_handle_native_sigsegv + 404 1 MarshalCopyTestCase 0x0030c078 mono_sigsegv_signal_handler + 348 2 libSystem.B.dylib 0x32d24487 _sigtramp + 34 3 libSystem.B.dylib 0x32d32075 __memcpy_chk + 16 4 libSystem.B.dylib 0x32d32075 __memcpy_chk + 16 5 MarshalCopyTestCase 0x003ac40c __inline_memcpy_chk + 44 6 MarshalCopyTestCase 0x003ca218 ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged + 496 7 MarshalCopyTestCase 0x00225750 (wrapper managed-to-native) System.Runtime.InteropServices.Marshal:copy_from_unmanaged (intptr,int,System.Array,int) + 88 8 MarshalCopyTestCase 0x003020cc MarshalCopyTestCase.EAGLView:OnLoad (System.EventArgs) + 1212 9 MarshalCopyTestCase 0x0008e6cc OpenTK.Platform.iPhoneOS.iPhoneOSGameView:Run (double) + 160 10 MarshalCopyTestCase 0x002feccc MarshalCopyTestCase.AppDelegate:FinishedLaunching (MonoTouch.UIKit.UIApplication) + 180 11 MarshalCopyTestCase 0x00270590 (wrapper runtime-invoke) object:runtime_invoke_dynamic (intptr,intptr,intptr,intptr) + 204 12 MarshalCopyTestCase 0x0030bcf0 mono_jit_runtime_invoke + 3032 13 MarshalCopyTestCase 0x003eab40 mono_runtime_invoke + 140 14 MarshalCopyTestCase 0x0046c7e4 monotouch_trampoline + 2444 15 UIKit 0x3386d02c -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1200 16 UIKit 0x33866a78 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 396 17 UIKit 0x338202e4 -[UIApplication handleEvent:withNewEvent:] + 1476 18 UIKit 0x3381fb1c -[UIApplication sendEvent:] + 68 19 UIKit 0x3381f3b4 _UIApplicationHandleEvent + 6824 20 GraphicsServices 0x35262c88 PurpleEventCallback + 1048 21 CoreFoundation 0x35e9a5cb __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 28 22 CoreFoundation 0x35e9a589 __CFRunLoopDoSource1 + 164 23 CoreFoundation 0x35e8c835 __CFRunLoopRun + 580 24 CoreFoundation 0x35e8c50b CFRunLoopRunSpecific + 226 25 CoreFoundation 0x35e8c419 CFRunLoopRunInMode + 60 26 UIKit 0x33865554 -[UIApplication _run] + 548 27 UIKit 0x33862558 UIApplicationMain + 972 28 MarshalCopyTestCase 0x001276d0 (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr) + 240 29 MarshalCopyTestCase 0x00111d6c MonoTouch.UIKit.UIApplication:Main (string[]) + 44 30 MarshalCopyTestCase 0x002feaf4 MarshalCopyTestCase.Application:Main (string[]) + 132 31 MarshalCopyTestCase 0x00270590 (wrapper runtime-invoke) object:runtime_invoke_dynamic (intptr,intptr,intptr,intptr) + 204 32 MarshalCopyTestCase 0x0030bcf0 mono_jit_runtime_invoke + 3032 33 MarshalCopyTestCase 0x003eab40 mono_runtime_invoke + 140 34 MarshalCopyTestCase 0x003ece34 mono_runtime_exec_main + 828 35 MarshalCopyTestCase 0x003ec5cc mono_runtime_run_main + 1016 36 MarshalCopyTestCase 0x00312908 mono_jit_exec + 216 37 MarshalCopyTestCase 0x003073ec main + 3468 38 MarshalCopyTestCase 0x00002830 start + 52 ================================================================= Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. ================================================================= -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
