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

Trying to run examples - "Error creating ring_buffer " #29

Open
sonthonaxrk opened this issue Feb 5, 2025 · 4 comments
Open

Trying to run examples - "Error creating ring_buffer " #29

sonthonaxrk opened this issue Feb 5, 2025 · 4 comments

Comments

@sonthonaxrk
Copy link

sonthonaxrk commented Feb 5, 2025

Just trying to run the ping example.

Am I doing something wrong?

$ RUST_BACKTRACE=1 cargo run --example ping

    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.04s
     Running `target/debug/examples/ping`
Subscribing Pong at aeron:udp?endpoint=localhost:40123 on Stream ID 1002
Publishing Ping at aeron:udp?endpoint=localhost:40123 on Stream ID 1002
Using CnC file: /var/folders/v4/j1g2wwrx7n7_x2yb646p8htw0000gr/T/aeron-rollokonig-brock/cnc.dat
thread 'main' panicked at src/aeron.rs:563:74:
Error creating ring_buffer: CapacityIsNotTwoPower { capacity: 1048960 }
stack backtrace:
   0: rust_begin_unwind
             at /rustc/9fc6b43126469e3858e2fe86cafb4f0fd5068869/library/std/src/panicking.rs:665:5
   1: core::panicking::panic_fmt
             at /rustc/9fc6b43126469e3858e2fe86cafb4f0fd5068869/library/core/src/panicking.rs:76:14
   2: core::result::unwrap_failed
             at /rustc/9fc6b43126469e3858e2fe86cafb4f0fd5068869/library/core/src/result.rs:1699:5
   3: core::result::Result<T,E>::expect
             at /Users/rollokonig-brock/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/result.rs:1061:23
   4: aeron_rs::aeron::Aeron::map_cnc_file
             at ./src/aeron.rs:563:31
   5: aeron_rs::aeron::Aeron::new
             at ./src/aeron.rs:90:23
   6: ping::main
             at ./examples/ping.rs:219:17
   7: core::ops::function::FnOnce::call_once
             at /Users/rollokonig-brock/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Running on:

ProductName:            macOS
ProductVersion:         15.1

Using

rustup show
Default host: aarch64-apple-darwin
rustup home:  /Users/rollokonig-brock/.rustup

installed toolchains
--------------------

stable-aarch64-apple-darwin (default)
nightly-aarch64-apple-darwin

installed targets for active toolchain
--------------------------------------

aarch64-apple-darwin
wasm32-unknown-unknown

active toolchain
----------------

stable-aarch64-apple-darwin (default)
rustc 1.84.0 (9fc6b4312 2025-01-07)
@sonthonaxrk
Copy link
Author

Weird,

It's nearly a power of 2.

CapacityIsNotTwoPower { capacity: 1048960 }

1048960 / 2^7 == 2^13 - 1

@sonthonaxrk
Copy link
Author

My driver context:

aeron_driver_context_t {
    ...
    to_driver_buffer_length=1049344
    to_clients_buffer_length=1048704
    counters_values_buffer_length=1048576
    error_buffer_length=1048576
    timer_interval_ns=1000000000
}

@B1GJ
Copy link

B1GJ commented Feb 9, 2025

Same here.

@B1GJ
Copy link

B1GJ commented Feb 14, 2025

fyi, setting pub const CACHE_LINE_LENGTH: Index = CACHE_LINE_SIZE as Index; to pub const CACHE_LINE_LENGTH: Index = 64 as Index; fixed it for me
in src/utils/misc.rs

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

2 participants