Download Game! Currently 84 players and visitors. Last logged in:WilliNakkiHalluZidane

Blitzer's Blog >> 71709

Back to blogs index
Posted: 08 Aug 2026 12:32 [ permalink ]
root@node-base:~# x-console js-sandbox-api restart
[+] Console js-sandbox-api terminated.
[+] Console js-sandbox-api created and executed via Event-Driven wrapper in
/root/js-sandbox-api
root@node-base:~#B
root@node-base:~# {
> # 1. Luodaan 1 MB memfd-muistipankki
BANK_ID=$(curl -s -X POST http://localhost:3000/api/v1/memory \
B -H "Content-Type: application/json" \
B -d '{"size": 1048576}' | jq -r .id)

# 2. KC$ynnistetC$C$n hiekkalaatikkoinstanssi Safe Modessa!
curl -s -X POST http://localhost:3000/api/v1/instances \
B -H "Content-Type: application/json" \
B -d "{
B B \"memoryBankId\": \"$BANK_ID\",
B B \"memoryLimitMb\": 32,
B B \"cpuPercent\": 10,
B B \"safeMode\": true,
B B \"code\": \"export function execute() { console.log('Olen
vikasietotilassa!'); sharedMem[0] = 9999; }\"
B }" | jq .
> }
{
B "id": "bb02f00e-345b-40c1-b873-68039f81c9bb",
B "status": "running",
B "safeMode": true
}
root@node-base:~#B
root@node-base:~# x-console js-sandbox-api tail
B B B "statusCode": 200
B B }
B B responseTime: 42.421721999999136
[09:29:20 UTC] WARN: [DEBUGGER READY] YhdistC$ instanssiin: ws://127.0.0.1:3437
7/
7846c8bc-7cc8-43dc-87a1-4998c799102b
B B reqId: "req-2"
[09:29:20 UTC] ERROR: [Sandbox bb02f00e-345b-40c1-b873-68039f81c9bb STDERR]
Debu
gger listening on ws://127.0.0.1:34377/7846c8bc-7cc8-43dc-87a1-4998c799102b
For help, see: https://nodejs.org/learn/getting-started/debugging
B B reqId: "req-2"
root@node-base:~#B

root@node-base:~# node inspect 127.0.0.1:34377
connecting to 127.0.0.1:34377 ... ok
Break on start in js-sandbox-api/src/sandbox/sandbox-runner.js:1
> 1 const vm = require('vm');
B 2 const shm = require('../../build/Release/shmbuffer.node');
B 3B
debug> n
step in js-sandbox-api/src/sandbox/sandbox-runner.js:2
B 1 const vm = require('vm');
> 2 const shm = require('../../build/Release/shmbuffer.node');
B 3B
B 4 process.on('message', async (msg) => {
debug> n
step in js-sandbox-api/src/sandbox/sandbox-runner.js:4
B 2 const shm = require('../../build/Release/shmbuffer.node');
B 3B
> 4 process.on('message', async (msg) => {
B 5B B Bif (msg.cmd === 'ATTACH_BANK') {
B 6 try {
debug> n
step in js-sandbox-api/src/sandbox/sandbox-runner.js:58
B56B
B57B
>58 });
B59B
debug> n
step in node:internal/modules/cjs/loader:1784
B1782B B B B B B B B B B B B B B[exports, require, module, filename,
dirname]);
B1783B B}
>1784B Bthis[kIsExecuting] = false;
B1785B Bif (requireDepth === 0) { statCache = null; }
B1786B Breturn result;
debug> n
step in node:internal/modules/cjs/loader:1785
B1783B B}
B1784B Bthis[kIsExecuting] = false;
>1785B Bif (requireDepth === 0) { statCache = null; }
B1786B Breturn result;
B1787 };
debug> n
step in node:internal/modules/cjs/loader:1785
B1783B B}
B1784B Bthis[kIsExecuting] = false;
>1785B Bif (requireDepth === 0) { statCache = null; }
B1786B Breturn result;
B1787 };
debug> n
step in node:internal/modules/cjs/loader:1786
B1784B Bthis[kIsExecuting] = false;
B1785B Bif (requireDepth === 0) { statCache = null; }
>1786B Breturn result;
B1787 };
B1788B
debug> n
step in node:internal/modules/cjs/loader:1786
B1784B Bthis[kIsExecuting] = false;
B1785B Bif (requireDepth === 0) { statCache = null; }
>1786B Breturn result;
B1787 };
B1788B
debug> n
step in node:internal/modules/cjs/loader:1914
B1912B B}
B1913B Bmodule._compile(source, filename, loadedFormat);
>1914 };
B1915B
B1916 /**
debug> n
step in node:internal/modules/cjs/loader:1506
B1504B
B1505B BModule._extensions[extension](this, filename);
>1506B Bthis.loaded = true;
B1507B
B1508B B// Create module entry at load time to snapshot exports correctly
debug> n
step in node:internal/modules/cjs/loader:1509
B1507B
B1508B B// Create module entry at load time to snapshot exports correctly
>1509B Bconst exports = this.exports;
B1510B B// Preemptively cache for ESM loader.
B1511B Bthis[kModuleExport] = exports;
debug> c
debug>B
root@node-base:~# x-console js-sandbox-api tail
[09:31:12 UTC] INFO: [Sandbox bb02f00e-345b-40c1-b873-68039f81c9bb] Olen
vikasie
totilassa!
B B reqId: "req-2"
[09:31:12 UTC] INFO: [Sandbox bb02f00e-345b-40c1-b873-68039f81c9bb] Koodin
suori
tus ilmoitti valmiudesta. Bankin uusi arvo: 9999
B B reqId: "req-2"
[09:31:20 UTC] ERROR: [Sandbox bb02f00e-345b-40c1-b873-68039f81c9bb STDERR]
Debu
gger ending on ws://127.0.0.1:34377/7846c8bc-7cc8-43dc-87a1-4998c799102b
For help, see: https://nodejs.org/learn/getting-started/debugging
B B reqId: "req-2"
root@node-base:~#B