diff --git a/scripts/check-lazy-pages-fuzzer.sh b/scripts/check-lazy-pages-fuzzer.sh index 3f283bb7416..9a3ee0d276c 100755 --- a/scripts/check-lazy-pages-fuzzer.sh +++ b/scripts/check-lazy-pages-fuzzer.sh @@ -38,20 +38,20 @@ main() { if echo $OUTPUT | grep -q 'SIG: Unprotect WASM memory at address' && \ ! echo $OUTPUT | grep -iq "ERROR" then - echo -e "\nSuccess" + echo "Success" exit 0 else cat $OUTPUT_FILE - echo -e "\nFailure" + echo "Failure" print_seed exit 1 fi } print_seed() { - echo -e "\n Seed start: \"" + echo "Seed start: \"" xxd -p $FUZZER_INPUT_FILE | tr --delete '\n' - echo -e "\n\" seed end." + echo "\" seed end." } main diff --git a/utils/lazy-pages-fuzzer/src/lib.rs b/utils/lazy-pages-fuzzer/src/lib.rs index e704888e393..bd8d5481ef5 100644 --- a/utils/lazy-pages-fuzzer/src/lib.rs +++ b/utils/lazy-pages-fuzzer/src/lib.rs @@ -81,20 +81,21 @@ impl RunResult { assert_eq!(wasmer_res.pages.len(), wasmi_res.pages.len()); for ( - (wasmer_addr, (wasmer_page_info, wasmer_page_mem)), + (wasmer_addr, (wasmer_page_info, mut wasmer_page_mem)), (wasmi_addr, (wasmi_page_info, wasmi_page_mem)), ) in wasmer_res .pages .into_iter() .zip(wasmi_res.pages.into_iter()) { - let lower_bytes_page_mask = ((INITIAL_PAGES as usize) * WASM_PAGE_SIZE) - 1; + assert_eq!(wasmer_page_info, wasmi_page_info, + "wasmer page mem 0x{wasmer_addr:X?} wasmi page mem 0x{wasmi_addr:X?}", + ); assert_eq!( - lower_bytes_page_mask & wasmer_addr, - lower_bytes_page_mask & wasmi_addr + wasmer_page_mem, wasmi_page_mem, + "wasmer page mem 0x{wasmer_addr:X?} wasmi page mem 0x{wasmi_addr:X?} \ + with content: 0x{wasmer_page_mem:X?} 0x{wasmi_page_mem:X?}", ); - assert_eq!(wasmer_page_info, wasmi_page_info); - assert_eq!(wasmer_page_mem, wasmi_page_mem); } assert_eq!(wasmer_res.globals, wasmi_res.globals);