[Mono-bugs] [Bug 692540] New: AdnroidGameView OnTouchEvent Object.GetObject NullReferenceException

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon May 9 06:04:56 EDT 2011


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

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


           Summary: AdnroidGameView OnTouchEvent Object.GetObject
                    NullReferenceException
    Classification: Mono
           Product: MonoDroid
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Runtime
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: heiko at exdream.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Customer
           Blocker: Yes


Description of Problem:
OpenGL application which is using touch input crashes randomly after some time
if touching the device. If no touches are done, the application remains stable.


Steps to reproduce the problem:
1. Create an opengl application, override AndroidGameView.OnTouchEvent and
touch around.


Actual Results:
Crashing the whole application.


Expected Results:
Not crashing.


How often does this happen? 
Depends on application and on touch behavior. Random timeframe from 1 second to
3 minutes. (When touching)


Additional Information:
Exception log:
01-02 00:18:14.170: INFO/MonoDroid(523): UNHANDLED EXCEPTION:
System.NullReferenceException: Object reference not set to an instance of an
object
01-02 00:18:14.170: INFO/MonoDroid(523): at Java.Lang.Object.GetObject
(intptr,System.Type,bool) <0x00104>
01-02 00:18:14.170: INFO/MonoDroid(523): at
Java.Lang.Object._GetObject<Android.Views.View> (intptr,bool) <0x0004f>
01-02 00:18:14.170: INFO/MonoDroid(523): at
Java.Lang.Object.GetObject<Android.Views.View> (intptr,bool) <0x0002b>
01-02 00:18:14.170: INFO/MonoDroid(523): at
Android.Views.View.n_OnTouchEvent_Landroid_view_MotionEvent_
(intptr,intptr,intptr) <0x00027>
01-02 00:18:14.170: INFO/MonoDroid(523): at (wrapper dynamic-method)
object.e768090b-ef91-4519-9021-fdc2044e373f (intptr,intptr,intptr) <0x00033>
01-02 00:18:14.200: WARN/dalvikvm(523): JNI WARNING: JNI method called with
exception raised
01-02 00:18:14.200: WARN/dalvikvm(523):              in
Ldelta/platforms/monodroid/MonoDroidGameView;.n_onTouchEvent
(Landroid/view/MotionEvent;)Z (GetStaticMethodID)
01-02 00:18:14.200: WARN/dalvikvm(523): Pending exception is:
01-02 00:18:14.200: INFO/dalvikvm(523): java.lang.Throwable:
System.NullReferenceException: Object reference not set to an instance of an
object
01-02 00:18:14.200: INFO/dalvikvm(523): at Java.Lang.Object.GetObject
(intptr,System.Type,bool) <0x00104>
01-02 00:18:14.200: INFO/dalvikvm(523): at
Java.Lang.Object._GetObject<Android.Views.View> (intptr,bool) <0x0004f>
01-02 00:18:14.200: INFO/dalvikvm(523): at
Java.Lang.Object.GetObject<Android.Views.View> (intptr,bool) <0x0002b>
01-02 00:18:14.200: INFO/dalvikvm(523): at
Android.Views.View.n_OnTouchEvent_Landroid_view_MotionEvent_
(intptr,intptr,intptr) <0x00027>
01-02 00:18:14.200: INFO/dalvikvm(523): at (wrapper dynamic-method)
object.e768090b-ef91-4519-9021-fdc2044e373f (intptr,intptr,intptr) <0x00033>
01-02 00:18:14.200: INFO/dalvikvm(523):     at
delta.platforms.monodroid.MonoDroidGameView.n_onTouchEvent(Native Method)
01-02 00:18:14.200: INFO/dalvikvm(523):     at
delta.platforms.monodroid.MonoDroidGameView.onTouchEvent(MonoDroidGameView.java:32)

The offending code seems to be located in this method. Maybe do some checks if
the given pointers are valid?

private static bool n_OnTouchEvent_Landroid_view_MotionEvent_(IntPtr jnienv,
IntPtr native__this, IntPtr native_e)
{
    View view = Object.GetObject<View>(native__this, false); // This line
produces the crash
    MotionEvent e = Object.GetObject<MotionEvent>(native_e, false);
    return view.OnTouchEvent(e);
}

-- 
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