Problem
Currently OptParser#stringListSetting(String, String) uses File.pathSeparatorChar as separator, but stringListSetting is used by multiple Opt values which are not actually path-related, for example:
instrumentation_includes
custom_hook_includes
trace
- ...
This is quite confusing, e.g. I used instrument (which splits always by ,), then switched to instrumentation_includes and instrumentation_excludes for finer control and encountered an error because those split by : / ;.
This can also make configuring Jazzer more difficult because the path separator differs between OS (Linux :, Windows ;), so you cannot put them in the OS-agnostic junit-platform.properties file anymore.
Suggested solution
Only use pathSeparatorChar for options which are actually path-based, and adjust documentation which currently refers to : / ; if necessary.
Maybe also consider refactoring OptParser so that stringListSetting splits by , by default and add a separate method whose name makes it clear that it splits by pathSeparatorChar to avoid accidental usage (which might be the cause for the current inconsistencies?)?
Not sure if this here has to be adjusted as well as part of the changes:
|
return Arrays.stream(allDisabledHooks.split(String.valueOf(File.pathSeparatorChar))) |
Problem
Currently
OptParser#stringListSetting(String, String)usesFile.pathSeparatorCharas separator, butstringListSettingis used by multipleOptvalues which are not actually path-related, for example:instrumentation_includescustom_hook_includestraceThis is quite confusing, e.g. I used
instrument(which splits always by,), then switched toinstrumentation_includesandinstrumentation_excludesfor finer control and encountered an error because those split by:/;.This can also make configuring Jazzer more difficult because the path separator differs between OS (Linux
:, Windows;), so you cannot put them in the OS-agnosticjunit-platform.propertiesfile anymore.Suggested solution
Only use
pathSeparatorCharfor options which are actually path-based, and adjust documentation which currently refers to:/;if necessary.Maybe also consider refactoring
OptParserso thatstringListSettingsplits by,by default and add a separate method whose name makes it clear that it splits bypathSeparatorCharto avoid accidental usage (which might be the cause for the current inconsistencies?)?Not sure if this here has to be adjusted as well as part of the changes:
jazzer/src/main/java/jaz/Zer.java
Line 144 in 50a0e8f
jazzer/sanitizers/src/test/java/com/example/DisabledHooksTest.java
Line 89 in 50a0e8f