Skip to content

error: unsupported operation: can't call foreign function sigaltstack on OS linux #40

Open
@yunji-yunji

Description

  • Command: FUZZCHECK_ARGS="my test" MIRIFLAGS=-Zmiri-disable-isolation cargo +miri2 miri run
  • Environment: Linux G22L059 5.19.0-50-generic #50-Ubuntu SMP PREEMPT_DYNAMIC Mon Jul 10 18:24:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

  1. Error 1: I got the following error when trying to execute the above command using my custom Rustc toolchain (named miri2)."
thread 'main' panicked at 'could not find all relevant LLVM coverage sections: CannotFindSection { section: CovMap }', /home/y23kim/rust/fuzzcheck-rs/fuzzcheck/src/code_coverage_sensor/mod.rs:55:57
  1. Error 2: When I modified this part(/home/y23kim/rust/fuzzcheck-rs/fuzzcheck/src/code_coverage_sensor/mod.rs:55:57) to return an empty CoverageSensor struct, above error was disappeared but another error occurred.
error: unsupported operation: can't call foreign function `sigaltstack` on OS `linux`
  --> /home/y23kim/rust/fuzzcheck-rs/fuzzcheck/src/signals_handler.rs:46:17
   |
46 |     let stack = libc::sigaltstack(&signal_stack, std::ptr::null_mut());
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function `sigaltstack` on OS `linux`
   |
   = help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support

Are these two errors caused by using my custom RustC and MIRI Toolchain? The second one seems like an obvious bug, but I'm unable to speculate on the cause of the first one.


I attached my main function for your information.

  1 #![allow(unused_attributes)]
  2 #![feature(no_coverage)]
  3 #![feature(impl_trait_in_assoc_type)]
  4 use std::fmt::Debug;
  5 use serde::{Deserialize, Serialize};
  6 use fuzzcheck::{DefaultMutator, Mutator};
  7 use fuzzcheck::mutators::tuples::TupleStructure;
  8 use fuzzcheck::mutators::testing_utilities::test_mutator;
  9 
 10 #[derive(Serialize, Deserialize)]
 11 #[derive(Clone, Debug, PartialEq, Eq, Hash, DefaultMutator)]
 12 struct SampleStruct2<T, U> {
 13     x: T,
 14     y: U,
 15     z: U,
 16 }
 17 
 18 
 19 fn fuzz_target(s: &SampleStruct2<u16, u16>) {
 20     if s.x > 3 {
 21         return;
 22     } else {
 23         let _tmp = s.x + s.y + s.z;
 24     }
 25 }
 26 
 27 
 28 fn main() {
 29 
 30     let m = SampleStruct2::<u8, u8>::default_mutator();
 31     test_mutator(m, 1000., 1000., false, true, 100, 100);
 32     let result = fuzzcheck::fuzz_test(fuzz_target)
 33         .default_mutator()
 34         .serde_serializer()
 35         .default_sensor_and_pool()
 36         .arguments_from_cargo_fuzzcheck()
 37         .stop_after_first_test_failure(true)
 38         .launch();
 39     println!("after result");
 40 }

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions