@agoric/xsnap 0.14.3-u17.1 → 0.14.3-u18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.js +1 -1
- package/build.env +1 -1
- package/package.json +15 -15
- package/src/build.js +1 -1
- package/src/replay.js +1 -1
- package/src/xsnap.js +3 -3
- package/src/xsrepl.js +1 -1
- package/xsnap-native/xsnap/sources/xsnap-worker.c +16 -0
package/api.js
CHANGED
package/build.env
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
MODDABLE_URL=https://github.com/agoric-labs/moddable.git
|
|
2
2
|
MODDABLE_COMMIT_HASH=f6c5951fc055e4ca592b9166b9ae3cbb9cca6bf0
|
|
3
3
|
XSNAP_NATIVE_URL=https://github.com/agoric-labs/xsnap-pub
|
|
4
|
-
XSNAP_NATIVE_COMMIT_HASH=
|
|
4
|
+
XSNAP_NATIVE_COMMIT_HASH=105bc6862050695b1723fa76df91564fe8111a37
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/xsnap",
|
|
3
|
-
"version": "0.14.3-
|
|
3
|
+
"version": "0.14.3-u18.0",
|
|
4
4
|
"description": "Snapshotting VM worker based on Moddable's XS Javascript engine",
|
|
5
5
|
"author": "Agoric",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,22 +28,22 @@
|
|
|
28
28
|
"test:xs": "exit 0"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@agoric/internal": "^0.4.0-
|
|
32
|
-
"@agoric/xsnap-lockdown": "^0.14.1-
|
|
33
|
-
"@endo/bundle-source": "^3.4.
|
|
34
|
-
"@endo/errors": "^1.2.
|
|
35
|
-
"@endo/eventual-send": "^1.2.
|
|
36
|
-
"@endo/init": "^1.1.
|
|
37
|
-
"@endo/netstring": "^1.0.
|
|
38
|
-
"@endo/promise-kit": "^1.1.
|
|
39
|
-
"@endo/stream": "^1.2.
|
|
40
|
-
"@endo/stream-node": "^1.1.
|
|
31
|
+
"@agoric/internal": "^0.4.0-u18.0",
|
|
32
|
+
"@agoric/xsnap-lockdown": "^0.14.1-u18.0",
|
|
33
|
+
"@endo/bundle-source": "^3.4.2",
|
|
34
|
+
"@endo/errors": "^1.2.7",
|
|
35
|
+
"@endo/eventual-send": "^1.2.7",
|
|
36
|
+
"@endo/init": "^1.1.6",
|
|
37
|
+
"@endo/netstring": "^1.0.12",
|
|
38
|
+
"@endo/promise-kit": "^1.1.7",
|
|
39
|
+
"@endo/stream": "^1.2.7",
|
|
40
|
+
"@endo/stream-node": "^1.1.7",
|
|
41
41
|
"glob": "^7.1.6",
|
|
42
42
|
"tmp": "^0.2.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@endo/base64": "^1.0.
|
|
46
|
-
"@endo/nat": "^5.0.
|
|
45
|
+
"@endo/base64": "^1.0.8",
|
|
46
|
+
"@endo/nat": "^5.0.12",
|
|
47
47
|
"@types/glob": "^8.1.0",
|
|
48
48
|
"ava": "^5.3.0",
|
|
49
49
|
"c8": "^9.1.0"
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"workerThreads": false
|
|
77
77
|
},
|
|
78
78
|
"typeCoverage": {
|
|
79
|
-
"atLeast":
|
|
79
|
+
"atLeast": 93.51
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "c22e7250188bbdb07bc021dffdb88af0309a7aa8"
|
|
82
82
|
}
|
package/src/build.js
CHANGED
package/src/replay.js
CHANGED
|
@@ -326,7 +326,7 @@ export async function main(
|
|
|
326
326
|
await replayXSnap(options, folders, { readdirSync, readFileSync });
|
|
327
327
|
}
|
|
328
328
|
|
|
329
|
-
/*
|
|
329
|
+
/* eslint-env node */
|
|
330
330
|
if (process.argv[1] === fileURLToPath(new URL(import.meta.url))) {
|
|
331
331
|
main([...process.argv.slice(2)], {
|
|
332
332
|
spawn: childProcessPowers.spawn,
|
package/src/xsnap.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* eslint-env node */
|
|
2
2
|
/* eslint no-await-in-loop: ["off"] */
|
|
3
3
|
|
|
4
4
|
import { finished } from 'stream/promises';
|
|
@@ -141,8 +141,8 @@ const makeSnapshotLoaderWithPipe = async (
|
|
|
141
141
|
* @property {AsyncIterable<Uint8Array>} [snapshotStream]
|
|
142
142
|
* @property {string} [snapshotDescription]
|
|
143
143
|
* @property {boolean} [snapshotUseFs]
|
|
144
|
-
* @property {'ignore' | 'inherit'} [stdout]
|
|
145
|
-
* @property {'ignore' | 'inherit'} [stderr]
|
|
144
|
+
* @property {'ignore' | 'inherit' | 'pipe'} [stdout]
|
|
145
|
+
* @property {'ignore' | 'inherit' | 'pipe'} [stderr]
|
|
146
146
|
* @property {number} [meteringLimit]
|
|
147
147
|
* @property {Record<string, string>} [env]
|
|
148
148
|
*/
|
package/src/xsrepl.js
CHANGED
|
@@ -58,6 +58,7 @@ static char* fxReadNetStringError(int code);
|
|
|
58
58
|
static int fxWriteOkay(FILE* outStream, xsUnsignedValue meterIndex, xsMachine *the, char* buf, size_t len);
|
|
59
59
|
static int fxWriteNetString(FILE* outStream, char* prefix, char* buf, size_t len);
|
|
60
60
|
static char* fxWriteNetStringError(int code);
|
|
61
|
+
static void fxSigPipeHandler(int sigNum);
|
|
61
62
|
|
|
62
63
|
extern xsIntegerValue fxGetCurrentHeapCount(xsMachine* the);
|
|
63
64
|
|
|
@@ -254,6 +255,14 @@ static char *renderTimestamps() {
|
|
|
254
255
|
return timestampBuffer;
|
|
255
256
|
}
|
|
256
257
|
|
|
258
|
+
static void fxSigPipeHandler(int sigNum)
|
|
259
|
+
{
|
|
260
|
+
if (sigNum == SIGPIPE) {
|
|
261
|
+
fprintf(stderr, "Caught SIGPIPE. Has parent died?\n");
|
|
262
|
+
c_exit(E_IO_ERROR);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
257
266
|
int main(int argc, char* argv[])
|
|
258
267
|
{
|
|
259
268
|
int argi;
|
|
@@ -396,6 +405,9 @@ int main(int argc, char* argv[])
|
|
|
396
405
|
machine = xsCreateMachine(creation, "xsnap", NULL);
|
|
397
406
|
xsBuildAgent(machine);
|
|
398
407
|
}
|
|
408
|
+
|
|
409
|
+
signal(SIGPIPE, fxSigPipeHandler);
|
|
410
|
+
|
|
399
411
|
if (!(fromParent = fdopen(3, "rb"))) {
|
|
400
412
|
fprintf(stderr, "fdopen(3) from parent failed\n");
|
|
401
413
|
c_exit(E_IO_ERROR);
|
|
@@ -931,6 +943,10 @@ static void xs_issueCommand(xsMachine *the)
|
|
|
931
943
|
size_t len;
|
|
932
944
|
int readError = fxReadNetString(fromParent, &buf, &len);
|
|
933
945
|
if (readError != 0) {
|
|
946
|
+
if (feof(fromParent)) {
|
|
947
|
+
fprintf(stderr, "Got EOF on netstring read. Has parent died?\n");
|
|
948
|
+
c_exit(E_IO_ERROR);
|
|
949
|
+
}
|
|
934
950
|
xsUnknownError(fxReadNetStringError(readError));
|
|
935
951
|
}
|
|
936
952
|
recordTimestamp(); // after command-result received from parent
|