wasm-exprgen
wasm-exprgen copied to clipboard
Error while building WebAssembly interpreter, validation will not be available
C:\wasmexprgenmaster>npm run build-tools
[email protected] build-tools C:\wasmexprgenmaster node cli.js build
Starting Spec interpreter build
Error while building WebAssembly interpreter, validation will not be available
Error: spawn cmd ENOENT
MsBuild path: C:\Program Files (x86)\msbuild\14.0\bin\msbuild.exe
{ Error: not found: cmake
at getNotFoundError (C:\wasmexprgenmaster\node_modules\which\which.js:13:12)
at F (C:\wasmexprgenmaster\node_modules\which\which.js:68:19)
at E (C:\wasmexprgenmaster\node_modules\which\which.js:80:29)
at C:\wasmexprgenmaster\node_modules\which\which.js:89:16
at C:\wasmexprgenmaster\node_modules\isexe\index.js:42:5
at C:\wasmexprgenmaster\node_modules\isexe\windows.js:36:5
at FSReqWrap.oncomplete (fs.js:166:21)
cause: { Error: not found: cmake
at getNotFoundError (C:\wasmexprgenmaster\node_modules\which\which.js:13:12)
at F (C:\wasmexprgenmaster\node_modules\which\which.js:68:19)
at E (C:\wasmexprgenmaster\node_modules\which\which.js:80:29)
at C:\wasmexprgenmaster\node_modules\which\which.js:89:16
at C:\wasmexprgenmaster\node_modules\isexe\index.js:42:5
at C:\wasmexprgenmaster\node_modules\isexe\windows.js:36:5
at FSReqWrap.oncomplete (fs.js:166:21) code: 'ENOENT' },
isOperational: true,
code: 'ENOENT' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build-tools: node cli.js build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build-tools script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\WASM\AppData\Roaming\npm-cache_logs\2017-12-17T07_24_17_520Z-debug.log
It looks like the build cannor find cmake. Have you installed it? If yes can you verify it is available from your path.
thank you for answer now the error was changed :
npm ERR! path C:\Windows\system32\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Windows\system32\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\WASM\AppData\Roaming\npm-cache\_logs\2017-12-18T08_19_46_746Z-debug.log
Humm this is a weird error. Can you list the commands you used? I will try to look into this more tomorrow.
yes :) first i copy again all the code in new folder then re run cmd as administrator and do this :
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\Windows\system32>git submodule update --init
fatal: Not a git repository (or any of the parent directories): .git
C:\Windows\system32>git init
Initialized empty Git repository in C:/Windows/System32/.git/
C:\Windows\system32>git submodule update --init
C:\Windows\system32>npm install --production
npm WARN saveError ENOENT: no such file or directory, open 'C:\Windows\system32\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open 'C:\Windows\system32\package.json'
npm WARN system32 No description
npm WARN system32 No repository field.
npm WARN system32 No README data
npm WARN system32 No license field.
up to date in 0.125s
C:\Windows\system32>npm run build-tools
npm ERR! path C:\Windows\system32\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Windows\system32\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\WASM\AppData\Roaming\npm-cache\_logs\2017-12-18T08_19_46_746Z-debug.log
C:\Windows\system32>
- You do not need to run as administrator
- you shouldn't work in system32, you should cd to a different folder
- did you copy the files using git clone?
- no need to run git init (it should already be a git folder after a clone)
:( again Error on build
c:\>mkdir wasmfuzzer
c:\>git clone https://github.com/Cellule/wasm-exprgen
Cloning into 'wasm-exprgen'...
remote: Counting objects: 452, done.
remote: Compressing objects: 100% (156/156), done.
remote: Total 452 (delta 289), reused 452 (delta 289), pack-reused 0Receiving objects: 85% (385/
Receiving objects: 100% (452/452), 251.16 KiB | 75.00 KiB/s, done.
Resolving deltas: 100% (289/289), done.
c:\>git submodule update --init
fatal: Not a git repository (or any of the parent directories): .git
c:\>git init
Initialized empty Git repository in c:/.git/
c:\>git submodule update --init
c:\>npm install --production
npm WARN saveError ENOENT: no such file or directory, open 'c:\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open 'c:\package.json'
npm WARN !invalid#2 No description
npm WARN !invalid#2 No repository field.
npm WARN !invalid#2 No README data
npm WARN !invalid#2 No license field.
up to date in 0.141s
c:\>npm run build-tools
npm ERR! path c:\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'c:\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\WASM\AppData\Roaming\npm-cache\_logs\2017-12-20T05_13_55_134Z-debug.log
c:\>
@Cellule help me , i need a javascrip fuzzer
You are ignoring a lot of errors.
- You are creating the folder wasmfuzzer, but not actually using it.
- After the clone, you have to go in the new folder the clone created.
- You don't have to and should not call git init
- Make sure every command you do doesn't output an error before you move on to the next step.
thank you so much ;-) i build it success ... and now i have test.* files in output directory how i can run the fuzzer ? whan i run js file in nodejs the result is -> checksum = 2C3738DE and when run js file in chrome or firefox ->
on the web, we need the wasm binary to be preloaded and set on Module['wasmBinary']. emcc.py will do that for you when generating HTML (but not JS)
test.js:885 on the web, we need the wasm binary to be preloaded and set on Module['wasmBinary']. emcc.py will do that for you when generating HTML (but not JS)
shell_printErr @ test.js:885
abort @ test.js:3083
getBinary @ test.js:2353
doNativeWasm @ test.js:2437
Module.asm @ test.js:2603
(anonymous) @ test.js:2835
test.js:885 failed to compile wasm module: abort("on the web, we need the wasm binary to be preloaded and set on Module['wasmBinary']. emcc.py will do that for you when generating HTML (but not JS)") at Error
at jsStackTrace (file:///C:/wasmfuzzer/wasm-exprgen/output/test.js:1804:13)
at stackTrace (file:///C:/wasmfuzzer/wasm-exprgen/output/test.js:1821:12)
at abort (file:///C:/wasmfuzzer/wasm-exprgen/output/test.js:3094:44)
at getBinary (file:///C:/wasmfuzzer/wasm-exprgen/output/test.js:2353:7)
at doNativeWasm (file:///C:/wasmfuzzer/wasm-exprgen/output/test.js:2437:66)
at Object.Module.asm (file:///C:/wasmfuzzer/wasm-exprgen/output/test.js:2603:23)
at file:///C:/wasmfuzzer/wasm-exprgen/output/test.js:2835:1
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.
shell_printErr @ test.js:885
doNativeWasm @ test.js:2439
Module.asm @ test.js:2603
(anonymous) @ test.js:2835
test.js:882 on the web, we need the wasm binary to be preloaded and set on Module['wasmBinary']. emcc.py will do that for you when generating HTML (but not JS)
test.js:885 on the web, we need the wasm binary to be preloaded and set on Module['wasmBinary']. emcc.py will do that for you when generating HTML (but not JS)
shell_printErr @ test.js:885
abort @ test.js:3083
getBinary @ test.js:2353
doWasmPolyfill @ test.js:2481
Module.asm @ test.js:2607
(anonymous) @ test.js:2835
test.js:3100 Uncaught abort("on the web, we need the wasm binary to be preloaded and set on Module['wasmBinary']. emcc.py will do that for you when generating HTML (but not JS)") at Error
at jsStackTrace (file:///C:/wasmfuzzer/wasm-exprgen/output/test.js:1804:13)
at stackTrace (file:///C:/wasmfuzzer/wasm-exprgen/output/test.js:1821:12)
at abort (file:///C:/wasmfuzzer/wasm-exprgen/output/test.js:3094:44)
at getBinary (file:///C:/wasmfuzzer/wasm-exprgen/output/test.js:2353:7)
at doWasmPolyfill (file:///C:/wasmfuzzer/wasm-exprgen/output/test.js:2481:14)
at Object.Module.asm (file:///C:/wasmfuzzer/wasm-exprgen/output/test.js:2607:23)
at file:///C:/wasmfuzzer/wasm-exprgen/output/test.js:2835:1
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.
The result you have by running the javascript file is expected. This tool is not a fuzzer exactly, it simply generates random WebAssembly code using CSmith. CSmith is a tool design to produce random c code and, using emscripten, it compiles that c code into WebAssembly. The goal is mainly to find functional errors in WebAssembly engines and possibly test some edge cases.
This tool wasn't intended to produce html files however. It shouldn't be too hard to modify the command passed to emscripten to do so. You can look at https://github.com/Cellule/wasm-exprgen/blob/master/src/generate.js#L106
hi again after research and read your code i find a solution to generate .html with emcc when I add aditional command to your code the js , c , wasm generate success but it dosend generate html file its my change ti cli.js file
builder: function builder(_yargs) { return _yargs.options(_extends({}, commonGenOptions, { source: { required: true, string: true, describe: "Source file to regenerate" }, emargs: { string: true, describe: "Space separated extra arguments to pass to emcc", default: "-s WASM=1 -o test.html" } })); },