Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(605)

Unified Diff: third_party/sqlite/BUILD.gn

Issue 2609473004: [sqlite3] Limit max number of memory pages for fuzzing builds. (Closed)
Patch Set: Expand the comment Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/BUILD.gn
diff --git a/third_party/sqlite/BUILD.gn b/third_party/sqlite/BUILD.gn
index 4acbd3a321184a17c7c4b68f5630066ede7f7a99..367b1f03998423f89c0dc03edb291013f703d450 100644
--- a/third_party/sqlite/BUILD.gn
+++ b/third_party/sqlite/BUILD.gn
@@ -137,6 +137,16 @@ if (!use_system_sqlite) {
"SQLITE_MAX_SQL_LENGTH=128000000",
"SQLITE_PRINTF_PRECISION_LIMIT=1280000",
]
+
+ # During fuzz testing, valid SQL queries generated by fuzzing engine may
+ # lead to large memory allocations. If that happens, fuzzer reports an
+ # out-of-memory error. However, such errors are not valid bugs.
+ # To avoid hitting those irrelevant OOMs, we limit max number of memory
+ # pages, so fuzzer will not crash when reaching the limit.
+ # Apply this for fuzzing builds only, not for all builds with sanitizers.
+ if (use_libfuzzer || use_afl) {
+ defines += [ "SQLITE_MAX_PAGE_COUNT=16384" ]
+ }
}
include_dirs = [ "amalgamation" ]
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698