Open arichardson opened 5 years ago
Locally I've worked around this by deleting the following line: https://github.com/csmith-project/creduce/blob/8a67e69c49ef123a1c0a4898ac259249411a01dd/creduce/creduce.in#L762
Is there a way to work around this bug by passing command line flags? I often run creduce on a server where I can't build it from source or update packages.
I can add a command line option to remove a pass from the pass schedule, but I'd like to understand what leads to this assert being triggered, perhaps you can share a way for us to reproduce this problem? the line in question just opens the file being reduced, I don't see how this would fail.
It appears that this pass is attempting to open the file in the current working directory but I invoke creduce with the CWD set to a different directory.
In the example above my creduce wrapper uses ['time', '/usr/bin/creduce', '/tmp/tmpymnudx8l/reduce_script.sh', '/tmp/usbdump-facd48-pp-smaller-reduce.c', '--timing'] {'cwd': '/tmp/tmpymnudx8l'}
I just found a workaround: if I copy the input file to that directory before invoking creduce the pass will succeed.
It seems like the pass is opening the file before creduce has copied the current input to the working directory?
the rule for interestingness tests is that:
I think the following is happening:
pass_line_markers opens the file in sub new ($$)
which is called by https://github.com/csmith-project/creduce/blob/8a67e69c49ef123a1c0a4898ac259249411a01dd/creduce/creduce.in#L609.
All other passes seem to open the $cfile
variable inside transform
.
It seems to me like c-reduce only copies the source file after calling new
: https://github.com/csmith-project/creduce/blob/8a67e69c49ef123a1c0a4898ac259249411a01dd/creduce/creduce.in#L631
which is before calling transform
:
https://github.com/csmith-project/creduce/blob/8a67e69c49ef123a1c0a4898ac259249411a01dd/creduce/creduce.in#L635
Maybe pass_line_markers can be changed to open the file later?
I found this too. It seems still not fixed. I have to put reduce target the same directory I invoke creduce
, or use the option --skip-initial-passes
After updating creduce I am no longer able to reduce clang crashes. Every time I try, creduce dies with the following stack trace: