[Mono-bugs] [Bug 711286] New: Garbage Collector has conflict with accelerometer

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Aug 9 10:59:10 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=711286

https://bugzilla.novell.com/show_bug.cgi?id=711286#c0


           Summary: Garbage Collector has conflict with accelerometer
    Classification: Mono
           Product: MonoDroid
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Runtime
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: chan.ramon at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=444977)
 --> (http://bugzilla.novell.com/attachment.cgi?id=444977)
Simple game to reproduce and workaround the crashing problem

User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101
Firefox/4.0.1

This case is very similar to the case someone escalated earlier called
"TouchTest". This problem is happening more often when using accelerometer
input.

If garbage collector is collecting garbage (GC.Collect()) when accelerometer
sensor is turned on, the application will very likely crash without any
debugging information.

This problem had been puzzling me for 3 weeks and I finally confirmed it is
definitely related to Garbage Collection and found out a workaround.



Reproducible: Always

Steps to Reproduce:
1. I have attached a simple "AccelerometerTest" project. The output is just an
android logo moving around controlled by accelerometer. 
2. Try to just tilt around the phone, you will likely get crashed within 20
seconds.  
3. There is a function in GamePanel class called "Update()" which is the update
of a typical game loop. You can see that I enforce GC to collect every 200
updates. When the GC is collecting possibly the accelerometer is also working
at the same time causing the crash. My workwround is adding Sensor.Stop() and
Sensor.Start() will isolate the accelerometer from GC. No more crash if you do
that.


Expected Results:  
Garbage collector should still work properly and the app should not crash even
if I don't have my workaround.

Accelerometer is an important part of mobile game development. Turning it on
will crash the game when garbage collector is working.

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


More information about the mono-bugs mailing list