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

Can't enter immersive babylon goalie demo: "SecurityError: The operation is insecure." #26026

Closed
jdm opened this issue Mar 24, 2020 · 5 comments
Closed

Comments

@jdm
Copy link
Member

@jdm jdm commented Mar 24, 2020

joshmatthews@joshmatthews-fcmd6r servo-master % ./mach run https://servo.org/hl-home/
Babylon.js v4.2.0-alpha.5 - WebGL1
[2020-03-24T20:57:15Z ERROR canvas::canvas_data] Unimplemented canvas2d.fillText. Values received: Goalie Trainer, 512, 496.5, None.
[2020-03-24T20:57:15Z ERROR canvas::canvas_data] Unimplemented canvas2d.fillText. Values received: Easy, 512, 554.25, None.
[2020-03-24T20:57:15Z ERROR canvas::canvas_data] Unimplemented canvas2d.fillText. Values received: Hard, 512, 634.25, None.
SecurityError: The operation is insecure.
The operation is insecure.

This is what appears when I click the button to enter immersive mode after loading https://servo.org/hl-home/bbjs/#PPM311#63 on desktop macOS.

@jdm
Copy link
Member Author

@jdm jdm commented Mar 24, 2020

frame #3: 0x0000000102b836c8 servo`_$LT$script..dom..xrsystem..XRSystem$u20$as$u20$script..dom..bindings..codegen..Bindings..XRSystemBinding..XRSystemBinding..XRSystemMethods$GT$::RequestSession::hbea2fec005def977(self=&0x16eaebcc0, mode=Immersive_vr, init=RootedTraceableBox<script::dom::bindings::codegen::Bindings::XRSystemBinding::XRSessionInit> {
ptr: &0x179d5f6e0
}, comp=InRealm {

}) at xrsystem.rs:186:17
   183
   184 	        if mode != XRSessionMode::Inline {
   185 	            if !ScriptThread::is_user_interacting() {
-> 186 	                promise.reject_error(Error::Security);
   187 	                return promise;
   188 	            }
   189
@jdm
Copy link
Member Author

@jdm jdm commented Mar 24, 2020

The call stack shows that this is invoking xr.requestSession from a promise microtask, so we need to propagate the user interaction flag through callbacks appropriately:

@jdm
Copy link
Member Author

@jdm jdm commented Mar 24, 2020

This also affects the drumming demo.

@paulrouget
Copy link
Contributor

@paulrouget paulrouget commented Mar 25, 2020

Why does it not happen on HL? The way the button is clicked?

@paulrouget
Copy link
Contributor

@paulrouget paulrouget commented Mar 25, 2020

Same with timers (setTimeout/setInterval) apparently.

bors-servo added a commit that referenced this issue Mar 26, 2020
Set user interactions for tasks

fix #26026

I need help here. Retrieving the interaction flag from the promise handle crashes.

```rust
let interaction = GetPromiseUserInputEventHandlingState(promise);
```

```
Stack trace for thread "ScriptThread PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(1) }"
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /Users/paul/.cargo/git/checkouts/backtrace-rs-96ebaf1bcb788384/91a0aa4/src/backtrace/libunwind.rs:86
      backtrace::backtrace::trace_unsynchronized
             at /Users/paul/.cargo/git/checkouts/backtrace-rs-96ebaf1bcb788384/91a0aa4/src/backtrace/mod.rs:66
   1: <servo::backtrace::Print as core::fmt::Debug>::fmt
             at ports/glutin/backtrace.rs:49
   2: <&mut W as core::fmt::Write>::write_fmt
   3: std::io::Write::write_fmt
             at /rustc/45ebd5808afd3df7ba842797c0fcd4447ddf30fb/src/libstd/io/mod.rs:1427
   4: servo::backtrace::print
             at ports/glutin/backtrace.rs:17
   5: servo::install_crash_handler::handler
             at ports/glutin/main2.rs:68
   6: <unknown>
   7: _ZN2JS37GetPromiseUserInputEventHandlingStateENS_6HandleIP8JSObjectEE
             at /Users/paul/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/2392ebc/mozjs/js/src/vm/JSObject.h:106
```
@atouchet atouchet added this to Done in HoloLens Mar 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
HoloLens
  
Done
Linked pull requests

Successfully merging a pull request may close this issue.

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