-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The fuzzer is not working #27
Comments
The polished c code
line 1258-1266
I'm not sure what polished code is... |
Sorry, I was a bit wrong. String literals were not the source of problem. After I fixed my "volatile ": "",
"static ": "",
"extern ": "",
- "__restrict": "",
+ "restrict": "",
+ "_Nullable": "",
+ "inline ": "",
+ r"0x[0-9a-fA-F]*\.[0-9a-fA-F]*p\-?[0-9]*f?": "1.0f",
+ r"0x[0-9a-fA-F]+p\-?[0-9]*f?": "1.0f",
+ r"__asm\(.*\)": "",
+ r"\".*\",": "",
"long __undefined;": "",
"return 0;": "return crc32_context % 128;",
- r"__attribute__ \(\(.*\)\)": "",
+ r"__attribute__ ?\(\(.*\)\)": "",
"_Float128": "long double",
"union": "struct",
r"enum\s*\{[^\}]*\};": "", If it is not a macOS-specific problem, I believe that |
Thank you for pointing out that. We're actively working on fixing the fuzzer. I promise we will upload a new vesion by the end of this week. Sorry again for the inconvenience. |
It's now fixed in a recent commit: kaist-cp/kecc-public@9383908 |
Still, I couldn't pass fuzz testing because the following code fragment with enum type was left in
This type was never used in the code, so by just adding the following replace string, I could pass the fuzz testing: Please consider adding this case. |
@LockOne Could you state in which environment (including kernel version) you are trying to run the fuzzer? We do some testing on ourselves (in provided server), however we couldn't encounter the problem. Indeed, it seems hard to reproduce the same error. |
Ubuntu 16.04.6 with gcc v5.4.0 My |
@LockOne We appreciate not only reporting an issue but also suggesting a working patch. However, it seems removing the next line no matter what. (Although the sentence shall start with |
As @Medowhill already pointed out in his suggestion, diff --git a/src/c/parse.rs b/src/c/parse.rs
index be36ba6..19b6de3 100644
--- a/src/c/parse.rs
+++ b/src/c/parse.rs
@@ -217,7 +217,7 @@ impl AssertSupported for Declarator {
fn assert_supported(&self) {
self.kind.assert_supported();
self.derived.assert_supported();
- self.extensions.is_empty();
+ assert_eq!(true, self.extensions.is_empty());
}
}
@@ -282,7 +282,7 @@ impl AssertSupported for ParameterDeclaration {
fn assert_supported(&self) {
self.specifiers.assert_supported();
self.declarator.assert_supported();
- self.extensions.is_empty();
+ assert_eq!(true, self.extensions.is_empty());
}
}
diff --git a/tests/fuzz.py b/tests/fuzz.py
index f7ebcb2..1db1de3 100644
--- a/tests/fuzz.py
+++ b/tests/fuzz.py
@@ -36,6 +36,8 @@ REPLACE_DICT = {
"\"g_\w*\", ": "", # transparent_crc에서 프린트 목적으로 받은 StringLiteral 삭제
"char\* vname, ": "", # transparent_crc에서 사용하지 않는 파라미터 삭제
r"[^\n]*_IO_2_1_[^;]*;": "", # extern을 지우면서 생긴 size를 알 수 없는 struct 삭제
+ r"__asm\s*\([^\)]*\)": "", # asm extension in mac
+ r"__asm__\s*\([^\)]*\)": "", # asm extension in linux
}
CSMITH_DIR = "csmith-2.3.0" |
After the update, the fuzzer shows the following:
When I run
cargo run --release --bin fuzz -- -p /Users/medowhill/workspace/rust/kecc-public/tests/test_polished.c
, I can see the parser has panicked because of the unsupported features of KECC.I tried again after revising
fuzz.py
as below, but string literals in generated code are problematic. I tried removing string literals, but it makes parsing fails.As I am using macOS, I have not tried in Linux. Can it be a macOS-specific problem of
csmith
?The text was updated successfully, but these errors were encountered: