-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Segmentation fault running "render reports an error when the request function responds with an error" test on node4-clang39-release #11281
Comments
For what it's worth, I ran |
Aha, I think I see the problem here (and it's nothing to do with #11005) -- although it's up to GC, we can potentially tear down the 🤔This sort of problem might cause an api-gl crash too? |
Er, actually all I've learned today is that I don't really understand node bindings, behavior changes between different versions of node, and GC timing is out to trick me... But -- what's supposed to happen when I've gotten confused in debugging by the way node will exit the process as soon as it's done running javascript (so there can be trailing calls on the C++ side that never happen), but I don't think it's relevant to this particular crash since this crash didn't happen at the end of the test run. |
So... I took the failing test: mapbox-gl-native/platform/node/test/js/request.test.js Lines 8 to 25 in dfb9b26
... and modified the code to intentionally delay one of the callbacks:
I then logged the constructor and destructor for all the
If GC didn't happen, then after the "Deferred error message", you'd see a "Processing response" message, but the destructor for What's interesting to me here is I think it's showing that the mapbox-gl-native/platform/node/src/node_map.cpp Lines 1155 to 1172 in dfb9b26
That Can anyone who's worked with the node bindings more tell me if I've gone off the deep end or if this sounds possible? |
I think my hypothesis may be right. I can pretty reliably trigger what looks like the same crash in a debugger by adding these lines just before the
Now I need to figure out a way to identify when we're in this grey zone of "not yet garbage collected but could be collected at any time so it's unsafe to call into v8". |
Avoids a potential crash if garbage collection happens in the middle of a call to NodeMap::request from a map that's eligible for GC. Fixes issue #11281
Avoids a potential crash if garbage collection happens in the middle of a call to NodeMap::request from a map that's eligible for GC. Fixes issue #11281
Fixed in #11298. |
Avoids a potential crash if garbage collection happens in the middle of a call to NodeMap::request from a map that's eligible for GC. Fixes issue #11281
Avoids a potential crash if garbage collection happens in the middle of a call to NodeMap::request from a map that's eligible for GC. Fixes issue #11281
Seen at https://circleci.com/gh/mapbox/mapbox-gl-native/74690?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link. Went away after re-running build.
@kkaefer I haven't really looked at this, but you touched threading code recently in #11005, does anything below ring any bells for you?
The text was updated successfully, but these errors were encountered: