Bug 29678 - OpenGL demo crashes after two minutes in Emulator
Summary: OpenGL demo crashes after two minutes in Emulator
Status: RESOLVED INVALID
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 5.1
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Radek Doulik
URL:
Depends on:
Blocks:
 
Reported: 2015-05-02 22:06 UTC by MPH
Modified: 2017-09-14 18:47 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description MPH 2015-05-02 22:06:14 UTC
The default demo OpenGL/TK project with the spinning, colored cube will crash after approximately two minutes in the Emulator.

This is using Xamarin for Android 5.1.0.115 on Mac OS X 10.10.3.  I've recreated the project, rebooted, and tested with several Android versions, notably 4.0.3 (API 15) and 4.4.2 (API 19) on the Intel x86 architecture with HAXM.

On API 15, the debug log has no output.  On API 19, the output is as follows:

[libEGL] eglMakeCurrent:775 error 3003 (EGL_BAD_ALLOC)
[Mono] DllImport attempting to load: '/system/lib/liblog.so'.
[Mono] DllImport loaded library '/system/lib/liblog.so'.
[Mono] DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').
[Mono] Searching for '__android_log_print'.
[Mono] Probing '__android_log_print'.
[Mono] Found as '__android_log_print'.
[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] OpenTK.Platform.Android.EglException: MakeCurrent failed with error 12291 (0x3003)
[MonoDroid] at OpenTK.Platform.Android.AndroidGraphicsContext.MakeCurrent (OpenTK.Platform.IWindowInfo) <0x001bb>
[MonoDroid] at OpenTK.Platform.Android.AndroidGameView.MakeCurrent () <0x0006a>
[MonoDroid] at OpenTK.Platform.Android.AndroidGameView.RenderFrameInternal (OpenTK.FrameEventArgs) <0x0002d>
[MonoDroid] at OpenTK.Platform.Android.AndroidGameView.RunIteration (System.Threading.CancellationToken) <0x002fb>
[MonoDroid] at OpenTK.Platform.Android.AndroidGameView/<StartThread>c__AnonStorey0.<>m__0 (object) <0x00023>
[MonoDroid] at Android.App.SyncContext/<Send>c__AnonStorey1.<>m__0 () <0x0001b>
[MonoDroid] at Java.Lang.Thread/RunnableImplementor.Run () <0x00027>
[MonoDroid] at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) <0x00034>
[MonoDroid] at (wrapper dynamic-method) object.2c22089f-64d5-44f8-ad0f-4be110dc762c (intptr,intptr) <0x0001f>
[AndroidRuntime] Shutting down VM
[AndroidRuntime] FATAL EXCEPTION: main
[AndroidRuntime] Process: com.companyname.androidtest, PID: 4913
[AndroidRuntime] java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
[AndroidRuntime] 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
[AndroidRuntime] 	at dalvik.system.NativeStart.main(Native Method)
[AndroidRuntime] Caused by: java.lang.reflect.InvocationTargetException
[AndroidRuntime] 	at java.lang.reflect.Method.invokeNative(Native Method)
[AndroidRuntime] 	at java.lang.reflect.Method.invoke(Method.java:515)
[AndroidRuntime] 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
[AndroidRuntime] 	... 2 more
[AndroidRuntime] Caused by: md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable: OpenTK.Platform.Android.EglException: MakeCurrent failed with error 12291 (0x3003)
[AndroidRuntime] at OpenTK.Platform.Android.AndroidGraphicsContext.MakeCurrent (OpenTK.Platform.IWindowInfo) <0x001bb>
[AndroidRuntime] at OpenTK.Platform.Android.AndroidGameView.MakeCurrent () <0x0006a>
[AndroidRuntime] at OpenTK.Platform.Android.AndroidGameView.RenderFrameInternal (OpenTK.FrameEventArgs) <0x0002d>
[AndroidRuntime] at OpenTK.Platform.Android.AndroidGameView.RunIteration (System.Threading.CancellationToken) <0x002fb>
[AndroidRuntime] at OpenTK.Platform.Android.AndroidGameView/<StartThread>c__AnonStorey0.<>m__0 (object) <0x00023>
[AndroidRuntime] at Android.App.SyncContext/<Send>c__AnonStorey1.<>m__0 () <0x0001b>
[AndroidRuntime] at Java.Lang.Thread/RunnableImplementor.Run () <0x00027>
[AndroidRuntime] at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) <0x00034>
[AndroidRuntime] at (wrapper dynamic-method) object.2c22089f-64d5-44f8-ad0f-4be110dc762c (intptr,intptr) <0x0001f>
[AndroidRuntime] 
[AndroidRuntime] 	at mono.java.lang.RunnableImplementor.n_run(Native Method)
[AndroidRuntime] 	at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:29)
[AndroidRuntime] 	at android.os.Handler.handleCallback(Handler.java:733)
[AndroidRuntime] 	at android.os.Handler.dispatchMessage(Handler.java:95)
[AndroidRuntime] 	at android.os.Looper.loop(Looper.java:136)
[AndroidRuntime] 	at android.app.ActivityThread.main(ActivityThread.java:5017)
[AndroidRuntime] 	... 5 more
Comment 1 Rajneesh Kumar 2015-05-04 07:04:20 UTC
I tried to reproduce this issue but not able to reproduce this. To reproduce this issue I have followed the help and instruction provided in bug description.

Steps I followed:

1. Create an android openGL App in XS.
2. Build and deploy app on emulator.
3. Wait for 2-5 minutes.
4. Observed that it does't crash.

Screencast: http://www.screencast.com/t/SG3I9dBtvhc

Could you please let me know that what steps I am missing/wrong OR what steps should I followed to reproduce this issue ? That would be very helpful to reproduce this issue at our end. Also if possible please attach ide logs, environment info and sample to reproduce this issue.

You can get Ide logs via Help=>Open Log Directory=>Ide.Logs (Choose Latest timestamp)
You can get Environment info via=>Xamarin Studio=>About Xamarin Studio=>Show Details=>Copy information. 

Ide Logs: https://gist.github.com/Shruti360/13314297235bb99ba33e
Build Output: https://gist.github.com/Shruti360/03c1b4e66939c38ad6b6
Application Output: https://gist.github.com/Shruti360/72e0da2aedd9329569a6

Environment Info:

=== Xamarin Studio ===
 
Version 5.9 (build 457)
Installation UUID: 67eaf3b4-f8a7-4ab4-a9df-3197350ca5dc
Runtime:
	Mono 4.0.1 ((detached/373d684)
	GTK+ 2.24.23 (Raleigh theme)
 
	Package version: 400000009
 
=== Apple Developer Tools ===
 
Xcode 6.3 (7569)
Build 6D570
 
=== Xamarin.iOS ===
 
Version: 8.11.0.651 (Enterprise Edition)
Hash: 4891f88
Branch: master
Build date: 2015-04-30 12:54:57-0400
 
=== Xamarin.Android ===
 
Version: 5.1.0.115 (Enterprise Edition)
Android SDK: /Users/ixamarin78/Desktop/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
 
=== Xamarin Android Player ===
 
Version: Unknown version
Location: /Applications/Xamarin Android Player.app
 
=== Xamarin.Mac ===
 
Version: 2.0.0.273 (Enterprise Edition)
 
=== Build Information ===
 
Release ID: 509000457
Git revision: c27961c1dcfe2f8b5e5bb525c5dff33ce18a873c
Build date: 2015-04-30 19:35:14-04
Xamarin addins: df9b5918c9f7aca6da509fe3e5a62553aa101910
 
=== Operating System ===
 
Mac OS X 10.10.3
Darwin XamnewiMac.local 14.3.0 Darwin Kernel Version 14.3.0
    Mon Mar 23 11:59:05 PDT 2015
    root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
Comment 2 David Schulte 2015-05-11 15:08:39 UTC
We too are seeing similar problems using Xamarin.Android 4.20.2.1 and Android 4.4.2. This error seems to be a bit random in nature, so it may be hard to reproduce. Below is a stack trace of one of our more recent occurrences.

[InputMethodManager] [IMM] checkFocusNoStartInput - ic.finishComposingText() must be called on the main looper
[Surface] dequeueBuffer: IGraphicBufferProducer::requestBuffer failed: -2147483646
[Surface] dequeueBuffer failed (Unknown error 2147483646)
[ViewRootImpl] Could not lock surface
[ViewRootImpl] java.lang.IllegalArgumentException
[ViewRootImpl] 	at android.view.Surface.nativeLockCanvas(Native Method)
[ViewRootImpl] 	at android.view.Surface.lockCanvas(Surface.java:253)
[ViewRootImpl] 	at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2760)
[ViewRootImpl] 	at android.view.ViewRootImpl.draw(ViewRootImpl.java:2734)
[ViewRootImpl] 	at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2572)
[ViewRootImpl] 	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2144)
[ViewRootImpl] 	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1235)
[ViewRootImpl] 	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6472)
[ViewRootImpl] 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803)
[ViewRootImpl] 	at android.view.Choreographer.doCallbacks(Choreographer.java:603)
[ViewRootImpl] 	at android.view.Choreographer.doFrame(Choreographer.java:573)
[ViewRootImpl] 	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789)
[ViewRootImpl] 	at android.os.Handler.handleCallback(Handler.java:733)
[ViewRootImpl] 	at android.os.Handler.dispatchMessage(Handler.java:95)
[ViewRootImpl] 	at android.os.Looper.loop(Looper.java:157)
[ViewRootImpl] 	at android.os.HandlerThread.run(HandlerThread.java:61)
[Surface] dequeueBuffer: IGraphicBufferProducer::requestBuffer failed: -2147483646
[libEGL] eglMakeCurrent:796 error 3003 (EGL_BAD_ALLOC)
[AndroidRuntime] Shutting down VM
[AndroidRuntime] FATAL EXCEPTION: main
[AndroidRuntime] Process: TargetMobile.TargetMobile, PID: 24905
[AndroidRuntime] java.lang.IllegalStateException: eglMakeCurrent failed EGL_BAD_ALLOC
[AndroidRuntime] 	at android.view.HardwareRenderer$GlRenderer.createSurface(HardwareRenderer.java:1354)
[AndroidRuntime] 	at android.view.HardwareRenderer$GlRenderer.createEglSurface(HardwareRenderer.java:1241)
[AndroidRuntime] 	at android.view.HardwareRenderer$GlRenderer.initialize(HardwareRenderer.java:1058)
[AndroidRuntime] 	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1811)
[AndroidRuntime] 	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1235)
[AndroidRuntime] 	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6472)
[AndroidRuntime] 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803)
[AndroidRuntime] 	at android.view.Choreographer.doCallbacks(Choreographer.java:603)
[AndroidRuntime] 	at android.view.Choreographer.doFrame(Choreographer.java:573)
[AndroidRuntime] 	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789)
[AndroidRuntime] 	at android.os.Handler.handleCallback(Handler.java:733)
[AndroidRuntime] 	at android.os.Handler.dispatchMessage(Handler.java:95)
[AndroidRuntime] 	at android.os.Looper.loop(Looper.java:157)
[AndroidRuntime] 	at android.app.ActivityThread.main(ActivityThread.java:5356)
[AndroidRuntime] 	at java.lang.reflect.Method.invokeNative(Native Method)
[AndroidRuntime] 	at java.lang.reflect.Method.invoke(Method.java:515)
[AndroidRuntime] 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
[AndroidRuntime] 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
[AndroidRuntime] 	at dalvik.system.NativeStart.main(Native Method)

Below is the version of Xamarin and supporting modules that we are using.
=== Xamarin Studio ===

Version 5.9 (build 431)
Installation UUID: 6f7c36db-b063-41d3-aa0d-4184811018e8
Runtime:
	Mono 4.0.0 ((detached/d136b79)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400000143

=== Apple Developer Tools ===

Not Found

=== Xamarin.Android ===

Version: 4.20.2.1 (Business Edition)
Android SDK: /Users/xxx/adt-bundle-mac-x86_64/sdk
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

=== Xamarin Android Player ===

Not Installed

=== Xamarin.Mac ===

Not Installed

=== Xamarin.iOS ===

Version: 8.10.0.267 (Starter Edition)
Hash: 6481535
Branch: master
Build date: 2015-04-27 04:38:13-0400

=== Build Information ===

Release ID: 509000431
Git revision: 7560726734fc7267de2fa9abed2509968deefaa8
Build date: 2015-04-17 19:25:48-04
Xamarin addins: 2e772c734ab3148054eae7bf8949f340fdeb5e5e

=== Operating System ===

Mac OS X 10.10.3
Darwin XXX.local 14.3.0 Darwin Kernel Version 14.3.0
    Mon Mar 23 11:59:05 PDT 2015
    root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
Comment 3 Jon Douglas [MSFT] 2017-09-14 18:47:26 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Android. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.