[ovs-dev] ossfuzz: Speed up flow extract fuzzing by refactoring

Aaron Conole aconole at bytheb.org
Fri Oct 5 20:17:07 UTC 2018


Bhargava Shastry <bshastry at sect.tu-berlin.de> writes:

> Hello,
>
> I can take a look at these on Monday. In any case, they look easily fixable.
>
> P.S. I wonder why the build bot did not complain on the exact same
> code that has now been refactored out of flow_extract_target.c. As far
> as I can remember, that code also used asserts.

Depends on how the code arrived in the repository.  If it came by way of
a github pull request, the bot won't 'see' it.  Also, if it was sent
before the bot existed (June), then it also would have missed the
complaints.  Perhaps the code in question pre-dates the ovs_assert check
being added to checkpatch, also.

> On October 5, 2018 2:56:39 PM GMT+02:00, 0-day Robot <robot at bytheb.org> wrote:
>>Bleep bloop.  Greetings Bhargava Shastry, I am a robot and I have tried
>>out your patch.
>>Thanks for your contribution.
>>
>>I encountered some error that I wasn't expecting.  See the details
>>below.
>>
>>
>>checkpatch:
>>WARNING: Line lacks whitespace around operator
>>#585 FILE: tests/oss-fuzz/miniflow_target.c:95:
>>            flow_u32[*idxp + i] = random_value();
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#722 FILE: tests/oss-fuzz/miniflow_target.c:232:
>>        assert(miniflow_get_vid(miniflow, i) ==
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#726 FILE: tests/oss-fuzz/miniflow_target.c:236:
>>        assert(miniflow_get(miniflow, i) == flow_u64[i]);
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#730 FILE: tests/oss-fuzz/miniflow_target.c:240:
>>    assert(miniflow_equal(miniflow, miniflow));
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#734 FILE: tests/oss-fuzz/miniflow_target.c:244:
>>    assert(flow_equal(flow, &flow2));
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#737 FILE: tests/oss-fuzz/miniflow_target.c:247:
>>    assert(miniflow_equal(miniflow, miniflow2));
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#738 FILE: tests/oss-fuzz/miniflow_target.c:248:
>> assert(miniflow_hash__(miniflow, 0) == miniflow_hash__(miniflow2, 0));
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#740 FILE: tests/oss-fuzz/miniflow_target.c:250:
>>    assert(flow_equal(flow, &flow3));
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#748 FILE: tests/oss-fuzz/miniflow_target.c:258:
>>    assert(minimask_is_catchall(minimask)
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#750 FILE: tests/oss-fuzz/miniflow_target.c:260:
>>    assert(miniflow_equal_in_minimask(miniflow, miniflow2, minimask));
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#751 FILE: tests/oss-fuzz/miniflow_target.c:261:
>>   assert(miniflow_equal_flow_in_minimask(miniflow, &flow2, minimask));
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#752 FILE: tests/oss-fuzz/miniflow_target.c:262:
>>    assert(miniflow_hash_in_minimask(miniflow, minimask, 0x12345678) ==
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#754 FILE: tests/oss-fuzz/miniflow_target.c:264:
>>    assert(minimask_hash(minimask, 0) ==
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#760 FILE: tests/oss-fuzz/miniflow_target.c:270:
>>  assert(!miniflow_equal_flow_in_minimask(miniflow, &flow2, minimask));
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#762 FILE: tests/oss-fuzz/miniflow_target.c:272:
>>    assert(!miniflow_equal_in_minimask(miniflow, miniflow3, minimask));
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#778 FILE: tests/oss-fuzz/miniflow_target.c:288:
>>    assert(minimask_is_catchall(minicatchall));
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#785 FILE: tests/oss-fuzz/miniflow_target.c:295:
>>    assert(!minimask_has_extra(minimask, minimask));
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#786 FILE: tests/oss-fuzz/miniflow_target.c:296:
>>    assert(minimask_has_extra(minicatchall, minimask)
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#793 FILE: tests/oss-fuzz/miniflow_target.c:303:
>>        assert(minimask_has_extra(minimask2, minimask));
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#794 FILE: tests/oss-fuzz/miniflow_target.c:304:
>>        assert(!minimask_has_extra(minimask, minimask2));
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#810 FILE: tests/oss-fuzz/miniflow_target.c:320:
>>    assert(minimask_is_catchall(minicatchall));
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#824 FILE: tests/oss-fuzz/miniflow_target.c:334:
>>    assert(minimask_is_catchall(&m.minicombined));
>>
>>ERROR: Use ovs_assert() in place of assert()
>>#833 FILE: tests/oss-fuzz/miniflow_target.c:343:
>>    assert(flow_wildcards_equal(&combined, &combined2));
>>
>>Lines checked: 861, Warnings: 1, Errors: 22
>>
>>
>>Please check this out.  If you feel there has been an error, please
>>email aconole at bytheb.org
>>
>>Thanks,
>>0-day Robot


More information about the dev mailing list