AIasd / ADFuzz

An open-source software package for fuzzing autonomous driving systems in high-fidelity simulators
MIT License
30 stars 9 forks source link

Unsupported operand type(s) for -: 'list' and 'int' #14

Closed YuqiHuai closed 2 years ago

YuqiHuai commented 2 years ago

Hi, at 99's simulation, I saw this error at line https://github.com/AIasd/ADFuzz/blob/92fbd60ae64b4056dc6842be5af038ffa32d4cb4/customized_utils.py#L682

Out of curiosity, do you regularly run ADFuzz with apollo, and are these issues only happening on my machine but not on yours?

Traceback:

Traceback (most recent call last):
  File "ga_fuzzing.py", line 1732, in <module>
    run_ga_general(fuzzing_arguments, sim_specific_arguments, fuzzing_content, run_simulation)
  File "ga_fuzzing.py", line 1611, in run_ga_general
    run_ga(fuzzing_arguments, sim_specific_arguments, fuzzing_content, run_simulation)
  File "ga_fuzzing.py", line 1555, in run_ga
    algorithm.solve()
  File "/ADFuzz/pymoo/pymoo/model/algorithm.py", line 211, in solve
    self._solve(self.problem)
  File "/ADFuzz/pymoo/pymoo/model/algorithm.py", line 291, in _solve
    self.next()
  File "/ADFuzz/pymoo/pymoo/model/algorithm.py", line 263, in next
    self._next()
  File "ga_fuzzing.py", line 1208, in _next
    self.set_off()
  File "ga_fuzzing.py", line 1023, in set_off
    X_train, X_test, xl, xu, labels_used, standardize, one_hot_fields_len, param_for_recover_and_decode = process_X(initial_X, self.problem.labels, self.problem.xl, self.problem.xu, cutoff, cutoff_end, partial, len(self.problem.interested_unique_bugs), self.problem.fuzzing_content.keywords_dict, standardize_prev=standardize_prev)
  File "/ADFuzz/customized_utils.py", line 682, in process_X
    kept_fields_non_encode = kept_fields - one_hot_fields_len
TypeError: unsupported operand type(s) for -: 'list' and 'int'
AIasd commented 2 years ago

Thanks for reporting the bug! It seems to be an issue introduced from the previous fixing commit. I have pushed a fix for that.

I have a different version locally. For a quick fix, I sometimes did not get time to check for all the stacks.

YuqiHuai commented 2 years ago

Thanks! Issue is resolved and I can now run ADFuzz without seeing any errors.