Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGLThread panic while loading https://aframe.io/examples on Android #21993

Closed
ferjm opened this issue Oct 21, 2018 · 9 comments
Closed

WebGLThread panic while loading https://aframe.io/examples on Android #21993

ferjm opened this issue Oct 21, 2018 · 9 comments

Comments

@ferjm
Copy link
Member

@ferjm ferjm commented Oct 21, 2018

https://aframe.io/examples is unresponsive and never ends loading.

10-21 19:42:26.577 23447 23463 I simpleservo: load_uri: https://aframe.io/
10-21 19:42:26.579 23447 23486 I simpleservo: ResourceReader::read(rippy.png)
10-21 19:42:26.586  1650  1650 I PhenotypeExpConfig: com.google.android.apps.inputmethod.libs.experiments.PhenotypeExperimentConfiguration: refreshConfiguration() : Force = false : UpdateAvailable = false : Age = 51 minutes : MaxAge = 720 minutes
10-21 19:42:26.586  1650  1650 I LatinIme: com.google.android.apps.inputmethod.libs.latin5.LatinIme: onDeactivate()
10-21 19:42:27.144  2267 17049 I Icing   : Indexing com.google.android.gm-internal.3p:EmailMessage from com.google.android.gm
10-21 19:42:27.182  2267 17049 I Icing   : Indexing done com.google.android.gm-internal.3p:EmailMessage
10-21 19:42:27.686 23447 23490 D skia    : Device does NOT support ARM NEON instructions!
10-21 19:42:27.788 23447 23530 E simpleservo: Error at https://aframe.io/js/common.js:2:162 $ is not defined
10-21 19:42:28.243 23447 23466 D simpleservo: No DPDB device match.
10-21 19:42:28.243 23447 23466 D simpleservo: Failed to recalculate device parameters.
10-21 19:42:28.244 23447 23466 D simpleservo: Using fallback Android device measurements.
10-21 19:42:28.321  2267 17049 I Icing   : Indexing com.google.android.gm-internal.3p:EmailMessage from com.google.android.gm
10-21 19:42:28.367 23447 23466 D simpleservo: A-Frame Version: 0.8.2 (Date 2018-04-15, Commit #b20527f)
10-21 19:42:28.367 23447 23466 D simpleservo: three Version:
10-21 19:42:28.367 23447 23466 D simpleservo: github:supermedium/three.js#r90fixMTLLoader
10-21 19:42:28.367 23447 23466 D simpleservo: WebVR Polyfill Version:
10-21 19:42:28.367 23447 23466 D simpleservo: ^0.10.5
10-21 19:42:28.368 23447 23685 W GStreamer+GST_ELEMENT_FACTORY: 0:00:16.845648970 0xc19bd060 gstelementfactory.c:456:gst_element_factory_make no such element factory "scaletempo"!
10-21 19:42:28.368 23447 23685 W GLib    : GstPlayer: scaletempo element not available. Audio pitch will not be preserved during trick modes
10-21 19:42:28.377 23447 23466 D simpleservo: THREE.WebGLRenderer
10-21 19:42:28.377 23447 23466 D simpleservo: 90
10-21 19:42:28.385 23447 23485 E simpleservo: Last GL operation failed: GetExtensions(WebGLSender(..))
10-21 19:42:28.385 23447 23466 D simpleservo: thread 'WebGLThread' panicked at 'assertion failed: `(left == right)`
10-21 19:42:28.385 23447 23466 D simpleservo:   left: `1280`,
10-21 19:42:28.385 23447 23466 D simpleservo:  right: `0`: Unexpected WebGL error: 0x500 (1280)', components/canvas/webgl_thread.rs:1231:9
10-21 19:42:28.385 23447 23466 D simpleservo: note: Run with `RUST_BACKTRACE=1` for a backtrace.
10-21 19:42:28.385 23447 23466 D simpleservo: THREE.WebGLRenderer: WEBGL_depth_texture extension not supported.
10-21 19:42:28.385 23447 23466 D simpleservo: THREE.WebGLRenderer: ANGLE_instanced_arrays extension not supported.
@nox
Copy link
Member

@nox nox commented Nov 20, 2018

AFAIK recent OpenGL versions don't like glGetString(GL_EXTENSIONS), the GetExtensions stuff should probably be reimplemented with glGetStringi.

@jdm
Copy link
Member

@jdm jdm commented Aug 30, 2019

This was probably fixed by #24055.

@jdm jdm added the C-is-this-done label Aug 30, 2019
@asajeffrey
Copy link
Member

@asajeffrey asajeffrey commented Sep 3, 2019

I'm seeing this on MacOS on https://www.joshmatthews.net/demos/lamp.html

assertion failed: `(left == right)`
  left: `1280`,
 right: `0`: Unexpected WebGL error: 0x500 (1280) (thread WebGL thread, at components/canvas/webgl_thread.rs:1566)
stack backtrace:
   0: __ZN9backtrace9backtrace5trace17hcc8b472f5f9a492fE (0x111d95b1b)
   1: __ZN9backtrace7capture9Backtrace3new17hc3f3beeabc50169eE (0x111d94d07)
   2: __ZN5servo4main28_$u7b$$u7b$closure$u7d$$u7d$17h167dc8a19a30045aE (0x10ef5fb7b)
   3: __ZN3std9panicking20rust_panic_with_hook17h099fe3773ce1a793E (0x111f21b91)
   4: __ZN3std9panicking18continue_panic_fmt17h8a4b76634870b383E (0x111f215fc)
   5: __ZN3std9panicking15begin_panic_fmt17hd8effa78bdafa918E (0x111f2155d)
   6: __ZN6canvas12webgl_thread9WebGLImpl5apply17h619eb08cf51898acE (0x1116231ca)
   7: __ZN6canvas12webgl_thread11WebGLThread10handle_msg17h3acb546d266489ccE.llvm.1569179447716100275 (0x111614899)
   8: __ZN6canvas12webgl_thread11WebGLThread7process17h6cd810e725961106E (0x111613237)
   9: __ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h113b23693ba0a429E (0x1115f672c)
  10: __ZN3std9panicking3try7do_call17ha798e4151ea04539E.llvm.791569682819744604 (0x11167c471)
  11: ___rust_maybe_catch_panic (0x111f29f2e)
  12: __ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h5f00f8b678a57938E (0x111627ef4)
  13: __ZN83_$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$9call_once17hb03304ace7f89c63E (0x111f112bd)
  14: __ZN3std3sys4unix6thread6Thread3new12thread_start17hd2d570f25bb299f3E (0x111f2945d)
  15: __pthread_body (0x7fff6f7be2ea)
  16: __pthread_start (0x7fff6f7c1248)
[2019-09-03T14:53:34Z ERROR servo] assertion failed: `(left == right)`
  left: `1280`,
 right: `0`: Unexpected WebGL error: 0x500 (1280)
called `Result::unwrap()` on an `Err` value: () (thread ScriptThread PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(1) }, at src/libcore/result.rs:1084)
stack backtrace:
   0: __ZN9backtrace9backtrace5trace17hcc8b472f5f9a492fE (0x111d95b1b)
   1: __ZN9backtrace7capture9Backtrace3new17hc3f3beeabc50169eE (0x111d94d07)
   2: __ZN5servo4main28_$u7b$$u7b$closure$u7d$$u7d$17h167dc8a19a30045aE (0x10ef5fb7b)
   3: __ZN3std9panicking20rust_panic_with_hook17h099fe3773ce1a793E (0x111f21b91)
   4: __ZN3std9panicking18continue_panic_fmt17h8a4b76634870b383E (0x111f215fc)
   5: _rust_begin_unwind (0x111f214f8)
   6: __ZN4core9panicking9panic_fmt17h885799c19d2b8b0cE (0x111f41d2e)
   7: __ZN4core6result13unwrap_failed17h91161a3faccc6622E (0x111f41e08)
   8: __ZN208_$LT$script..dom..webglrenderingcontext..WebGLRenderingContext$u20$as$u20$script..dom..bindings..codegen..Bindings..WebGLRenderingContextBinding..WebGLRenderingContextBinding..WebGLRenderingContextMethods$GT$24GetShaderPrecisionFormat17h9dccfe699a020935E (0x10fc30890)
   9: __ZN101_$LT$std..panic..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$9call_once17h3de929e841ce6153E (0x10f855b3c)
  10: __ZN3std9panicking3try7do_call17h9588b1ccfd1452c5E.llvm.2287604874008334462 (0x10f50d97b)
  11: ___rust_maybe_catch_panic (0x111f29f2e)
  12: __ZN6script3dom8bindings7codegen8Bindings28WebGLRenderingContextBinding28WebGLRenderingContextBinding24getShaderPrecisionFormat17h37dd0a133135a062E (0x10f6a1183)
  13: _CallJitMethodOp (0x1102c8bd1)
  14: __ZN6script3dom8bindings5utils12generic_call17hfdcb7365d5dc5d99E (0x10f593edc)
  15: __ZN6script3dom8bindings5utils14generic_method17h9f41701f09ee5500E (0x10f594031)
  16: __ZN2js23InternalCallOrConstructEP9JSContextRKN2JS8CallArgsENS_14MaybeConstructE (0x1102ef7a6)
  17: __ZL9InterpretP9JSContextRN2js8RunStateE (0x1102e91b8)
  18: __ZN2js9RunScriptEP9JSContextRNS_8RunStateE (0x1102dedef)
  19: __ZN2js13ExecuteKernelEP9JSContextN2JS6HandleIP8JSScriptEER8JSObjectRKNS2_5ValueENS_16AbstractFramePtrEPS9_ (0x1102f0a7f)
  20: __ZN2js7ExecuteEP9JSContextN2JS6HandleIP8JSScriptEER8JSObjectPNS2_5ValueE (0x1102f0c0b)
  21: __ZL8EvaluateP9JSContextN2js9ScopeKindEN2JS6HandleIP8JSObjectEERKNS3_22ReadOnlyCompileOptionsERNS3_10SourceTextIDsEENS3_13MutableHandleINS3_5ValueEEE (0x110381ae1)
  22: __ZN2JS12EvaluateUtf8EP9JSContextRKNS_22ReadOnlyCompileOptionsEPKcmNS_13MutableHandleINS_5ValueEEE (0x11038164c)
  23: __ZN14profile_traits4time7profile17h86274ea813c8e0bbE (0x10fd8d6cf)
  24: __ZN6script3dom11globalscope11GlobalScope37evaluate_script_on_global_with_result17h5fcf6d43658f07baE (0x10fbf496b)
  25: __ZN6script3dom17htmlscriptelement17HTMLScriptElement20run_a_classic_script17hfbaf59b8421f6f2bE (0x10fd36aeb)
  26: __ZN6script3dom17htmlscriptelement17HTMLScriptElement7execute17h7b5bb50423ae0273E (0x10fd35aec)
  27: __ZN6script3dom17htmlscriptelement17HTMLScriptElement7prepare17h2c4af22127db9358E (0x10fd33dbb)
  28: __ZN6script3dom11servoparser11ServoParser13do_parse_sync17h10ff4c06ba4f6d6eE (0x10fc1022e)
  29: __ZN14profile_traits4time7profile17h06648f974c4c3ad3E (0x10fd8aadd)
  30: __ZN6script3dom11servoparser11ServoParser10parse_sync17hb7e9cf1ce43cb1c2E.llvm.9861599294906097670 (0x10fc0fdae)
  31: __ZN6script3dom11servoparser11ServoParser43resume_with_pending_parsing_blocking_script17h9b4e17f141a036b8E (0x10fc0e947)
  32: __ZN6script3dom8document8Document39process_pending_parsing_blocking_script17h5ce047c99b6c4f1dE (0x10fbdaeed)
  33: __ZN6script3dom8document8Document38pending_parsing_blocking_script_loaded17h2a8c5a679950bda7E (0x10fbdaa9e)
  34: __ZN99_$LT$script..dom..htmlscriptelement..ScriptContext$u20$as$u20$net_traits..FetchResponseListener$GT$20process_response_eof17h13f89df3978a92c4E (0x10fd32865)
  35: __ZN76_$LT$net_traits..FetchResponseMsg$u20$as$u20$net_traits..Action$LT$T$GT$$GT$7process17hcb213968517b941eE (0x110056db7)
  36: __ZN101_$LT$script..network_listener..ListenerTask$LT$A$C$Listener$GT$$u20$as$u20$script..task..TaskOnce$GT$8run_once17hdebdb50fe0e907cfE (0x10fef445c)
  37: __ZN43_$LT$T$u20$as$u20$script..task..TaskBox$GT$7run_box17hd44859c1537fa138E (0x11007fa0e)
  38: __ZN6script13script_thread12ScriptThread22handle_msg_from_script17h74e2f7a20e7f0cffE (0x10fc5fd97)
  39: __ZN6script13script_thread12ScriptThread11handle_msgs17h54af4014b8fc8d3cE.llvm.9861599294906097670 (0x10fc5776b)
  40: __ZN14profile_traits3mem12ProfilerChan25run_with_memory_reporting17hefa8676c53b37e03E (0x10fd8a4f7)
  41: __ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h0f7d1a5666f3634eE (0x10f553dfc)
  42: __ZN3std9panicking3try7do_call17hacfa6be0a736e414E.llvm.2287604874008334462 (0x10f515c8a)
  43: ___rust_maybe_catch_panic (0x111f29f2e)
  44: __ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17hbc2dc4e9c1ef9ad5E (0x10f741745)
  45: __ZN83_$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$9call_once17hb03304ace7f89c63E (0x111f112bd)
  46: __ZN3std3sys4unix6thread6Thread3new12thread_start17hd2d570f25bb299f3E (0x111f2945d)
  47: __pthread_body (0x7fff6f7be2ea)
  48: __pthread_start (0x7fff6f7c1248)
[2019-09-03T14:53:34Z ERROR servo] called `Result::unwrap()` on an `Err` value: ()
@jdm
Copy link
Member

@jdm jdm commented Sep 3, 2019

@asajeffrey That's fixed by #24111.

@asajeffrey
Copy link
Member

@asajeffrey asajeffrey commented Sep 3, 2019

Er, is it? This panic is caused by GetExtensions erroring, which was addressed by #24055, but

gl.get_integer_v(gl::NUM_EXTENSIONS, &mut ext_count);
produces error 0x500 for me.

@jdm
Copy link
Member

@jdm jdm commented Sep 3, 2019

Oh dear.

@jdm
Copy link
Member

@jdm jdm commented Sep 3, 2019

We may need to make the fix from #24055 conditional on whether it's a webgl 1 or webgl 2 context.

@asajeffrey
Copy link
Member

@asajeffrey asajeffrey commented Sep 3, 2019

The following fixes the panic, but isn't exactly lovely:

$ git diff
diff --git a/components/canvas/webgl_thread.rs b/components/canvas/webgl_thread.rs
index 7844c762cf..d0d8bf2021 100644
--- a/components/canvas/webgl_thread.rs
+++ b/components/canvas/webgl_thread.rs
@@ -1727,6 +1727,11 @@ impl WebGLImpl {
         unsafe {
             gl.get_integer_v(gl::NUM_EXTENSIONS, &mut ext_count);
         }
+        // Fall back to the depricated extensions API if that fails
+        if gl.get_error() != gl::NO_ERROR {
+            chan.send(gl.get_string(gl::EXTENSIONS)).unwrap();
+           return;
+        }
         let ext_count = ext_count[0] as usize;
         let mut extensions = Vec::with_capacity(ext_count);
         for idx in 0..ext_count {
@asajeffrey
Copy link
Member

@asajeffrey asajeffrey commented Sep 3, 2019

It would be nicer to use the GL version to determine which API to use, but who knows if that will work with all drivers?

bors-servo added a commit that referenced this issue Sep 3, 2019
…earth

Fallback to old extensions API if NUM_EXTENSIONS errors

<!-- Please describe your changes on the following line: -->

Fixes a panic querying extensions in WebGL 1.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #21993
- [x] These changes do not require tests because it fixes a panic

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24128)
<!-- Reviewable:end -->
@bors-servo bors-servo closed this in dc3b0b7 Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.