stephen-riley / regexworkbench

A Visual Studio Code extension that allows one to easily play with regular expressions
15 stars 8 forks source link

Regular expression workbench regularly crashes the extension host with the following error #9

Closed cwoollard closed 4 years ago

cwoollard commented 4 years ago

`/Users/chris/.vscode/extensions/stephen-riley.regexworkbench-2.0.4/node_modules/@stephen-riley/pcre2-wasm/dist/libpcre2.js:1 (function (exports, require, module, filename, dirname) { var Module=typeof Module!=="undefined"?Module:{};!function(){const{resolve:resolve}=require("path");Module.locateFile=function(file){return resolve(_dirname,file)};Module.loaded=new Promise(resolve=>{Module.onRuntimeInitialized=resolve})}();var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_HAS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="

RuntimeError: abort(cannot get client for: Bitbucket ... Error: getaddrinfo ENOTFOUND bitbucket.org) at Error: at jsStackTrace (/Users/chris/.vscode/extensions/stephen-riley.regexworkbench-2.0.4/node_modules/@stephen-riley/pcre2-wasm/dist/libpcre2.js:1:22439) at stackTrace (/Users/chris/.vscode/extensions/stephen-riley.regexworkbench-2.0.4/node_modules/@stephen-riley/pcre2-wasm/dist/libpcre2.js:1:22610) at process.abort (/Users/chris/.vscode/extensions/stephen-riley.regexworkbench-2.0.4/node_modules/@stephen-riley/pcre2-wasm/dist/libpcre2.js:1:18716) at process.emit (events.js:205:15) at process.m [as emit] (/Users/chris/.vscode/extensions/shan.code-settings-sync-3.4.3/out/extension.js:219:26653) at processPromiseRejections (internal/process/promises.js:165:18) at processTicksAndRejections (internal/process/task_queues.js:90:32) at process.abort (/Users/chris/.vscode/extensions/stephen-riley.regexworkbench-2.0.4/node_modules/@stephen-riley/pcre2-wasm/dist/libpcre2.js:1:18747) at process.emit (events.js:205:15) at process.m [as emit] (/Users/chris/.vscode/extensions/shan.code-settings-sync-3.4.3/out/extension.js:219:26653) at processPromiseRejections (internal/process/promises.js:165:18) at processTicksAndRejections (internal/process/task_queues.js:90:32)

Extension host terminated unexpectedly. Code: 7 Signal: null `

netsrotr commented 4 years ago

Same here: see attached more complete log: vs.code.regex.workbench-crash.log

drmikecrowe commented 4 years ago

For me, this happened on the second VSCode install where Setting Sync installed workbench in the background.

RuntimeError: abort(TypeError: Cannot read property 'onDidEndTour' of undefined)

stephen-riley commented 4 years ago

@cwoollard , @netsrotr , and @drmikecrowe: thanks for the feedback! (Sorry for the delay, been on COVID duty. 🙄)

It appears from this and other issues I've had that other extensions' issues are bleeding over into this one. I don't know if it's something I'm doing wrong, or the VS Code extension host is doing wrong, or whether I can code this more defensively... I'm looking into it. Thanks again for the details, they help!

stephen-riley commented 4 years ago

Okay, I traced this down to the emscripten-generated abort() function from libpcre2.js. It's catching everything thrown and raising an exception that crashes the extension host. So I need to make pcre2-wasm play nicer with other modules.

stephen-riley commented 4 years ago

Fixed in commit 9ad66a5