Remove Full SPIRV-Cross fuzzers
BUG=chromium:972753 Change-Id: Ic61d5d0ed44b0693f4df09b1f9c34bd928609c3a Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8080 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
8f813ac8a2
commit
3e51fada29
3
BUILD.gn
3
BUILD.gn
|
@ -787,11 +787,8 @@ group("dawn_fuzzers") {
|
|||
testonly = true
|
||||
deps = [
|
||||
"src/fuzzers:dawn_spirv_cross_glsl_fast_fuzzer",
|
||||
"src/fuzzers:dawn_spirv_cross_glsl_full_fuzzer",
|
||||
"src/fuzzers:dawn_spirv_cross_hlsl_fast_fuzzer",
|
||||
"src/fuzzers:dawn_spirv_cross_hlsl_full_fuzzer",
|
||||
"src/fuzzers:dawn_spirv_cross_msl_fast_fuzzer",
|
||||
"src/fuzzers:dawn_spirv_cross_msl_full_fuzzer",
|
||||
"src/fuzzers:dawn_wire_server_and_frontend_fuzzer",
|
||||
]
|
||||
}
|
||||
|
|
|
@ -92,19 +92,6 @@ dawn_fuzzer_test("dawn_spirv_cross_glsl_fast_fuzzer") {
|
|||
asan_options = [ "allow_user_segv_handler=1" ]
|
||||
}
|
||||
|
||||
# TODO(rharrison): Remove asan_options once signal trap is no longer
|
||||
# needed.
|
||||
# Varies both the options and input data
|
||||
dawn_fuzzer_test("dawn_spirv_cross_glsl_full_fuzzer") {
|
||||
sources = [
|
||||
"DawnSPIRVCrossGLSLFullFuzzer.cpp",
|
||||
]
|
||||
deps = [
|
||||
":dawn_spirv_cross_fuzzer_common",
|
||||
]
|
||||
asan_options = [ "allow_user_segv_handler=1" ]
|
||||
}
|
||||
|
||||
# TODO(rharrison): Remove asan_options once signal trap is no longer
|
||||
# needed.
|
||||
# Uses Dawn specific options and varies input data
|
||||
|
@ -118,19 +105,6 @@ dawn_fuzzer_test("dawn_spirv_cross_hlsl_fast_fuzzer") {
|
|||
asan_options = [ "allow_user_segv_handler=1" ]
|
||||
}
|
||||
|
||||
# TODO(rharrison): Remove asan_options once signal trap is no longer
|
||||
# needed.
|
||||
# Varies both the options and input data
|
||||
dawn_fuzzer_test("dawn_spirv_cross_hlsl_full_fuzzer") {
|
||||
sources = [
|
||||
"DawnSPIRVCrossHLSLFullFuzzer.cpp",
|
||||
]
|
||||
deps = [
|
||||
":dawn_spirv_cross_fuzzer_common",
|
||||
]
|
||||
asan_options = [ "allow_user_segv_handler=1" ]
|
||||
}
|
||||
|
||||
# TODO(rharrison): Remove asan_options once signal trap is no longer
|
||||
# needed.
|
||||
# Uses Dawn specific options and varies input data
|
||||
|
@ -144,19 +118,6 @@ dawn_fuzzer_test("dawn_spirv_cross_msl_fast_fuzzer") {
|
|||
asan_options = [ "allow_user_segv_handler=1" ]
|
||||
}
|
||||
|
||||
# TODO(rharrison): Remove asan_options once signal trap is no longer
|
||||
# needed.
|
||||
# Varies both the options and input data
|
||||
dawn_fuzzer_test("dawn_spirv_cross_msl_full_fuzzer") {
|
||||
sources = [
|
||||
"DawnSPIRVCrossMSLFullFuzzer.cpp",
|
||||
]
|
||||
deps = [
|
||||
":dawn_spirv_cross_fuzzer_common",
|
||||
]
|
||||
asan_options = [ "allow_user_segv_handler=1" ]
|
||||
}
|
||||
|
||||
dawn_fuzzer_test("dawn_wire_server_and_frontend_fuzzer") {
|
||||
sources = [
|
||||
"DawnWireServerAndFrontendFuzzer.cpp",
|
||||
|
|
|
@ -76,15 +76,4 @@ namespace DawnSPIRVCrossFuzzer {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int RunWithOptions(const uint8_t* data, size_t size, TaskWithOptions task) {
|
||||
shaderc_spvc::CompileOptions options;
|
||||
size_t used = options.SetForFuzzing(data, size);
|
||||
if (used == 0) {
|
||||
// not enough data to set options
|
||||
return 0;
|
||||
}
|
||||
|
||||
return Run(data + used, size - used, std::bind(task, std::placeholders::_1, options));
|
||||
}
|
||||
|
||||
} // namespace DawnSPIRVCrossFuzzer
|
||||
|
|
|
@ -30,8 +30,4 @@ namespace DawnSPIRVCrossFuzzer {
|
|||
|
||||
// Used to fuzz by mutating the input data, but with fixed options to the compiler
|
||||
int Run(const uint8_t* data, size_t size, Task task);
|
||||
|
||||
// Used to fuzz by mutating both the input data and options to the compiler
|
||||
int RunWithOptions(const uint8_t* data, size_t size, TaskWithOptions task);
|
||||
|
||||
} // namespace DawnSPIRVCrossFuzzer
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
// Copyright 2018 The Dawn Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "DawnSPIRVCrossFuzzer.h"
|
||||
|
||||
namespace {
|
||||
|
||||
int GLSLFullFuzzTask(const std::vector<uint32_t>& input, shaderc_spvc::CompileOptions options) {
|
||||
shaderc_spvc::Compiler compiler;
|
||||
if (!compiler.IsValid()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
DawnSPIRVCrossFuzzer::ExecuteWithSignalTrap([&compiler, &input, &options]() {
|
||||
compiler.CompileSpvToGlsl(input.data(), input.size(), options);
|
||||
});
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
return DawnSPIRVCrossFuzzer::RunWithOptions(data, size, GLSLFullFuzzTask);
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
// Copyright 2018 The Dawn Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "DawnSPIRVCrossFuzzer.h"
|
||||
|
||||
namespace {
|
||||
int FuzzTask(const std::vector<uint32_t>& input, shaderc_spvc::CompileOptions options) {
|
||||
shaderc_spvc::Compiler compiler;
|
||||
if (!compiler.IsValid()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
DawnSPIRVCrossFuzzer::ExecuteWithSignalTrap([&compiler, &input, &options]() {
|
||||
compiler.CompileSpvToHlsl(input.data(), input.size(), options);
|
||||
});
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
return DawnSPIRVCrossFuzzer::RunWithOptions(data, size, FuzzTask);
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
// Copyright 2018 The Dawn Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "DawnSPIRVCrossFuzzer.h"
|
||||
|
||||
namespace {
|
||||
|
||||
int FuzzTask(const std::vector<uint32_t>& input, shaderc_spvc::CompileOptions options) {
|
||||
shaderc_spvc::Compiler compiler;
|
||||
if (!compiler.IsValid()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
DawnSPIRVCrossFuzzer::ExecuteWithSignalTrap([&compiler, &input, &options]() {
|
||||
compiler.CompileSpvToMsl(input.data(), input.size(), options);
|
||||
});
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
return DawnSPIRVCrossFuzzer::RunWithOptions(data, size, FuzzTask);
|
||||
}
|
Loading…
Reference in New Issue