Skip to content

Potential issue in concurrent initialisation in tests #278

Closed

Description

@xd009642

emotechlab/silero-rs#20

So we have an ort based library and our tests naturally load the model and do some stuff. It seems that they're hitting some sort of concurrent init panic. The user thinks it may be an issue in the environment.rs with concurrent initialisation and I'm inclined to agree. With that in mind, are you opposed to putting the unsafe cell behind some sort of lock or providing a thread-safe initialisation or should I just figure out a way to handle this ourselves (advice welcome)?

Here's a selection of errors:

snapshot-922dfd7ba42f0d16(48386,0x700009d8f000) malloc: Heap corruption detected, free list is damaged at 0x600000f90600
*** Incorrect guard value: 60851421382143
snapshot-922dfd7ba42f0d16(48386,0x700009d8f000) malloc: *** set a breakpoint in malloc_error_break to debug
error: test failed, to rerun pass `--test snapshot`
---- chunk_30_default_params_16k stdout ----
thread 'chunk_30_default_params_16k' panicked at /Users/robert/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ort-2.0.0-rc.4/src/environment.rs:51:9:
assertion `left != right` failed
  left: 0x0
 right: 0x0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    chunk_30_default_params_16k
running 6 tests
test chunk_20_default_params_16k ... FAILED
error: test failed, to rerun pass `--test snapshot`

Caused by:
  process didn't exit successfully: `/Users/robert/other/silero-rs/target/debug/deps/snapshot-922dfd7ba42f0d16` (signal: 11, SIGSEGV: invalid memory reference)

Activity

  1. decahedron1 commented on Aug 29, 2024

    @decahedron1
    Member

    Does edcb219 fix the issue?

  2. self-assigned this
    on Aug 29, 2024
  3. added
    bug
    p: high
    on Aug 29, 2024
  4. robertknight commented on Aug 29, 2024

    @robertknight

    Yes, it does seem to have resolved the issue. Thanks!

    Tested with the shell script from emotechlab/silero-rs#20 and this diff applied:

    diff --git a/Cargo.toml b/Cargo.toml
    index 9c67788..52ab4d9 100644
    --- a/Cargo.toml
    +++ b/Cargo.toml
    @@ -8,8 +8,8 @@ edition = "2021"
     
     [dependencies]
     anyhow = "1.0.86"
    -ndarray = "0.15.6"
    -ort = "=2.0.0-rc.4"
    +ndarray = "0.16.1"
    +ort = { git = "https://github.com/pykeio/ort.git", rev = "edcb2199b8f341fc55746183c9cf1d00a43bbfcd" }
     serde = { version = "1.0.208", features = ["derive"], optional = true }
     
     [features]
  5. xd009642 commented on Aug 29, 2024

    @xd009642
    Author

    Just out of curiosity when can we expect an rc6 with this fix in? 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugp: high

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions