1 /*
2  *
3  * honggfuzz - sanitizer coverage feedback parsing
4  * -----------------------------------------------
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License"); you may
7  * not use this file except in compliance with the License. You may obtain
8  * a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15  * implied. See the License for the specific language governing
16  * permissions and limitations under the License.
17  *
18  */
19 
20 #ifndef _HF_SANCOV_H_
21 #define _HF_SANCOV_H_
22 
23 /*
24  * SIGABRT is not a monitored signal for Android OS, since it produces lots of useless
25  * crashes due to way Android process termination hacks work. As a result the sanitizer's
26  * 'abort_on_error' flag cannot be utilized since it invokes abort() internally. In order
27  * to not lose crashes a custom exitcode is registered and monitored. Since exitcode is a
28  * global flag, it's assumed that target is compiled with only one sanitizer enabled at a
29  * time.
30  */
31 #define HF_MSAN_EXIT_CODE   103
32 #define HF_ASAN_EXIT_CODE   104
33 #define HF_UBSAN_EXIT_CODE  105
34 
35 /* Prefix for sanitizer report files */
36 #define kLOGPREFIX          ".hf.san"
37 
38 extern void sancov_Analyze(honggfuzz_t * hfuzz, fuzzer_t * fuzzer);
39 extern bool sancov_Init(honggfuzz_t * hfuzz);
40 extern bool sancov_prepareExecve(honggfuzz_t * hfuzz);
41 
42 #endif                          /* _HF_SANCOV_H_ */
43