multi: allow table handle sizes to be overridden #1982

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

cmeister2 commented Oct 11, 2017

When fuzzing, use the smaller Easy values for Curl_multi_handle() for speed of setup.

Owner

jay commented Oct 11, 2017

Wouldn't we want curl to function as close as possible to normal when fuzzing? In other words are these FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION blocks really necessary

Contributor

cmeister2 commented Oct 11, 2017

Fuzz targets are allowed to make concessions if it would improve the overall fuzzing effort. For example, some fuzzers disable randomness so that things are more deterministic.

This fix wouldn't fundamentally change the function here. There is no need for the curl_multi_init() function to use so many hash entries; it will use a single connection in its lifetime. Setting up hundreds of hash entries is an unnecessary overhead.

Contributor

cmeister2 commented Oct 11, 2017

(I have however found another fix to the fuzzer which has sped it up by a significant margin, so this fix is now less important)

Owner

bagder commented Oct 12, 2017

The code is written to allow CURL_SOCKET_HASH_TABLE_SIZE to be changed at build-time without requiring any code change:

CPPFLAGS=-DCURL_SOCKET_HASH_TABLE_SIZE=13 ./configure

I wouldn't mind changing the code to allow the same thing for CURL_CONNECTION_HASH_SIZE.

I think that's a much nicer approach.

Contributor

cmeister2 commented Oct 12, 2017

Happy to do that - didn't realise that CURL_SOCKET_HASH_TABLE_SIZE could be overridden.

multi: allow table handle sizes to be overridden
Allow users to specify their own hash define for CURL_CONNECTION_HASH_SIZE so that both values can be overridden.

@cmeister2 cmeister2 changed the title from multi: Use Easy multi_handle settings when fuzzing to multi: allow table handle sizes to be overridden Oct 23, 2017

Contributor

cmeister2 commented Oct 23, 2017

Change proposed by @bagder now made.

@bagder bagder closed this in 3340b45 Oct 25, 2017

Owner

bagder commented Oct 25, 2017

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment