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

crash when trying to load a library #11697

Open
Polygons1 opened this issue Jun 8, 2024 · 1 comment
Open

crash when trying to load a library #11697

Polygons1 opened this issue Jun 8, 2024 · 1 comment
Labels
crash An issue that could cause a crash

Comments

@Polygons1
Copy link

How can we reproduce the crash?

// Bun code
import { dlopen, FFIType, suffix } from "bun:ffi";

// Path to the dynamic library
const path = `./libsshot.${suffix}`;

// Load the dynamic library
const {
  symbols: {
    main, // the function to call
  },
} = dlopen(
  path, // the library name or file path
  {
    main: {
      // no arguments, returns a pointer to a string
      args: [],
      returns: FFIType.cstring,
    },
  }
);

// Call the function and log the result
const result = main();
console.log(`Result from Rust: ${result}`);

Relevant log output

============================================================
Bun v1.1.10 (5102a944) macOS Silicon
Args: "bun" "test.ts"
Features: jsc 
Builtins: "bun:ffi" "bun:main" 
Elapsed: 678ms | User: 23ms | Sys: 62ms
RSS: 32.65MB | Peak: 73.99MB | Commit: 1.07GB | Faults: 1029

panic(main thread): Segmentation fault at address 0x14D800000
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:

 https://bun.report/1.1.10/Ma15102a94AC__uy7sJ_mozvpC+p1vpCmozvpCmrompCuo344B_A2CggggwtC

zsh: trace trap  bun test.ts

Stack Trace (bun.report)

Bun v1.1.10 (5102a94) on macos aarch64 [AutoCommand]

Segmentation fault at address 0x14D800000

  • 2 unknown/js code
  • src.bun.js.base.wrapStaticMethod__struct_336730.method
  • 1 unknown/js code
  • llint_entry
  • llint_entry
  • llint_entry
  • vmEntryToJavaScript
  • JSC::AbstractModuleRecord::evaluate
  • 1 unknown/js code
@Polygons1 Polygons1 added the crash An issue that could cause a crash label Jun 8, 2024
@nektro
Copy link
Member

nektro commented Nov 19, 2024

what is the source of libsshot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash An issue that could cause a crash
Projects
None yet
Development

No branches or pull requests

2 participants