Skip to content

Branch Distances in SearchBasedFuzzer is wrong - #185

Open
sylviax26 wants to merge 1 commit into
uds-se:masterfrom
sylviax26:patch-1
Open

Branch Distances in SearchBasedFuzzer is wrong#185
sylviax26 wants to merge 1 commit into
uds-se:masterfrom
sylviax26:patch-1

Conversation

@sylviax26

@sylviax26 sylviax26 commented Apr 7, 2025

Copy link
Copy Markdown

I believe last 3 lines in the table is wrong

    "| Condition | Distance True | Distance False |\n",
    "| ------------- |:-------------:| -----:|\n",
    "| a == b      | abs(a - b) | 1 |\n",
    "| a != b      | 1          | abs(a - b) |\n",
    "| a < b       | b - a + 1  | a - b      |\n",
    "| a <= b      | b - a      | a - b + 1  |\n",
    "| a > b       | a - b + 1  | b - a      |\n",

for example,
to make a<b true, we want estimate the distance betweern unstatisfied inputs and the closest statisfied inputs.
for unstatisfied inputs, a>=b . so, the distance true should be a - b + 1 instead of b - a + 1

similarly, the distance false should be b - a instead of a - b

fixed:

    "| Condition | Distance True | Distance False |\n",
    "| ------------- |:-------------:| -----:|\n",
    "| a == b      | abs(a - b) | 1 |\n",
    "| a != b      | 1          | abs(a - b) |\n",
    "| a < b       | a - b + 1  | b - a      |\n",
    "| a <= b      | a - b      | b - a + 1  |\n",
    "| a > b       | b - a + 1  | a - b      |\n",

fix Branch Distances
@sylviax26

sylviax26 commented Apr 7, 2025

Copy link
Copy Markdown
Author

The following code is right so no need to fix.

" elif op == \"Lt\":\n",
" if lhs < rhs:\n",
" distance_false = rhs - lhs\n",
" else:\n",
" distance_true = lhs - rhs + 1\n",

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

Successfully merging this pull request may close these issues.

1 participant