unitedtraders / aeron-rs Goto Github PK
View Code? Open in Web Editor NEWRust aeron port
License: Apache License 2.0
Rust aeron port
License: Apache License 2.0
fn main() {
aeron_rs::utils::misc::dealloc_buffer_aligned(0xdeadbeefusize as _, 100);
}
Segmentation fault (core dumped)
In general it is unsound for a safe API to result in UB.
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
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
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.
I'd like to investigate performance for a bit.
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.
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.
➜ 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]
this repositories Will it be updated?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.