[Mono-bugs] [Bug 541524] New: CFRunLoop throws a exception in emulator

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Sep 23 16:44:41 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=541524


           Summary: CFRunLoop throws a exception in emulator
    Classification: Mono
           Product: MonoTouch
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Runtime
        AssignedTo: gnorton at novell.com
        ReportedBy: jalf at sharpgames.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; pt-br)
AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9

using MonoTouch.CoreFoundation;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using System;

namespace LoopTest
{
    [Register ("AppDelegate")]
    class Program : UIApplicationDelegate
    {
        public override void FinishedLaunching (UIApplication app)
        {
            UIAccelerometer.SharedAccelerometer.Acceleration +=
UIAccelerometerSharedAccelerometerAcceleration;
            UIAccelerometer.SharedAccelerometer.UpdateInterval = 1/30;
            while(true)
            {
                while(CFRunLoop.Main.RunInMode(CFRunLoop.ModeDefault,0,true) ==
CFRunLoopExitReason.HandledSource);
                //DoStuff
            }

        }

        void UIAccelerometerSharedAccelerometerAcceleration (object sender,
UIAccelerometerEventArgs e)
        {
            Console.WriteLine("Hit");
        }

        static void Main (string [] args)
        {
            UIApplication.Main (args,null,"AppDelegate");
        }
    }
}

Throw this exception in emulator:

Stacktrace:

 at (wrapper managed-to-native)
MonoTouch.CoreFoundation.CFObject.CFRelease (intptr) <0x00004>
 at (wrapper managed-to-native)
MonoTouch.CoreFoundation.CFObject.CFRelease (intptr) <IL 0x00025,
0xffffffff>
 at MonoTouch.CoreFoundation.CFRunLoop.Dispose (bool) <IL 0x0001b,
0x0002c>
 at MonoTouch.CoreFoundation.CFRunLoop.Finalize () <IL 0x00002,
0x00018>
 at (wrapper runtime-invoke)
object.runtime_invoke_virtual_void__this__
(object,intptr,intptr,intptr) <IL 0x00042, 0xffffffff>

Native stacktrace:

    0   LoopTest                            0x000926aa
mono_handle_native_sigsegv + 266
    1   LoopTest                            0x000068aa
mono_sigsegv_signal_handler + 298
    2   libSystem.B.dylib                   0x95c2c2bb _sigtramp + 43
    3   ???                                 0xffffffff 0x0 + 4294967295
    4   ???                                 0x03e89d88 0x0 + 65576328
    5   ???                                 0x03e89ef5 0x0 + 65576693
    6   ???                                 0x03e89ea9 0x0 + 65576617
    7   ???                                 0x03e89e3e 0x0 + 65576510
    8   LoopTest                            0x000fd2a2
mono_gc_run_finalize + 722
    9   LoopTest                            0x001e4167
GC_invoke_finalizers + 141
    10  LoopTest                            0x000fdde3
ves_icall_System_GC_WaitForPendingFinalizers + 659
    11  LoopTest                            0x0018ea26
mono_thread_set_execution_context + 358
    12  LoopTest                            0x001c30e6 ExitThread + 214
    13  LoopTest                            0x001ed6a4 GC_start_routine +
107
    14  libSystem.B.dylib                   0x95bf1155 _pthread_start + 321
    15  libSystem.B.dylib                   0x95bf1012 thread_start + 34

Debug info from gdb:

warning: Trying to remove a section from the ordered section list that
did not exist at 0x2d2000.
warning: Could not find object file "/var/folders/tb/tbvbNWw8HtOCLF8f-
CW4FE+++TI/-Tmp-/tmp46191435.tmp/main.o" - no debug information
available for "/var/folders/tb/tbvbNWw8HtOCLF8f-CW4FE+++TI/-Tmp-/
tmp46191435.tmp/main.m".

234    /System/Library/Frameworks/System.framework/PrivateHeaders/i386/
cpu_capabilities.h: No such file or directory.
Attaching to process 1999.
Reading symbols for shared libraries . done
Reading symbols for shared
libraries .................................... done
0xffff0292 in ___spin_lock () at /System/Library/Frameworks/
System.framework/PrivateHeaders/i386/cpu_capabilities.h:234
    in /System/Library/Frameworks/System.framework/PrivateHeaders/i386/
cpu_capabilities.h
Current language:  auto; currently asm
 5 process 1999 thread 0x2703  0x95bc0286 in mach_msg_trap ()
 4 process 1999 thread 0x2603  0x95be3f9a in read$UNIX2003 ()
 3 process 1999 thread 0x2203  0x95bc746e in __semwait_signal ()
 2 process 1999 thread 0x1103  0x95bc0286 in mach_msg_trap ()
* 1 process 1999 thread 0x20b  0xffff0292 in ___spin_lock () at /
System/Library/Frameworks/System.framework/PrivateHeaders/i386/
cpu_capabilities.h:234

Thread 5 (process 1999 thread 0x2703):
#0  0x95bc0286 in mach_msg_trap ()
#1  0x95bc7a7c in mach_msg ()
#2  0x003bb382 in CFRunLoopRunSpecific ()
#3  0x003bac48 in CFRunLoopRunInMode ()
#4  0x02d6f803 in RunWebThread ()
#5  0x95bf1155 in _pthread_start ()
#6  0x95bf1012 in thread_start ()

Thread 4 (process 1999 thread 0x2603):
#0  0x95be3f9a in read$UNIX2003 ()
#1  0x000927ea in mono_handle_native_sigsegv (signal=11,
ctx=0xb0186c38) at ../../../../mono/mini/mini-exceptions.c:1560
#2  0x000068aa in mono_sigsegv_signal_handler (_dummy=11,
info=0xb0186bf8, context=0xb0186c38) at ./../../../mono/mini/mini.c:
4586
#3  <signal handler called>
#4  0x94ee3688 in objc_msgSend ()
#5  0x0037a908 in CFRelease ()
#6  0x03e89d88 in ?? ()
#7  0x03e89ef5 in ?? ()
#8  0x03e89ea9 in ?? ()
#9  0x03e89e3e in ?? ()
#10 0x000fd2a2 in mono_gc_run_finalize (obj=0x67039c0, data=0x0)
at ../../../../mono/metadata/gc.c:218
#11 0x001e4167 in GC_invoke_finalizers () at ../../../libgc/finalize.c:
787
#12 0x000fdde3 in finalizer_thread (unused=0x0) at ../../../../mono/
metadata/gc.c:1040
#13 0x0018ea26 in start_wrapper (data=0x3f152e0) at ./../../../mono/
metadata/threads.c:657
#14 0x001c30e6 in thread_start_routine (args=0x3ea0434) at ../../../../
mono/io-layer/wthreads.c:286
#15 0x001ed6a4 in GC_start_routine (arg=0x3e5ef60) at ./../../libgc/
pthread_support.c:1390
#16 0x95bf1155 in _pthread_start ()
#17 0x95bf1012 in thread_start ()

Thread 3 (process 1999 thread 0x2203):
#0  0x95bc746e in __semwait_signal ()
#1  0x95bc72ef in nanosleep$UNIX2003 ()
#2  0x001a53b0 in collection_thread (unused=0x0) at ./../../../mono/
io-layer/collection.c:34
#3  0x95bf1155 in _pthread_start ()
#4  0x95bf1012 in thread_start ()


Reproducible: Always

Steps to Reproduce:
Create a empty monotouch application and put the code in details

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list