Skip to content

Commit fb3f12d

Browse files
committed
---
yaml --- r: 5389 b: refs/heads/master c: d882f8e h: refs/heads/master i: 5387: 516960e v: v3
1 parent 32b6dd1 commit fb3f12d

File tree

2 files changed

+44
-11
lines changed

2 files changed

+44
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 13f57dfbea59273a0bad49c1d9aadb165459a275
2+
refs/heads/master: d882f8ee2f8e617595d3b44fbe609542dae29bcd

trunk/src/fuzzer/fuzzer.rs

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,28 @@ fn find_rust_files(&files: [str], path: str) {
3737
}
3838
}
3939

40+
41+
fn common_exprs() -> [ast::expr] {
42+
fn dse(e: ast::expr_) -> ast::expr {
43+
{ id: 0, node: e, span: ast_util::dummy_sp() }
44+
}
45+
46+
fn dsl(l: ast::lit_) -> ast::lit {
47+
{ node: l, span: ast_util::dummy_sp() }
48+
}
49+
50+
[dse(ast::expr_break),
51+
dse(ast::expr_cont),
52+
dse(ast::expr_fail(option::none)),
53+
dse(ast::expr_fail(option::some(@dse(ast::expr_lit(@dsl(ast::lit_str("boo"))))))),
54+
dse(ast::expr_ret(option::none)),
55+
dse(ast::expr_put(option::none)),
56+
dse(ast::expr_lit(@dsl(ast::lit_nil))),
57+
dse(ast::expr_lit(@dsl(ast::lit_bool(false)))),
58+
dse(ast::expr_lit(@dsl(ast::lit_bool(true))))
59+
]
60+
}
61+
4062
fn safe_to_steal_expr(e: @ast::expr) -> bool {
4163
alt e.node {
4264
/*
@@ -189,7 +211,7 @@ fn as_str(f: fn(io::writer)) -> str {
189211
fn check_variants_of_ast(crate: ast::crate, codemap: codemap::codemap,
190212
filename: str) {
191213
let stolen = steal(crate);
192-
check_variants_T(crate, codemap, filename, "expr", stolen.exprs, pprust::expr_to_str, replace_expr_in_crate);
214+
check_variants_T(crate, codemap, filename, "expr", /*common_exprs() +*/ stolen.exprs, pprust::expr_to_str, replace_expr_in_crate);
193215
check_variants_T(crate, codemap, filename, "ty", stolen.tys, pprust::ty_to_str, replace_ty_in_crate);
194216
}
195217

@@ -207,9 +229,9 @@ fn check_variants_T<T>(
207229
let L = vec::len(things);
208230

209231
if L < 100u {
210-
for each i: uint in under(uint::min(L, 10u)) {
211-
log_err "Replacing... " + stringifier(@things[i]);
212-
for each j: uint in under(uint::min(L, 10u)) {
232+
for each i: uint in under(uint::min(L, 20u)) {
233+
log_err "Replacing... #" + uint::str(i);
234+
for each j: uint in under(uint::min(L, 30u)) {
213235
log_err "With... " + stringifier(@things[j]);
214236
let crate2 = @replacer(crate, i, things[j]);
215237
// It would be best to test the *crate* for stability, but testing the
@@ -283,8 +305,12 @@ fn check_running(exe_filename: str) -> happiness {
283305
log_err "comb comb comb: " + comb;
284306
}
285307

286-
if contains(comb, "Assertion failed:") {
308+
if contains(comb, "Assertion failed: (0), function alloc, file ../src/rt/rust_obstack.cpp") {
309+
known_bug("https://github.com/graydon/rust/issues/32 / https://github.com/graydon/rust/issues/445")
310+
} else if contains(comb, "Assertion failed:") {
287311
failed("C++ assertion failure")
312+
} else if contains(comb, "src/rt/") {
313+
failed("Mentioned src/rt/")
288314
} else if contains(comb, "malloc") {
289315
failed("Mentioned malloc")
290316
} else if contains(comb, "leaked memory in rust main loop") {
@@ -295,7 +321,8 @@ fn check_running(exe_filename: str) -> happiness {
295321
100 { cleanly_rejected("running: explicit fail") }
296322
101 | 247 { cleanly_rejected("running: timed out") }
297323
245 | 246 { known_bug("https://github.com/graydon/rust/issues/32 ??") }
298-
rc { failed("exited with status " + int::str(rc)) }
324+
136 | 248 { known_bug("SIGFPE - https://github.com/graydon/rust/issues/944") }
325+
rc { failed("Rust program ran but exited with status " + int::str(rc)) }
299326
}
300327
}
301328
}
@@ -312,11 +339,17 @@ fn check_compiling(filename: str) -> happiness {
312339
//log_err #fmt("Status: %d", p.status);
313340
if p.err != "" {
314341
if contains(p.err, "May only branch on boolean predicates") {
315-
known_bug("https://github.com/graydon/rust/issues/892")
342+
known_bug("https://github.com/graydon/rust/issues/892 or https://github.com/graydon/rust/issues/943")
343+
} else if contains(p.err, "All operands to PHI node must be the same type as the PHI node!") {
344+
known_bug("https://github.com/graydon/rust/issues/943")
316345
} else if contains(p.err, "(S->getType()->isPointerTy() && \"Invalid cast\")") {
317346
known_bug("https://github.com/graydon/rust/issues/895")
347+
} else if contains(p.out, "Ptr must be a pointer to Val type") {
348+
known_bug("https://github.com/graydon/rust/issues/897")
318349
} else if contains(p.err, "(castIsValid(op, S, Ty) && \"Invalid cast!\"), function Create") {
319350
known_bug("https://github.com/graydon/rust/issues/901")
351+
} else if contains(p.err, "Invoking a function with a bad signature!") {
352+
known_bug("https://github.com/graydon/rust/issues/946")
320353
} else {
321354
log_err "Stderr: " + p.err;
322355
failed("Unfamiliar error message")
@@ -332,8 +365,6 @@ fn check_compiling(filename: str) -> happiness {
332365
known_bug("https://github.com/graydon/rust/issues/924")
333366
} else if contains(p.out, "Assertion failed: (S->getType()->isPointerTy() && \"Invalid cast\")") {
334367
known_bug("https://github.com/graydon/rust/issues/935")
335-
} else if contains(p.out, "Ptr must be a pointer to Val type") {
336-
known_bug("https://github.com/graydon/rust/issues/897")
337368
} else if contains(p.out, "Assertion") && contains(p.out, "failed") {
338369
log_err "Stdout: " + p.out;
339370
failed("Looks like an llvm assertion failure")
@@ -393,7 +424,9 @@ fn content_is_dangerous_to_run(code: str) -> bool {
393424
let dangerous_patterns =
394425
["import", // espeically fs, run
395426
"native",
396-
"unsafe"];
427+
"unsafe",
428+
"with", // tstate hang: https://github.com/graydon/rust/issues/948
429+
"log"]; // python --> rust pipe deadlock?
397430

398431
for p: str in dangerous_patterns { if contains(code, p) { ret true; } }
399432
ret false;

0 commit comments

Comments
 (0)