Skip to content
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

After starting up evcxr produces an error -> Initialization failed: Child process terminated with status: signal: 9 #210

Open
phil-markarian opened this issue Jan 5, 2022 · 20 comments

Comments

@phil-markarian
Copy link

Not sure why this error arrises but, I followed the directions on the github page for installation. I am on a Macbook Air M1, so I am thinking that this might possibly be the issue. I never had the issue when installing and running it on WSL on Windows. Any ideas on how to solve this issue?

@davidlattimore
Copy link
Collaborator

I don't have much by way of ideas I'm afraid. The only Mac I have access to is github's CI infrastructure which runs the tests when new commits are pushed. It currently passes there. The only thing that comes to mind is that you could try cloning the evcxr repository and running cargo test - probably the tests will fail for you due to whatever environmental difference is causing the problem, but it might give some clues. Sorry I can't be of more help, and if you do figure out how to make it work, I'd love to know.

@sigmaSd
Copy link

sigmaSd commented Jan 8, 2022

Might be relevent rust-lang/cargo#8913

@phil-markarian
Copy link
Author

phil-markarian commented Jan 8, 2022

I ran cargo test and it came back with an error that said
error: failed to run custom build command for zmq-sys v0.11.0`

Caused by:
process didn't exit successfully: /Users/tatsuo/Study/evcxr/target/debug/build/zmq-sys-789ee30eca8f2ad1/build-script-main (exit status: 101)
--- stdout
cargo:rerun-if-changed=build/main.rs
cargo:rerun-if-env-changed=PROFILE
CMAKE_TOOLCHAIN_FILE_aarch64-apple-darwin = None
CMAKE_TOOLCHAIN_FILE_aarch64_apple_darwin = None
HOST_CMAKE_TOOLCHAIN_FILE = None
CMAKE_TOOLCHAIN_FILE = None
CMAKE_GENERATOR_aarch64-apple-darwin = None
CMAKE_GENERATOR_aarch64_apple_darwin = None
HOST_CMAKE_GENERATOR = None
CMAKE_GENERATOR = None
CMAKE_PREFIX_PATH_aarch64-apple-darwin = None
CMAKE_PREFIX_PATH_aarch64_apple_darwin = None
HOST_CMAKE_PREFIX_PATH = None
CMAKE_PREFIX_PATH = None
CMAKE_aarch64-apple-darwin = None
CMAKE_aarch64_apple_darwin = None
HOST_CMAKE = None
CMAKE = None
running: "cmake" "/Users/tatsuo/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/zeromq-src-0.1.10+4.3.2/vendor" "-DCMAKE_INSTALL_LIBDIR=lib" "-DCMAKE_C_STANDARD=99" "-DZMQ_BUILD_TESTS=OFF" "-DENABLE_DRAFTS=OFF" "-DENABLE_CURVE=ON" "-DCMAKE_BUILD_TYPE=Debug" "-DWITH_PERF_TOOL=OFF" "-DBUILD_SHARED=OFF" "-DBUILD_STATIC=ON" "-DWITH_LIBSODIUM=OFF" "-DCMAKE_INSTALL_PREFIX=/Users/tatsuo/Study/evcxr/target/debug/build/zmq-sys-d25729612476a92f/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -arch arm64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -arch arm64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -arch arm64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc"

--- stderr
thread 'main' panicked at '
failed to execute command: No such file or directory (os error 2)
is cmake not installed?

build script failed, must exit now', /Users/tatsuo/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cmake-0.1.46/src/lib.rs:974:5
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed`

After reading the error I installed cmake via brew and rest cargo test again and got

`error[E0658]: use of unstable library feature 'iter_map_while': recently added
--> /Users/tatsuo/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/ra_ap_ide_db-0.0.87/src/helpers.rs:313:55
|
313 | input.syntax().children_with_tokens().skip(1).map_while(|it| match it.into_token() {
| ^^^^^^^^^
|
= note: see issue #68537 rust-lang/rust#68537 for more information

For more information about this error, try rustc --explain E0658.
error: could not compile ra_ap_ide_db due to previous error
warning: build failed, waiting for other jobs to finish...`

so I am going to look into the issue link that it gave to see if I can fix it.

@bjorn3
Copy link

bjorn3 commented Jan 8, 2022

  1. Have you installed cmake? zmq-sys needs it to build the libzmq library.
  2. Which rustc version do you use? You can run rustc -V to see this.

@davidlattimore
Copy link
Collaborator

Ah, I guess although you have the dependencies required for evcxr_repl, you don't have the dependencies required for evcxr_jupyter. You can run just the evcxr tests, by running cargo test -p evcxr.

@phil-markarian
Copy link
Author

  1. Have you installed cmake? zmq-sys needs it to build the libzmq library.
  2. Which rustc version do you use? You can run rustc -V to see this.
  1. Yeah, I installed it. The post didn't format correctly so it is hard to see that I wrote that I added cmake after that error came up and when I ran cargo test again a different error arose.
  2. version 1.56.1

@bjorn3
Copy link

bjorn3 commented Jan 8, 2022

  1. version 1.56.1

The minimal supported rustc version of rust-analyzer is 1.57: https://github.com/rust-analyzer/rust-analyzer/blob/0f8c96c92689af8378dbe9f466c6bf15a3a27458/xtask/Cargo.toml#L7 Rust-analyzer is used by evcxr to get the type of variables that should be preserved between inputs.

@phil-markarian
Copy link
Author

  1. version 1.56.1

The minimal supported rustc version of rust-analyzer is 1.57: https://github.com/rust-analyzer/rust-analyzer/blob/0f8c96c92689af8378dbe9f466c6bf15a3a27458/xtask/Cargo.toml#L7 Rust-analyzer is used by evcxr to get the type of variables that should be preserved between inputs.

So I tried updating and finally have been able to run cargo test -p evcxr finally. However the some of the tests did not pass.

`running 21 tests
test cargo_metadata::tests::test_library_names_from_metadata ... ok
test eval_context::tests::test_replace_reserved_words_in_type ... ok
test crate_config::tests::make_paths_absolute ... ok
test code_block::test::basic_usage ... ok
test rust_analyzer::test::test_is_type_valid ... ok
test statement_splitter::test::crate_attributes ... ok
test statement_splitter::test::expression ... ok
test statement_splitter::test::macro_call ... ok
test statement_splitter::test::multiple_lines ... ok
test statement_splitter::test::else_statements ... ok
test eval_context::tests::test_attributes ... ok
test statement_splitter::test::single_line_use_and_expr ... ok
test statement_splitter::test::partial_code ... ok
test statement_splitter::test::single_line ... ok
test use_trees::tests::test_glob ... ok
test statement_splitter::test::statement_ends_with_brace ... ok
test use_trees::tests::test_complex_tree ... ok
test use_trees::tests::test_underscore ... ok
test cargo_metadata::tests::invalid_feature ... ok
test cargo_metadata::tests::valid_dependency ... ok
test rust_analyzer::test::get_variable_types ... ok

test result: ok. 21 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.11s

 Running unittests (target/debug/deps/testing_runtime-7df946f1793c0275)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

 Running tests/integration_tests.rs (target/debug/deps/integration_tests-c18652f8b64bc046)

running 37 tests
test crate_name_with_hyphens ... FAILED
test const_generics_with_explicit_type ... FAILED
test abort_and_restart ... FAILED
test continue_execution_after_bad_use_statement ... FAILED
test check_for_errors ... FAILED
test error_from_macro_expansion ... FAILED
test format ... FAILED
test define_then_call_function ... FAILED
test int_array ... FAILED
test define_then_call_macro ... FAILED
test code_completion ... FAILED
test invalid_code ... FAILED
test missing_semicolon_on_let_stmt ... FAILED
test multiple_identical_use_statements ... FAILED
test non_concrete_types ... FAILED
test non_semi_statements ... FAILED
test moved_value ... FAILED
test partial_destructuring ... FAILED
test question_mark_operator ... FAILED
test partially_inferred_variable_type ... FAILED
test print_then_assign_variable ... FAILED
test rc_refcell_etc ... FAILED
test redefine_type_with_existing_var ... FAILED
test reserved_words ... FAILED
test save_and_restore_variables ... FAILED
test single_statement ... FAILED
test statement_and_expression ... FAILED
test repeated_use_statements ... FAILED
test struct_type_inference ... FAILED
test tls_implementing_drop ... FAILED
test unnamable_type_closure ... FAILED
test unnamable_type_impl_trait ... FAILED
test variable_assignment_compile_fail_then_use_statement ... FAILED
test crate_deps ... FAILED
test printing ... FAILED
test function_panics_without_variable_preserving ... FAILED
test function_panics_with_variable_preserving ... FAILED

failures:

---- crate_name_with_hyphens stdout ----
thread 'crate_name_with_hyphens' panicked at 'called Result::unwrap() on an Err value: ChildProcessTerminated("Child process terminated with status: signal: 9")', evcxr/src/eval_context.rs:256:18
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

---- const_generics_with_explicit_type stdout ----
thread 'const_generics_with_explicit_type' panicked at 'called Result::unwrap() on an Err value: ChildProcessTerminated("Child process terminated with status: signal: 9")', evcxr/src/eval_context.rs:256:18

---- abort_and_restart stdout ----
thread 'abort_and_restart' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- continue_execution_after_bad_use_statement stdout ----
thread 'continue_execution_after_bad_use_statement' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- check_for_errors stdout ----
thread 'check_for_errors' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- error_from_macro_expansion stdout ----
thread 'error_from_macro_expansion' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- format stdout ----
thread 'format' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- define_then_call_function stdout ----
thread 'define_then_call_function' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- int_array stdout ----
thread 'int_array' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- define_then_call_macro stdout ----
thread 'define_then_call_macro' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- code_completion stdout ----
thread 'code_completion' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- invalid_code stdout ----
thread 'invalid_code' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- missing_semicolon_on_let_stmt stdout ----
thread 'missing_semicolon_on_let_stmt' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- multiple_identical_use_statements stdout ----
thread 'multiple_identical_use_statements' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- non_concrete_types stdout ----
thread 'non_concrete_types' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- non_semi_statements stdout ----
thread 'non_semi_statements' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- moved_value stdout ----
thread 'moved_value' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- partial_destructuring stdout ----
thread 'partial_destructuring' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- question_mark_operator stdout ----
thread 'question_mark_operator' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- partially_inferred_variable_type stdout ----
thread 'partially_inferred_variable_type' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- print_then_assign_variable stdout ----
thread 'print_then_assign_variable' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- rc_refcell_etc stdout ----
thread 'rc_refcell_etc' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- redefine_type_with_existing_var stdout ----
thread 'redefine_type_with_existing_var' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- reserved_words stdout ----
thread 'reserved_words' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- save_and_restore_variables stdout ----
thread 'save_and_restore_variables' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- single_statement stdout ----
thread 'single_statement' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- statement_and_expression stdout ----
thread 'statement_and_expression' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- repeated_use_statements stdout ----
thread 'repeated_use_statements' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- struct_type_inference stdout ----
thread 'struct_type_inference' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- tls_implementing_drop stdout ----
thread 'tls_implementing_drop' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- unnamable_type_closure stdout ----
thread 'unnamable_type_closure' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- unnamable_type_impl_trait stdout ----
thread 'unnamable_type_impl_trait' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- variable_assignment_compile_fail_then_use_statement stdout ----
thread 'variable_assignment_compile_fail_then_use_statement' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', evcxr/tests/integration_tests.rs:118:37

---- crate_deps stdout ----
thread 'crate_deps' panicked at 'called Result::unwrap() on an Err value: ChildProcessTerminated("Child process terminated with status: signal: 9")', evcxr/src/eval_context.rs:256:18

---- printing stdout ----
thread 'printing' panicked at 'called Result::unwrap() on an Err value: ChildProcessTerminated("Child process terminated with status: signal: 9")', evcxr/src/eval_context.rs:256:18

---- function_panics_without_variable_preserving stdout ----
thread 'function_panics_without_variable_preserving' panicked at 'called Result::unwrap() on an Err value: ChildProcessTerminated("Child process terminated with status: signal: 9")', evcxr/src/eval_context.rs:256:18

---- function_panics_with_variable_preserving stdout ----
thread 'function_panics_with_variable_preserving' panicked at 'called Result::unwrap() on an Err value: ChildProcessTerminated("Child process terminated with status: signal: 9")', evcxr/src/eval_context.rs:256:18

failures:
abort_and_restart
check_for_errors
code_completion
const_generics_with_explicit_type
continue_execution_after_bad_use_statement
crate_deps
crate_name_with_hyphens
define_then_call_function
define_then_call_macro
error_from_macro_expansion
format
function_panics_with_variable_preserving
function_panics_without_variable_preserving
int_array
invalid_code
missing_semicolon_on_let_stmt
moved_value
multiple_identical_use_statements
non_concrete_types
non_semi_statements
partial_destructuring
partially_inferred_variable_type
print_then_assign_variable
printing
question_mark_operator
rc_refcell_etc
redefine_type_with_existing_var
repeated_use_statements
reserved_words
save_and_restore_variables
single_statement
statement_and_expression
struct_type_inference
tls_implementing_drop
unnamable_type_closure
unnamable_type_impl_trait
variable_assignment_compile_fail_then_use_statement

test result: FAILED. 0 passed; 37 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.17s

error: test failed, to rerun pass '-p evcxr --test integration_tests'`

