Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1.
- ```
- $ crashsim -- myapp -t -v -l 100
- Recording myapp...
- ###################################################### 100%
- Analyzing recording...
- ###################################################### 100%
- Simulating...
- ###################################################### 100%
- Results:
- 1. myapp may behave unexpectedly when running in Linux environments where "example.txt" is not a regular file.
- 2. myapp may encounter long delays in Linux environments with slow network connections
- because it does not supply a timeout value to poll().
- 3. myapp does not prevent "anotherfile.log" from being modified while copying it across disks in a multi-disk environment.
- Use crashsim explain <report number> for a more detailed explaination...
- $ crashsim explain 1
- Detailed Explaination of report no. 1
- Message: "myapp may encounter problems in Linux environments where "example.txt" is not a regular file."
- CrashSimulator has identified that myapp does not recognize situations where it has been simulated
- that "example.txt" is not a regular file. This is problematic in Linux environments where "example.txt"
- is supplied by (or may be manipulated by) myapp's user. myapp should be modified to use a call from the
- "stat" family to gather information about "example.txt" before processing it. Failure to do so could
- result in myapp crashing, hanging, or exhausing system resources.
- This report was made because CrashSimulator identified the following issues:
- (At Event 120): myapp doesn't recognize when "example.txt" is a character device
- (At Event 120): myapp doesn't recognize when "example.txt" is a block device
- (At Event 120): myapp doesn't recognize when "example.txt" is a symlink device
- These issues were found by: "Unusual Filetype Mutator"
- Use crashsim debug 1 to launch a debugger at this point in execution.
- $ crashsim debug 1
- Launching rr and fast-forwarding to event 120...
- For help, type "help".
- Type "apropos word" to search for commands related to "word".
- (rr)
- ```
- 2.
- ```
- crashsim
- usage: crashsim [-h] [-v] [-e EXPLAIN [EXPLAIN ...]] [-d DEBUG [DEBUG ...]]
- [-n NAME] [-m MUTATOR [MUTATOR ...]] [-f FORCE]
- [myapp]
- positional arguments:
- myapp the application to be tested
- optional arguments:
- -h, --help show this help message and exit
- -v, --verbosity flag for displaying debug information
- -e EXPLAIN [EXPLAIN ...], --explain EXPLAIN [EXPLAIN ...]
- explain the reports in more detail
- -d DEBUG [DEBUG ...], --debug DEBUG [DEBUG ...]
- lets the user to identify exactly where the bug is
- -n NAME, --name NAME optinal name for the test
- -m MUTATOR [MUTATOR ...], --mutator MUTATOR [MUTATOR ...]
- define the mutator to be applied to the test, if no
- mutator given then a default set will be run.
- -f FORCE, --force FORCE
- force overwrite create of the test
- crashsim ./test/calltime
- Creating test for calltime using name autotest1.
- Mutator used: Reverse time mutator, Future time mutator, Cross disk rename mutator, Null mutator, Fsync no space mutator.
- (To use custom mutator, use “crashsim -m “<mutator 1>” “<mutator 2>” -- ./test/calltime”)
- ……..
- Following issues has been detected:
- calltime may not detect anomalies when the system clock has been skewed back 100 seconds.
- calltime may not detect anomalies when the system clock has been skewed forward 100 seconds.
- For a more detailed report, use “crashsim explain <report number>”
- (If you created any other test after this one, use “crashsim explain -n “autotest1” <report number>”)
- crashsim explain 1
- In test autotest1, anomaly report for report number 1 is as follows:
- calltime may not detect anomalies when the system clock has been skewed back 100 seconds.
- It has been identified that calltime does not run into any unexpected behavior when the system clock has been skewed back 100 seconds. This could cause some unexpected error when dealing with time sensitive information.
- To see which systemcalls has caused this anomaly, use “crashsim history <report number>”
- (If you created any other test after this one, use “crashsim history -n “autotest1” <report number>”)
- crashsim history 1
- In test autotest1, report number 1 occurred at the following system calls:
- --------------------------------------------------
- ---> Reached target process 22587 at event 217.
- --------------------------------------------------
- Reading symbols from /usr/local/bin/../lib/rr/librrpreload.so...done.
- Reading symbols from /lib/i386-linux-gnu/libselinux.so.1...(no debugging symbols found)...done.
- Reading symbols from /lib/i386-linux-gnu/libc.so.6...Reading symbols from /usr/lib/debug//lib/i386-linux-gnu/libc-2.23.so...done.
- done.
- Reading symbols from /lib/i386-linux-gnu/libdl.so.2...Reading symbols from /usr/lib/debug//lib/i386-linux-gnu/libdl-2.23.so...done.
- done.
- Reading symbols from /lib/i386-linux-gnu/libpthread.so.0...Reading symbols from /usr/lib/debug/.build-id/51/ddb6090511af5615d5f4af155a4403d2845346.debug...done.
- done.
- Reading symbols from /lib/i386-linux-gnu/libpcre.so.3...(no debugging symbols found)...done.
- Reading symbols from /lib/ld-linux.so.2...Reading symbols from /usr/lib/debug//lib/i386-linux-gnu/ld-2.23.so...done.
- done.
- 0x70000002 in ?? ()
- (rr)
- ```
- 3.
- ```
- $ crashsim -n ‘myapp’ -- <app> <parameters>
- output:
- myapp could not recognize that some files were not a regular file type when myapp was opening those files.
- myapp could not recognize that the clock moved forward in some situations.
- myapp could not recognize that the clock moved backward in some situations.
- myapp could not prevent some files from being modified when they were moved cross disk.
- # Only one message for one mutator
- Use ‘crashsim explain <report number>’ for detailed information about the report.
- $ crashsim explain 1
- output:
- This report was made because UnusualFiletypeMutator found the following issues:
- (At event <No>): myapp could not recognize that ‘<filename>’ is not a regular file.
- (At event <another No>): myapp could not recognize that ‘<filename>’ is not a regular file.
- # list all errors the mutator found
- myapp should be modified to use a call from the "stat" family to gather information about ‘<filename>’ before processing it.
- # Maybe cut down some explanation and just print some advice.
- Use ‘crashsim debug --report 1 --event <No>’ to debug specific event.
- $ crashsim debug --report 1 --event 120
- output:
- Launching debugger for report 1 at event 120...
- --------------------------------------------------
- ---> Reached target process 22587 at event 120.
- --------------------------------------------------
- Reading symbols from /usr/local/bin/../lib/rr/librrpreload.so...done.
- Reading symbols from /lib/i386-linux-gnu/libselinux.so.1...(no debugging symbols found)...done.
- Reading symbols from /lib/i386-linux-gnu/libc.so.6...Reading symbols from /usr/lib/debug//lib/i386-linux-gnu/libc-2.23.so...done.
- done.
- Reading symbols from /lib/i386-linux-gnu/libdl.so.2...Reading symbols from /usr/lib/debug//lib/i386-linux-gnu/libdl-2.23.so...done.
- done.
- Reading symbols from /lib/i386-linux-gnu/libpthread.so.0...Reading symbols from /usr/lib/debug/.build-id/51/ddb6090511af5615d5f4af155a4403d2845346.debug...done.
- done.
- Reading symbols from /lib/i386-linux-gnu/libpcre.so.3...(no debugging symbols found)...done.
- Reading symbols from /lib/ld-linux.so.2...Reading symbols from /usr/lib/debug//lib/i386-linux-gnu/ld-2.23.so...done.
- done.
- 0x70000002 in ?? ()
- (rr)
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement