Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stress testing of the engine #333

Closed
egavrin opened this issue Jul 8, 2015 · 7 comments
Closed

Stress testing of the engine #333

egavrin opened this issue Jul 8, 2015 · 7 comments
Labels
enhancement An improvement infrastructure Related to GH Actions or the tested targets

Comments

@egavrin
Copy link
Contributor

egavrin commented Jul 8, 2015

Do you know any fuzzers or stress testing suites that can useful for us?

@egavrin egavrin added enhancement An improvement infrastructure Related to GH Actions or the tested targets labels Jul 8, 2015
@akosthekiss
Copy link
Member

The University of Szeged has a proprietary fuzz testing framework with no imminent plans for open sourcing but is happy to share any issues it discovers in Jerry. (Actually, several previously reported issues were discovered with its help.)

@renatahodovan
Copy link
Contributor

The "problem" with jsfunfuzz is that it generates the test cases on the fly which means that the whole generator script needs to be loaded by the engine every time. Hence jerry would need to load ~5500 LOC to generate a single test case but unfortunately it runs of the registers quickly.

I've also tried the recently popular afl fuzzer against jerry however it constantly crashes on the longjmp bug (#341) and it's unusable this way.

@ruben-ayrapetyan
Copy link
Contributor

@renatahodovan, maybe we can generate tests by running jsfunfuzz separately, and then use the generated tests for checking.


I've also tried the recently popular afl fuzzer against jerry however it constantly crashes on the longjmp bug (#341) and it's unusable this way.

Could you, please, check #390?

@ruben-ayrapetyan
Copy link
Contributor

#341 is fixed.

@egavrin
Copy link
Contributor Author

egavrin commented Jul 16, 2015

@renatahodovan could you please share how to run afl-fuzz for javascript?

@renatahodovan
Copy link
Contributor

@egavrin sure, however I'm also still working on how to exploit all of its features.

A customized version of afl-fuzz is available from here: https://github.com/tunz/afl-fuzz-js
You can run it two different ways: in the first case you can use your own jerry build, choose a set of initial test cases that will be mutated and a predefined dictionary to guide the mutation and go ahead. From the manual, starting a fuzz session looks something like this:

/path/to/afl-fuzz -i [input directory] -o [output directory] -x [dictionary directory] -m 8G ./jerry @@

I've ran this for days but it hasn't found much (except the longjump crashes).

However, there is second coverage driven option (what is said much more efficient). The problem is that to use this option the target must be instrumented with the afl-fuzzer's own wrapped gcc/g++. Unfortunately, replacing jerry's default compiler is not seems too easy. I've achieved to build everything with afl-g++, but it still fails on linking. This is what I'm experimenting with right now :)

@akosthekiss
Copy link
Member

There is an experimental branch in my repo for overriding the default compiler (https://github.com/akiss77/jerryscript/commits/compiler-override) but it's not ready for PR yet. Feel free to (ab)use it directly from there though. (However, even that experiences the linker issue.)

egavrin added a commit that referenced this issue Nov 23, 2015
Related issue: #333, #454

Works only with default libc:
$ make debug.linux -j TOOLCHAIN="./build/configs/toolchain_afl.cmake" USE_COMPILER_DEFAULT_LIBC=YES

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin [email protected]
egavrin added a commit that referenced this issue Nov 23, 2015
Related issue: #333, #454

Works only with default libc:
$ make debug.linux -j TOOLCHAIN="./build/configs/toolchain_afl.cmake" USE_COMPILER_DEFAULT_LIBC=YES

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin [email protected]
egavrin added a commit that referenced this issue Nov 23, 2015
Related issue: #333, #454

Works only with default libc:
```
$ make debug.linux -j TOOLCHAIN="./build/configs/toolchain_afl.cmake" USE_COMPILER_DEFAULT_LIBC=YES
```

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin [email protected]
egavrin added a commit that referenced this issue Nov 23, 2015
Related issue: #333, #454

Works only with default libc:
```
$ make debug.linux -j TOOLCHAIN="./build/configs/toolchain_afl.cmake" USE_COMPILER_DEFAULT_LIBC=YES
```

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin [email protected]
egavrin added a commit that referenced this issue Dec 24, 2015
Related issue: #333, #454

Works only with default libc:
```
$ make debug.linux -j TOOLCHAIN="./build/configs/toolchain_afl.cmake" USE_COMPILER_DEFAULT_LIBC=YES
```

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin [email protected]
sand1k pushed a commit to sand1k/jerryscript that referenced this issue Jan 12, 2016
Related issue: jerryscript-project#333, jerryscript-project#454

Works only with default libc:
```
$ make debug.linux -j TOOLCHAIN="./build/configs/toolchain_afl.cmake" USE_COMPILER_DEFAULT_LIBC=YES
```

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement infrastructure Related to GH Actions or the tested targets
Projects
None yet
Development

No branches or pull requests

5 participants