@davidlattimore
Copy link
Collaborator

Thanks for trying that. It looks like they're failing in the same way as when you run the evcxr repl - child process gets sent signal 9, which I assume is a SIGKILL like it is on Linux. Did anything in the issue that sigmaSd linked above seem like it might be relevant? In particular the last post on that issue:

This problem drove me nuts. The underlying issue was that I was running a shell from homebrew (bash), which was running under emulation, and confusing the architecture detection of everything that was running underneath.

arch -arm64e sh and going back to the default shells fixed this.

@phil-markarian
Copy link
Author

Thanks for trying that. It looks like they're failing in the same way as when you run the evcxr repl - child process gets sent signal 9, which I assume is a SIGKILL like it is on Linux. Did anything in the issue that sigmaSd linked above seem like it might be relevant? In particular the last post on that issue:

This problem drove me nuts. The underlying issue was that I was running a shell from homebrew (bash), which was running under emulation, and confusing the architecture detection of everything that was running underneath.
arch -arm64e sh and going back to the default shells fixed this.

So I uninstalled rust and rustup with homebrew and installed the normal way. After reinstalling the normal way and downloading evcxr everything seemed to run perfectly. Thanks.

davidlattimore added a commit that referenced this issue Jan 16, 2022
This will hopefully help people who run into #210 in future.
@macintacos
Copy link

This probably needs to be reopened - I installed Rust via "normal" means (not using Homebrew) and am getting this exact error. Trying to use a "default" shell still results in the same problem (I use Fish, but it doesn't seem to matter).

I cloned the repository and ran cargo test and got the same exact results as from this comment.

$ rustc --version
rustc 1.59.0

@davidlattimore
Copy link
Collaborator

@macintacos, if you run arch -arm64e sh then run evcxr from the resulting shell, does that make any difference?

@macintacos
Copy link

@davidlattimore nope, unfortunately it does not.

@davidlattimore
Copy link
Collaborator

@macintacos, what does rustc -vV show? From the issue linked by sigmaSd above, it sounds like an issue related to compiling for the wrong architecture.

You could try running:

EVCXR_TMPDIR=$HOME/tmp/e1 evcxr

Then once you exit, have a look at ~/tmp/e1. In particular, what type of file got compiled. For me on Linux, I can run

file ~/tmp/e1/target/x86_64-unknown-linux-gnu/debug/libctx.so

On Mac, I guess it would be libctx.dylib instead of libctx.so.

Then if we compare that with the type of the evcxr executable:

file `which evcxr`

For me the shared object and executable are:

ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked
ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked

So both are x86-64 for me. Are yours the same as each other?

@macintacos
Copy link

Here's what I get from rustc -vV:

$ rustc -vV
rustc 1.59.0
binary: rustc
commit-hash: unknown
commit-date: unknown
host: aarch64-apple-darwin
release: 1.59.0
LLVM version: 13.0.0

Checking the executable files, I get:

$ file ~/tmp/e1/target/debug/libctx.dylib
/Users/macinburrito/tmp/e1/target/debug/libctx.dylib: Mach-O 64-bit dynamically linked shared library arm64
$ file $(which evcxr)
/Users/macinburrito/.cargo/bin/evcxr: Mach-O 64-bit executable arm64

They both seem to be arm64 for me, and the path generated at ~/tmp/e1 was slightly different from what you see on Linux it seems but I did fine libctx.dylib like you stated.

@davidlattimore
Copy link
Collaborator

You might be able to gain more clues as to what's going on by running evcxr and loading and running the dylib.

If you create a temporary directory similar to the above:

EVCXR_TMPDIR=$HOME/tmp/e1 evcxr
Welcome to evcxr. For help, type :help
>> println!("Hello, world");
Hello, world

Then run something like the following:

OBJ=$HOME/tmp/e1/target/debug/deps/libcode_2.dylib; echo "LOAD_AND_RUN $OBJ $(nm -j $OBJ | grep run_user_code)" | EVCXR_IS_RUNTIME=1 evcxr

I'm assuming that OSX has an nm command. I'm just using it here to find the name of the function in the dylib that evcxr needs to call. If you don't have nm, the function name is likely to be run_user_code_1, in which case you can run:

OBJ=$HOME/tmp/e1/target/debug/deps/libcode_2.dylib; echo "LOAD_AND_RUN $OBJ run_user_code_1" | EVCXR_IS_RUNTIME=1 evcxr

When I run my equivalent to the above, I get the following output:

Hello, world
EVCXR_EXECUTION_COMPLETE

Hopefully when you do that you get an error similar to what you get when you run evcxr normally - i.e. something about SIGKILL.

From a bit of Googling, it sounds like OSX on M1 enforces that binaries are signed. I'm wondering if the evcxr binary is signed, but the dylib isn't. Apparently you can sign things with a command like codesign --force --deep --sign - /Applications/something.app. I guess you could try something like that on the dylib and see if that does anything.

If we can determine that missing signing is the problem, then hopefully we can work out what should be signing things that isn't and fix that.

@phil-markarian phil-markarian reopened this Jun 7, 2022
@macintacos
Copy link

Yeah I get an immediate killed message when running that (I switched to using Bash just in case this was a Fish shell problem, but I'm seeing the same thing in both spots):

bash-5.1$ EVCXR_TMPDIR=$HOME/tmp/e1 evcxr
Welcome to evcxr. For help, type :help
>>
Initialization failed: Child process terminated with status: signal: 9

bash-5.1$ OBJ=$HOME/tmp/e1/target/debug/deps/libcode_1.dylib; echo "LOAD_AND_RUN $OBJ $(nm -j $OBJ | grep run_user_code)" | EVCXR_IS_RUNTIME=1 evcxr
Killed: 9

I tried running codesign manually, and didn't see any other change in behavior, but I'm unfamiliar with code signing so perhaps I'm doing it wrong:

bash-5.1$ codesign --force --deep --sign - $HOME/tmp/e1/target/debug/deps/libcode_1.dylib
/Users/macinburrito/tmp/e1/target/debug/deps/libcode_1.dylib: replacing existing signature
bash-5.1$ OBJ=$HOME/tmp/e1/target/debug/deps/libcode_1.dylib; echo "LOAD_AND_RUN $OBJ $(nm -j $OBJ | grep run_user_code)" | EVCXR_IS_RUNTIME=1 evcxr
Killed: 9

@davidlattimore
Copy link
Collaborator

Thanks for trying that. Could you check if the tests for libloading pass? Evcxr uses libloading to load .so/.dylib etc and obtain pointers to the functions contained within.

@macintacos
Copy link

Did you just mean to clone that repository and run cargo test? If so, I did that and got the following (seems like tests there passed just fine):

$ cargo test
    Finished test [unoptimized + debuginfo] target(s) in 0.02s
     Running unittests (target/debug/deps/libloading-00e215ba060103c5)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/constants.rs (target/debug/deps/constants-9447332cc3252abb)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/functions.rs (target/debug/deps/functions-ea01ee14b17799f3)

running 12 tests
test interior_null_fails ... ok
test test_incompatible_type_named_fn ... ok
test test_id_struct ... ok
test test_id_u32 ... ok
test test_0_no_0 ... ok
test missing_symbol_fails ... ok
test wrong_name_fails ... ok
test test_static_ptr ... ok
test test_incompatible_type ... ok
test test_static_u32 ... ok
test library_this_get ... ok
test manual_close_many_times ... ok

test result: ok. 12 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.57s

     Running tests/library_filename.rs (target/debug/deps/library_filename-c07a23632d4e4b93)

running 1 test
test test_library_filename ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/markers.rs (target/debug/deps/markers-e69cc2159f216fdc)

running 11 tests
test check_error_send ... ok
test check_error_display ... ok
test check_error_sync ... ok
test check_library_send ... ok
test check_library_sync ... ok
test check_symbol_sync ... ok
test check_symbol_send ... ok
test check_unix_library_send ... ok
test check_unix_library_sync ... ok
test check_unix_symbol_send ... ok
test check_unix_symbol_sync ... ok

test result: ok. 11 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/windows.rs (target/debug/deps/windows-0154713b8ba40229)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests libloading

running 10 tests
test src/os/mod.rs - os (line 11) ... ignored
test src/safe.rs - safe::Symbol::lift_option (line 259) - compile ... ok
test src/lib.rs - (line 26) - compile ... ok
test src/safe.rs - safe::Library::get (line 116) - compile ... ok
test src/safe.rs - safe::Symbol::from_raw (line 236) - compile ... ok
test src/safe.rs - safe::Library::new (line 74) - compile ... ok
test src/safe.rs - safe::Library::get (line 125) - compile ... ok
test src/safe.rs - safe::Symbol::into_raw (line 213) - compile ... ok
test src/safe.rs - safe::Library::get (line 139) - compile ... ok
test src/lib.rs - library_filename (line 65) ... ok

test result: ok. 9 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.17s

@davidlattimore
Copy link
Collaborator

Thanks @macintacos, yep, that's what I had in mind. That's interesting that the libloading tests pass. Some of those tests use the rust compiler to compile dynamic libraries, then load and run them - which is pretty much what evcxr does. I'm at a bit of a loss as to what the difference might be.

It's unfortunate that OSX doesn't give us more of a clue as to what the problem is. There's not some kind of system log that might indicate the cause of the termination is there?

The only other option I can think of, is I could write a few tests that might narrow down what the problem is and you could try running them and see which ones pass and which don't.

I was wondering if perhaps it was the pointer authentication that is used on the M1, but as far as I can tell, that should result in a segfault if violated, not a signal 9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants