-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[expo-gl] Fix crash when debugging remotely #10381
Merged
sjchmiela
merged 4 commits into
master
from
@sjchmiela/fix-expo-gl-cpp-without-valid-jsrunner
Sep 29, 2020
Merged
[expo-gl] Fix crash when debugging remotely #10381
sjchmiela
merged 4 commits into
master
from
@sjchmiela/fix-expo-gl-cpp-without-valid-jsrunner
Sep 29, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tsapeta
approved these changes
Sep 25, 2020
wkozyra95
approved these changes
Sep 25, 2020
bbarthec
approved these changes
Sep 28, 2020
sjchmiela
deleted the
@sjchmiela/fix-expo-gl-cpp-without-valid-jsrunner
branch
September 29, 2020 07:12
sjchmiela
added a commit
that referenced
this pull request
Sep 29, 2020
One of the reasons for #10284. One of the crashes was coming from native: ``` 2020-09-25 14:30:36.831 17563-17563/? A/DEBUG: #00 pc 00066604 /data/app/~~WpbR_l3nGtiGFWRkbZPEJg==/host.exp.exponent-8fNpD6xuMcBS80u997afBA==/lib/x86/libexpo-gl.so (expo::gl_cpp::EXGLContext::EXGLContext(facebook::jsi::Runtime&, unsigned int)+164) (BuildId: 7e5a0967a575c573c4727065d29b4c52a818e77a) 2020-09-25 14:30:36.831 17563-17563/? A/DEBUG: #1 pc 000664c0 /data/app/~~WpbR_l3nGtiGFWRkbZPEJg==/host.exp.exponent-8fNpD6xuMcBS80u997afBA==/lib/x86/libexpo-gl.so (expo::gl_cpp::EXGLContext::ContextCreate(facebook::jsi::Runtime&)+384) (BuildId: 7e5a0967a575c573c4727065d29b4c52a818e77a) 2020-09-25 14:30:36.831 17563-17563/? A/DEBUG: #2 pc 00046e90 /data/app/~~WpbR_l3nGtiGFWRkbZPEJg==/host.exp.exponent-8fNpD6xuMcBS80u997afBA==/lib/x86/libexpo-gl.so (UEXGLContextCreate+32) (BuildId: 7e5a0967a575c573c4727065d29b4c52a818e77a) 2020-09-25 14:30:36.831 17563-17563/? A/DEBUG: #3 pc 00125860 /data/app/~~WpbR_l3nGtiGFWRkbZPEJg==/host.exp.exponent-8fNpD6xuMcBS80u997afBA==/lib/x86/libexpo-gl.so (Java_expo_modules_gl_cpp_EXGL_EXGLContextCreate+32) (BuildId: 7e5a0967a575c573c4727065d29b4c52a818e77a) ``` After ensuring `expo-gl` won't try to create a context for an invalid JS context reference the crash stopped occurring. Mounting a `GLView` resulted in an unhandled Promise rejection: ``` [Unhandled promise rejection: TypeError: Cannot read property '-1' of undefined] * /Users/sjchmiela/Applications/expo/packages/expo-gl/build/GLView.js:332:15 in getGl * http://192.168.0.112:19000/__generated__/AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:292922:50 in createContextAsync$ * /Users/sjchmiela/Applications/expo/node_modules/regenerator-runtime/runtime.js:45:39 in tryCatch * /Users/sjchmiela/Applications/expo/node_modules/regenerator-runtime/runtime.js:274:21 in invoke * /Users/sjchmiela/Applications/expo/node_modules/regenerator-runtime/runtime.js:97:20 in prototype.method * /Users/sjchmiela/Applications/expo/node_modules/regenerator-runtime/runtime.js:45:39 in tryCatch * /Users/sjchmiela/Applications/expo/node_modules/regenerator-runtime/runtime.js:135:19 in invoke * /Users/sjchmiela/Applications/expo/node_modules/regenerator-runtime/runtime.js:145:12 in PromiseImpl.resolve.then$argument_0 * /Users/sjchmiela/Applications/expo/react-native-lab/react-native/node_modules/promise/setimmediate/core.js:37:11 in tryCallOne * /Users/sjchmiela/Applications/expo/react-native-lab/react-native/node_modules/promise/setimmediate/core.js:123:14 in setImmediate$argument_0 ``` so I decided to make it more readable. Now it's ``` [Unhandled promise rejection: Error: GL is currently not available. (Have you enabled remote debugging? GL is not available while debugging remotely.)] * /Users/sjchmiela/Applications/expo/packages/expo-gl/build/GLView.js:333:9 in getGl * http://192.168.0.112:19000/__generated__/AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:292922:50 in createContextAsync$ * /Users/sjchmiela/Applications/expo/node_modules/regenerator-runtime/runtime.js:45:39 in tryCatch * /Users/sjchmiela/Applications/expo/node_modules/regenerator-runtime/runtime.js:274:21 in invoke * /Users/sjchmiela/Applications/expo/node_modules/regenerator-runtime/runtime.js:97:20 in prototype.method * /Users/sjchmiela/Applications/expo/node_modules/regenerator-runtime/runtime.js:45:39 in tryCatch * /Users/sjchmiela/Applications/expo/node_modules/regenerator-runtime/runtime.js:135:19 in invoke * /Users/sjchmiela/Applications/expo/node_modules/regenerator-runtime/runtime.js:145:12 in PromiseImpl.resolve.then$argument_0 * /Users/sjchmiela/Applications/expo/react-native-lab/react-native/node_modules/promise/setimmediate/core.js:37:11 in tryCallOne * /Users/sjchmiela/Applications/expo/react-native-lab/react-native/node_modules/promise/setimmediate/core.js:123:14 in setImmediate$argument_0 ``` I have ensured that debugging remotely doesn't crash the application if this is the only reason to do so.
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
One of the reasons for #10284.
How
One of the crashes was coming from native:
After ensuring
expo-gl
won't try to create a context for an invalid JS context reference the crash stopped occurring.Mounting a
GLView
resulted in an unhandled Promise rejection:so I decided to make it more readable. Now it's
Test Plan
I have ensured that debugging remotely doesn't crash the application if this is the only reason to do so.