Giter Site home page Giter Site logo

aeron-rs's People

Contributors

denisxor avatar fdoyon avatar huitseeker avatar kiriosk avatar tsionyx avatar xx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aeron-rs's Issues

FFI over Aeron client c api

Hi just wondering what's the difference between current aeron-rs and
and implementation using the Aeron client c api?

rust FFI wrapper over the c api should have no overhead and always have updates from the official c api

Issue in throughput example - panicking at try_claim()

Hi

Just tried this example.

I see it panicking at

while publication
                .lock()
                .unwrap()
                .try_claim(settings.message_length, &mut buffer_claim)
                .unwrap_err()
                == AeronError::BackPressured
            {
                back_pressure_count += 1;
                offer_idle_strategy.idle();
            }

in throughput.rs.

I wonder if the code is correct. As try_claim() is expected to return several different error-conditions but also a non error. In was of an Ok return it panics.

I tried to change this to:

while wait_for_claim {
                let res = publication
                .lock()
                .unwrap()
                .try_claim(settings.message_length, &mut buffer_claim);

                match res {
                    Err(aeronerr) => 
                        match aeronerr {
                            AeronError::BackPressured =>  {
                                back_pressure_count += 1;
                                offer_idle_strategy.idle();
                            },
                            _ =>  println!("err {}: wait for claim",aeronerr),
                        },
                    Ok(pos) => wait_for_claim = false,
                }
            }

this helped. But still sometimes hangs in the wait-loop forever. Seems still to have issues....

regards

AtomicBuffer still exposes UB to safe code

The repro in #14 no longer compiles on current master but the following is basically equivalent:

use aeron_rs::concurrent::atomic_buffer::{AlignedBuffer, AtomicBuffer};

fn main() {
    AtomicBuffer::from_aligned(&AlignedBuffer { ptr: 0xdeadbeefusize as _, len: 100 })
        .get_bytes(0, 0xcafebabeusize as _, 100);
}
Segmentation fault (core dumped)

In general it is unsound for a safe API to result in UB.

Public API of aeron-rs exposes UB to safe code

For example, the following safe program leads to areon-rs performing Undefined Behavior:

// [dependencies]
// aeron-rs = "0.1.3"

use aeron_rs::concurrent::atomic_buffer::AtomicBuffer;

fn main() {
    AtomicBuffer::new(0xdeadbeefusize as _, 100)
        .get_bytes(0, 0xcafebabeusize as _, 100);
}
Segmentation fault (core dumped)

In general it is unsound for a safe API to result in UB.

Soundness issue

CorrelatedMessageFlyweight and HeaderFlyweight expose the flyweight field of type Flyweight which exposes the raw pointer m_struct which is dereferenced by CorrelatedMessageFlyweight::client_id, CorrelatedMessageFlyweight::correlation_id, CorrelatedMessageFlyweight::set_client_id, CorrelatedMessageFlyweight::set_correlation_id, HeaderFlyweight::frame_length, HeaderFlyweight::version, HeaderFlyweight::flags, HeaderFlyweight::h_type, HeaderFlyweight::set_frame_length, HeaderFlyweight::set_version, HeaderFlyweight::set_flags and HeaderFlyweight::set_h_type.

This is unsound because a user could modify m_struct in safe code and call one of those methods to cause UB.

Error running `throughput` example

➜  aeron-rs git:(master) cargo run --example throughput
    Finished dev [unoptimized + debuginfo] target(s) in 0.15s
     Running `target/debug/examples/throughput`
Subscribing to channel aeron:udp?endpoint=localhost:40123 on Stream ID 1001
Streaming 10000000 messages of payload length 32 bytes to aeron:udp?endpoint=localhost:40123 on stream ID 1001
Using CnC file: /dev/shm/aeron-mkpankov/cnc.dat
Error creating Aeron instance: Some(MemMappedFileError(Os { code: 2, kind: NotFound, message: "No such file or directory" }))

aeronmd is on the path:

➜  aeron-rs git:(master) ✗ aeronmd --help
aeronmd: invalid option -- '-'
Usage: aeronmd [-v][-Dname=value]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.