-
Notifications
You must be signed in to change notification settings - Fork 27
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
Segmentation fault with Deno Test #79
Labels
bug
Something isn't working
Comments
Please provide a reproduction and output from your terminal, otherwise we're guessing in the blind. |
@bartlomieju That was painful to derive but here we go. Can you try on your end? // src/lib.rs
use deno_bindgen::deno_bindgen;
use tokio::runtime::Runtime;
#[deno_bindgen]
fn ping() {}
#[deno_bindgen(non_blocking)]
fn start() {
let rt = Runtime::new().unwrap();
rt.block_on(F::new());
}
pub struct F {}
impl F {
pub async fn new() {
()
}
} # Cargo.toml
[package]
name = "native"
version = "0.1.0"
edition = "2021"
[lib]
name = "native"
crate-type = ["cdylib"]
[dependencies]
deno_bindgen = "0.5.1"
tokio = { version = "1.19.2", features = ["full"] } // a_test.ts
import * as native from "./bindings/bindings.ts";
Deno.test("a", async () => {
await native.start();
}) // b_test.ts
import * as native from "./bindings/bindings.ts";
Deno.test("B", async () => {
await native.ping();
}) # develop
cargo clean
deno_bindgen
deno test --unstable --allow-all a_test.ts
> Check file:///home/zifeo/repro/a_test.ts
> running 1 test from ./a_test.ts
> a ... ok (6ms)
>
> ok | 1 passed | 0 failed (55ms)
deno test --unstable --allow-all b_test.ts
> Check file:///home/zifeo/repro/b_test.ts
> running 1 test from ./b_test.ts
> B ... ok (4ms)
>
> ok | 1 passed | 0 failed (41ms)
deno test --unstable --allow-all b_test.ts a_test.ts
> Check file:///home/zifeo/repro/b_test.ts
> Check file:///home/zifeo/repro/a_test.ts
> running 1 test from ./b_test.ts
> B ... ok (3ms)
> running 1 test from ./a_test.ts
> a ... ok (6ms)
>
> ok | 2 passed | 0 failed (147ms)
deno test --unstable --allow-all a_test.ts b_test.ts
> Check file:///home/zifeo/repro/a_test.ts
> Check file:///home/zifeo/repro/b_test.ts
> running 1 test from ./a_test.ts
> a ... ok (6ms)
> 'deno test --unstable --allow-...' terminated by signal SIGSEGV (Address boundary error)
# production
cargo clean
deno_bindgen --release
deno test --unstable --allow-all a_test.ts b_test.ts
> Check file:///home/zifeo/repro/a_test.ts
> Check file:///home/zifeo/repro/b_test.ts
> running 1 test from ./a_test.ts
> a ... ok (5ms)
> running 1 test from ./b_test.ts
> B ... ok (4ms)
>
> ok | 2 passed | 0 failed (57ms) |
@littledivy can you take a look? |
@littledivy @bartlomieju Let me know if you need something else, this is definitely a blocker for the FFI. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I felt on case looking close what is described upstream in rust-lang/rust#88737. What debugging steps could be made in order to isolate further the issue (e.g. Deno and/or Rust and/or deeper)?
The text was updated successfully, but these errors were encountered: