summaryrefslogtreecommitdiff
path: root/fuzzer
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-02-27 13:58:06 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-02-27 15:11:31 +0100
commit1016de956a80ccb34bbc784801007197a79cef81 (patch)
tree0e8a7b37cef9cacf8e40cbf9175388e170d3d61b /fuzzer
parentbbcfd8fad2b9074205c9e2f14539c633d978e8d3 (diff)
fuzzer: fix OOM with an ever-growing SocketPoll::_newCallbacks
Admin::instance().dumpState(std::cerr) at the end of a run shows: Poll [0] - wakeup r: 11 w: 12 callbacks: 103 fd events rsize wsize This is more a problem in the fuzzer itself than in the code, the unprocessed callbacks reached the intentionally set 2GB limit in about 20 mins, so process them at the end of each run. Change-Id: Ic12d3e8555417371f4ca44228fc1ff515d704592 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89632 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'fuzzer')
-rw-r--r--fuzzer/ClientSession.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/fuzzer/ClientSession.cpp b/fuzzer/ClientSession.cpp
index 53872d5ca..d68f27fb7 100644
--- a/fuzzer/ClientSession.cpp
+++ b/fuzzer/ClientSession.cpp
@@ -34,6 +34,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
std::vector<char> lineVector(line.data(), line.data() + line.size());
session->handleMessage(fin, code, lineVector);
}
+
+ // Make sure SocketPoll::_newCallbacks does not grow forever, leading to OOM.
+ Admin::instance().poll(SocketPoll::DefaultPollTimeoutMs);
return 0;
}