Skip to content

mysql-server: build only fuzz harness targets to skip server/test compile#71

Open
tc-agent wants to merge 2 commits into
masterfrom
mysql-server-build-fuzz-targets-only
Open

mysql-server: build only fuzz harness targets to skip server/test compile#71
tc-agent wants to merge 2 commits into
masterfrom
mysql-server-build-fuzz-targets-only

Conversation

@tc-agent

Copy link
Copy Markdown
Owner

This is a small build-time optimization: replace make -j$(nproc) with make -j$(nproc) <FUZZ_TARGETS>, where the target list is discovered from make help (matches routertest_fuzz_*). The result is that OSS-Fuzz only builds the libFuzzer harnesses and their dependency graph (mysys/strings/router/etc.) instead of the entire mysql-server tree plus its ~2000 gunit unit tests — roughly an order of magnitude fewer object files.

The discovery from make help means the target list stays correct as upstream adds or removes harnesses without anyone touching this script. If no targets are found (e.g. the cmake config disabled LIBFUZZER_COMPILE_FLAGS) the script fails loudly instead of silently rebuilding the whole tree.

Fuzz Introspector baseline for the project, unchanged by this PR: https://introspector.oss-fuzz.com/project-profile?project=mysql-server.

Related and orthogonal: #14474 (the harness-collection / find-based copy) and #13420 (a new in-tree harness). Both apply cleanly before or after this PR.

@github-actions

Copy link
Copy Markdown

Fuzzing Coverage Report

Tested: project mysql-server · base 766921e → head 6f909b1 · 300s total fuzz budget · updated 2026-05-28 03:33 UTC · workflow run

Metric Before After Delta
Static reachability >45m >45m
Line coverage 0% 17.5% (3847/21999) new
Branch coverage 0% 14.4% (1523/10599) new
Function coverage 0% 23.2% (496/2137) new

Per-harness

Harness Lines before Lines after Δ
routertest_fuzz_mysql_protocol_binary_datetime 0% 38.5% (305/792) new
routertest_fuzz_mysql_protocol_binary_time 0% 37.1% (289/778) new
routertest_fuzz_mysql_protocol_binlog_dump 0% 25.8% (295/1145) new
routertest_fuzz_mysql_protocol_binlog_dump_gtid 0% 27.9% (327/1173) new
routertest_fuzz_mysql_protocol_change_user 0% 35.1% (436/1241) new
routertest_fuzz_mysql_protocol_client_greeting 0% 40.5% (532/1315) new
routertest_fuzz_mysql_protocol_clone 0% 22.7% (249/1097) new
routertest_fuzz_mysql_protocol_init_schema 0% 24.5% (276/1126) new
routertest_fuzz_mysql_protocol_list_fields 0% 26.2% (301/1151) new
routertest_fuzz_mysql_protocol_ping 0% 22.7% (249/1097) new
routertest_fuzz_mysql_protocol_query 0% 39.5% (533/1348) new
routertest_fuzz_mysql_protocol_quit 0% 22.7% (249/1097) new
routertest_fuzz_mysql_protocol_register_replica 0% 27.6% (322/1168) new
routertest_fuzz_mysql_protocol_reload 0% 23.6% (256/1083) new
routertest_fuzz_mysql_protocol_reset_connection 0% 22.7% (249/1097) new
routertest_fuzz_mysql_protocol_set_option 0% 23.5% (255/1083) new
routertest_fuzz_mysql_protocol_statistics 0% 22.7% (249/1097) new
routertest_fuzz_mysql_protocol_stmt_close 0% 23.5% (255/1083) new
routertest_fuzz_mysql_protocol_stmt_execute 0% 43.2% (611/1415) new
routertest_fuzz_mysql_protocol_stmt_fetch 0% 23.9% (259/1084) new
routertest_fuzz_mysql_protocol_stmt_param_append_data 0% 25.2% (286/1136) new
routertest_fuzz_mysql_protocol_stmt_prepare 0% 24.5% (276/1126) new
routertest_fuzz_mysql_protocol_stmt_reset 0% 23.5% (255/1083) new
routertest_fuzz_routing_parser_show_warnings 0% 9.1% (1699/18750) new
routertest_fuzz_routing_sql_lexer 0% 9.4% (1742/18514) new

Δ = (after − before) / before, to accommodate that denominators may change. "new" when before is 0; "deleted" when after is 0.

@tc-agent
tc-agent force-pushed the master branch 4 times, most recently from af7f9a7 to 806b281 Compare May 28, 2026 18:05
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