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

Cannot reduce tar-1.14 #2

Open
michaelbrownuc opened this issue Mar 5, 2019 · 16 comments
Open

Cannot reduce tar-1.14 #2

michaelbrownuc opened this issue Mar 5, 2019 · 16 comments

Comments

@michaelbrownuc
Copy link

When attempting to reduce tar, I get the error:

The specified oracle file ./test.sh cannot execute correctly.

@KihongHeo
Copy link
Contributor

Chisel first checks whether a given test script runs correctly. It seems that test.sh does not preperly terminate with return code 0. Can you first try ./test.sh; echo $??

Some possible reasons are 1) tar-1.14.c is missing, 2) you missed running . setenv in ChiselBench/, or 3) timeout. For 3) can you increase the time limits in the script? In case of tar, we have two different variables TIMEOUT and TIMEOUT_LOW. You can increase both.

@michaelbrownuc
Copy link
Author

  1. the file is correctly generated from tar-1.14.c.origin.c
  2. I did run the setenv command
  3. The error occurs immediately, before the the first function reduction. I increased the timeout, this does not affect the failure.

The script test.sh returns 1 when running the command you specified. I did not alter the test script. I didn't see any immediate reason why it was not returning 0.

@KihongHeo
Copy link
Contributor

Can you localize the problem using bash -x ./test.sh and tell me when the script stops?

@michaelbrownuc
Copy link
Author

Here's the last 20 or so lines of the output from bash -x

  • find . -not -path './optional*' -not -path './afl_crash*' -not -path './reducer-out*' -not -path './chisel-out*' -not -path './lib*' -not -path ./tar-1.14.c.chisel.c -not -path ./tar-1.14.c.reduced.c -not -path './bin' -not -path './status*' -not -path './json' -not -path './tests' -not -path './tar*' -not -path './test*' -not -path './afl_input*' -not -path ./Makefile -not -path ./setenv -not -path ./.config -delete
  • return 0
  • compile -fsanitize=address
  • case $COV in
  • CFLAGS='-w -fsanitize=address '
  • clang /home/michael/ChiselBench/benchmark/tar-1.14/tar-1.14.c -w -fsanitize=address -o /home/michael/ChiselBench/benchmark/tar-1.14/tar-1.14.reduced
  • return 0
  • desired -fsanitize=address
  • [[ -fsanitize=address == -\f\s\a\n\i\t\i\z\e=\l\e\a\k ]]
  • cp /home/michael/ChiselBench/benchmark/tar-1.14/tar-1.14.reduced tar
    ++ ls tests/tar-archives-multiple-files tests/tar-complains-about-missing-file tests/tar-demands-at-least-one-ctx tests/tar-demands-at-most-one-ctx tests/tar-extracts-all-subdirs tests/tar-extracts-file tests/tar-extracts-from-standard-input tests/tar-extracts-multiple-files tests/tar-extracts-to-standard-output tests/tar-handles-cz-options tests/tar-handles-empty-include-and-non-empty-exclude-list tests/tar-handles-exclude-and-extract-lists tests/tar-handles-multiple-X-options tests/tar-handles-nested-exclude
  • for file in $(ls tests/tar*)
  • exit 1

@KihongHeo
Copy link
Contributor

That is quite odd. test.sh does not rely on any other programs except the builtin tar in your os.
Do you use bash?
Can you take a look at log.txt?
Can you localize the problem more by printing the execution steps?

@michaelbrownuc
Copy link
Author

It appears the issue is on line 40 of test.sh, execution of one of the files in tests/tar is tripping the exit statement. I'll try to narrow it down further.

@michaelbrownuc
Copy link
Author

Looks like the issue is during the execution of tar-archives-multiple-files for the address sanitization option. No information in the log.txt file.

@michaelbrownuc
Copy link
Author

I was able to get tar to run by adding a check similar to the one for the leak sanitizer to the desired() function. I'm not sure why this works on my end and not on yours, but this appears to be some progress.

@Mohannadcse
Copy link

How did you run the analysis? I'm using the docker-machine, then go to one of the examples (say tar-1.14), finally, I goto the merged directory where are the Makefile and test.sh. Here is the full path:
/chiselbench/benchmark/tar-1.14/merged

Then I run the make command make reduce but received the following error shown the the screenshot

image

@KihongHeo
Copy link
Contributor

@Mohannadcse Can you try to replace "../target.mk" with "../../target.mk"?

@Mohannadcse
Copy link

Thanks. I changed it. There is another error
image

@KihongHeo
Copy link
Contributor

Please adjust benchmark dir (BENCHMARK_DIR) in test.sh, e.g.,
benchmark/$BENCHMARK_NAME
to
benchmark/$BENCHMARK_NAME/merged

@KihongHeo KihongHeo reopened this Aug 10, 2020
@Mohannadcse
Copy link

Thanks, the script works now.

@ternava
Copy link

ternava commented Mar 1, 2023

Still, even with these two last issues fixed, I have an error when I try to run make reduce for tar and sort, in their /chiselbench/benchmark/tar-1.14/merged and /chiselbench/benchmark/sort-8.16/merged respective folders.

In both cases I receive the same error as mentioned before:
image

image

I looked in the log.txt of sort, this is the returned error.

outputcheckerror "invalid number at field start: invalid count at start of \‘notexist\’" && exit 1

Whereas the log.txt of tar is empty.

Any idea how I can fix them?

@ternava
Copy link

ternava commented Mar 1, 2023

Apparently, the error in sort is caused by the wrong use of characters inside comments in these two places:

outputcheckerror "invalid number at field start: invalid count at start of \‘notexist\’" && exit 1

and

outputcheckerror "multi-character tab \‘notexist\’" && exit 1

In my case, the error in sort is fixed by using the straight single quotation marks, i.e., instead of \‘notexist’\ it should be changed to 'notexist'.

@codingsoo
Copy link

Looks like the issue is during the execution of tar-archives-multiple-files for the address sanitization option. No information in the log.txt file.

I have the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants