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

publish_subscribe example panics on MacOS #80

Closed
bschwind opened this issue Jan 12, 2024 · 7 comments · Fixed by #82
Closed

publish_subscribe example panics on MacOS #80

bschwind opened this issue Jan 12, 2024 · 7 comments · Fixed by #82
Labels
bug Something isn't working

Comments

@bschwind
Copy link

Required information

Operating system:

  • MacOS 12.7.1

Rust version:

  • rustc 1.75.0 (82e1608df 2023-12-21)

Cargo version:

  • cargo 1.75.0 (1d8b05cdd 2023-11-20)

iceoryx2 version:

Observed result or behaviour:
Run cargo run --release --example publish_subscribe_subscriber in the root project directory, and I receive a panic:

brian iceoryx2 $ cargo run --release --example publish_subscribe_subscriber
    Finished release [optimized] target(s) in 0.11s
     Running `target/release/examples/publish_subscribe_subscriber`
        0 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 20,
               data: "config/iceoryx2.toml" } }, access_mode: Read, permission: OWNER_READ | 
              OWNER_WRITE | OWNER_EXEC | OWNER_ALL, owner: None, group: None, truncate_size: 
              None, creation_mode: None }
              | opened
        1 [T] Config { global: Global { root_path: "/tmp/iceoryx2/", prefix: "iox2_", service
              : Service { directory: "services", publisher_data_segment_suffix: ".publisher_d
              ata", static_config_storage_suffix: ".service", dynamic_config_storage_suffix: 
              ".dynamic", creation_timeout: 500ms, connection_suffix: ".connection" } }, defa
              ults: Defaults { publish_subscribe: PublishSubscribe { max_subscribers: 8, max_
              publishers: 2, subscriber_max_buffer_size: 2, subscriber_max_borrowed_samples: 
              2, publisher_max_loaned_samples: 2, publisher_history_size: 1, enable_safe_over
              flow: true, unable_to_deliver_strategy: Block }, event: Event { max_listeners: 
              2, max_notifiers: 16 } } }
              | Loaded.
        2 [T] Config { global: Global { root_path: "/tmp/iceoryx2/", prefix: "iox2_", service
              : Service { directory: "services", publisher_data_segment_suffix: ".publisher_d
              ata", static_config_storage_suffix: ".service", dynamic_config_storage_suffix: 
              ".dynamic", creation_timeout: 500ms, connection_suffix: ".connection" } }, defa
              ults: Defaults { publish_subscribe: PublishSubscribe { max_subscribers: 8, max_
              publishers: 2, subscriber_max_buffer_size: 2, subscriber_max_borrowed_samples: 
              2, publisher_max_loaned_samples: 2, publisher_history_size: 1, enable_safe_over
              flow: true, unable_to_deliver_strategy: Block }, event: Event { max_listeners: 
              2, max_notifiers: 16 } } }
              | Set as global config.
        3 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 76,
               data: "/tmp/iceoryx2/services/iox2_b61bd15e8c3ea16146985e960906a8e125156a73.se
              rvice" } }, access_mode: Read, permission: OWNER_READ | OWNER_WRITE | OWNER_EXE
              C | OWNER_ALL, owner: None, group: None, truncate_size: None, creation_mode: No
              ne }
              | opened
        4 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 76,
               data: "/tmp/iceoryx2/services/iox2_b61bd15e8c3ea16146985e960906a8e125156a73.se
              rvice" } }, access_mode: Read, permission: OWNER_READ | OWNER_WRITE | OWNER_EXE
              C | OWNER_ALL, owner: None, group: None, truncate_size: None, creation_mode: No
              ne }
              | opened
        5 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 76,
               data: "/tmp/iceoryx2/services/iox2_b61bd15e8c3ea16146985e960906a8e125156a73.se
              rvice" } }, access_mode: Read, permission: OWNER_READ | OWNER_WRITE | OWNER_EXE
              C | OWNER_ALL, owner: None, group: None, truncate_size: None, creation_mode: No
              ne }
              | opened
        6 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 76,
               data: "/tmp/iceoryx2/services/iox2_b61bd15e8c3ea16146985e960906a8e125156a73.se
              rvice" } }, access_mode: Read, permission: OWNER_READ | OWNER_WRITE | OWNER_EXE
              C | OWNER_ALL, owner: None, group: None, truncate_size: None, creation_mode: No
              ne }
              | opened
        7 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 53, data
              : "iox2_b61bd15e8c3ea16146985e960906a8e125156a73.dynamic" } }, size: 16384, bas
              e_address: 0x100cdc000, has_ownership: false, file_descriptor: FileDescriptor {
               value: 5, is_owned: true }, memory_lock: None }
              | open
        8 [T] ServiceState { static_config: StaticConfig { uuid: "b61bd15e8c3ea16146985e96090
              6a8e125156a73", service_name: ServiceName { value: FixedSizeByteString<255> { l
              en: 19, data: "My/Funk/ServiceName" } }, messaging_pattern: PublishSubscribe(St
              aticConfig { max_subscribers: 8, max_publishers: 2, history_size: 1, subscriber
              _max_buffer_size: 2, subscriber_max_borrowed_samples: 2, enable_safe_overflow: 
              true, type_name: "transmission_data::TransmissionData" }) }, global_config: Con
              fig { global: Global { root_path: "/tmp/iceoryx2/", prefix: "iox2_", service: S
              ervice { directory: "services", publisher_data_segment_suffix: ".publisher_data
              ", static_config_storage_suffix: ".service", dynamic_config_storage_suffix: ".d
              ynamic", creation_timeout: 500ms, connection_suffix: ".connection" } }, default
              s: Defaults { publish_subscribe: PublishSubscribe { max_subscribers: 8, max_pub
              lishers: 2, subscriber_max_buffer_size: 2, subscriber_max_borrowed_samples: 2, 
              publisher_max_loaned_samples: 2, publisher_history_size: 1, enable_safe_overflo
              w: true, unable_to_deliver_strategy: Block }, event: Event { max_listeners: 2, 
              max_notifiers: 16 } } }, dynamic_storage: Storage { shm: SharedMemory { name: F
              ileName { value: FixedSizeByteString<255> { len: 53, data: "iox2_b61bd15e8c3ea1
              6146985e960906a8e125156a73.dynamic" } }, size: 16384, base_address: 0x100cdc000
              , has_ownership: false, file_descriptor: FileDescriptor { value: 5, is_owned: t
              rue }, memory_lock: None }, name: FileName { value: FixedSizeByteString<255> { 
              len: 40, data: "b61bd15e8c3ea16146985e960906a8e125156a73" } }, _phantom_data: P
              hantomData<iceoryx2::service::dynamic_config::DynamicConfig> }, static_storage:
               Storage { name: FileName { value: FixedSizeByteString<255> { len: 40, data: "b
              61bd15e8c3ea16146985e960906a8e125156a73" } }, config: Configuration { path: Pat
              h { value: FixedSizeByteString<4096> { len: 22, data: "/tmp/iceoryx2/services" 
              } }, suffix: FileName { value: FixedSizeByteString<255> { len: 8, data: ".servi
              ce" } }, prefix: FileName { value: FixedSizeByteString<255> { len: 5, data: "io
              x2_" } } }, has_ownership: false, file: File { path: Some(FilePath { value: Fix
              edSizeByteString<4096> { len: 76, data: "/tmp/iceoryx2/services/iox2_b61bd15e8c
              3ea16146985e960906a8e125156a73.service" } }), file_descriptor: FileDescriptor {
               value: 4, is_owned: true } }, len: 348 } }
              | open service
        9 [D] SharedMemoryBuilder { name: FileName { value: FixedSizeByteString<255> { len: 8
              1, data: "iox2_20123953278630464882616037414168_3866334330696831988048375888828
              0.connection" } }, size: 190, is_memory_locked: false, has_ownership: true, per
              mission: OWNER_READ | OWNER_WRITE | OWNER_EXEC | OWNER_ALL, creation_mode: Some
              (OpenOrCreate), zero_memory: true, access_mode: ReadWrite, enforce_base_address
              : None }
              | Unable to open shared memory since the shared memory does not exist.
       10 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 81, data
              : "iox2_20123953278630464882616037414168_38663343306968319880483758888280.conne
              ction" } }, size: 16384, base_address: 0x100ce0000, has_ownership: true, file_d
              escriptor: FileDescriptor { value: 3, is_owned: true }, memory_lock: None }
              | create
       11 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 56, data
              : "iox2_254_20123953278630464882616037414168.publisher_data" } }, size: 16384, 
              base_address: 0x100ce4000, has_ownership: false, file_descriptor: FileDescripto
              r { value: 6, is_owned: true }, memory_lock: None }
              | open
       12 [D] "nanosleep_with_clock"
              | Invalid argument in "nanosleep". Either the duration: 1s is out of range or t
              | he clock type Realtime is invalid.
       13 [F] Iox2
              | Failed to wait with cycle time 1s in main event look, caused by (DurationOutO
              | fRange).
thread 'main' panicked at iceoryx2/src/iox2.rs:96:17:
From: Iox2 ::: Failed to wait with cycle time 1s in main event look, caused by (DurationOutOfRange).
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
zsh: abort      cargo run --release --example publish_subscribe_subscriber

Expected result or behaviour:
Expected to see the subscriber start and receive a message (assuming I run the publisher example as well)

Conditions where it occurred / Performed steps:
Happens on every run of the publish_subscribe example.

@bschwind bschwind added the bug Something isn't working label Jan 12, 2024
@elfenpiff
Copy link
Contributor

@bschwind could you please try it in debug mode?

elBoberido added a commit to elBoberido/iceoryx2 that referenced this issue Jan 12, 2024
elBoberido added a commit to elBoberido/iceoryx2 that referenced this issue Jan 12, 2024
@elBoberido
Copy link
Member

@bschwind I don't have a mac to test but it seems you have a ludicrously fast device. Can you try #82 and check if it fixes the issue for you?

@bschwind
Copy link
Author

Here it is in debug mode:

Subscriber

iceoryx2 $ cargo run --example publish_subscribe_subscriber
    Finished dev [unoptimized + debuginfo] target(s) in 0.05s
     Running `target/debug/examples/publish_subscribe_subscriber`
        0 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 20,
               data: "config/iceoryx2.toml" } }, access_mode: Read, permission: OWNER_READ | 
              OWNER_WRITE | OWNER_EXEC | OWNER_ALL, owner: None, group: None, truncate_size: 
              None, creation_mode: None }
              | opened
        1 [T] Config { global: Global { root_path: "/tmp/iceoryx2/", prefix: "iox2_", service
              : Service { directory: "services", publisher_data_segment_suffix: ".publisher_d
              ata", static_config_storage_suffix: ".service", dynamic_config_storage_suffix: 
              ".dynamic", creation_timeout: 500ms, connection_suffix: ".connection" } }, defa
              ults: Defaults { publish_subscribe: PublishSubscribe { max_subscribers: 8, max_
              publishers: 2, subscriber_max_buffer_size: 2, subscriber_max_borrowed_samples: 
              2, publisher_max_loaned_samples: 2, publisher_history_size: 1, enable_safe_over
              flow: true, unable_to_deliver_strategy: Block }, event: Event { max_listeners: 
              2, max_notifiers: 16 } } }
              | Loaded.
        2 [T] Config { global: Global { root_path: "/tmp/iceoryx2/", prefix: "iox2_", service
              : Service { directory: "services", publisher_data_segment_suffix: ".publisher_d
              ata", static_config_storage_suffix: ".service", dynamic_config_storage_suffix: 
              ".dynamic", creation_timeout: 500ms, connection_suffix: ".connection" } }, defa
              ults: Defaults { publish_subscribe: PublishSubscribe { max_subscribers: 8, max_
              publishers: 2, subscriber_max_buffer_size: 2, subscriber_max_borrowed_samples: 
              2, publisher_max_loaned_samples: 2, publisher_history_size: 1, enable_safe_over
              flow: true, unable_to_deliver_strategy: Block }, event: Event { max_listeners: 
              2, max_notifiers: 16 } } }
              | Set as global config.
        3 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 76,
               data: "/tmp/iceoryx2/services/iox2_b61bd15e8c3ea16146985e960906a8e125156a73.se
              rvice" } }, access_mode: Read, permission: OWNER_READ | OWNER_WRITE | OWNER_EXE
              C | OWNER_ALL, owner: None, group: None, truncate_size: None, creation_mode: No
              ne }
              | opened
        4 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 76,
               data: "/tmp/iceoryx2/services/iox2_b61bd15e8c3ea16146985e960906a8e125156a73.se
              rvice" } }, access_mode: Read, permission: OWNER_READ | OWNER_WRITE | OWNER_EXE
              C | OWNER_ALL, owner: None, group: None, truncate_size: None, creation_mode: No
              ne }
              | opened
        5 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 76,
               data: "/tmp/iceoryx2/services/iox2_b61bd15e8c3ea16146985e960906a8e125156a73.se
              rvice" } }, access_mode: Read, permission: OWNER_READ | OWNER_WRITE | OWNER_EXE
              C | OWNER_ALL, owner: None, group: None, truncate_size: None, creation_mode: No
              ne }
              | opened
        6 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 76,
               data: "/tmp/iceoryx2/services/iox2_b61bd15e8c3ea16146985e960906a8e125156a73.se
              rvice" } }, access_mode: Read, permission: OWNER_READ | OWNER_WRITE | OWNER_EXE
              C | OWNER_ALL, owner: None, group: None, truncate_size: None, creation_mode: No
              ne }
              | opened
        7 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 53, data
              : "iox2_b61bd15e8c3ea16146985e960906a8e125156a73.dynamic" } }, size: 16384, bas
              e_address: 0x1027a8000, has_ownership: false, file_descriptor: FileDescriptor {
               value: 5, is_owned: true }, memory_lock: None }
              | open
        8 [T] ServiceState { static_config: StaticConfig { uuid: "b61bd15e8c3ea16146985e96090
              6a8e125156a73", service_name: ServiceName { value: FixedSizeByteString<255> { l
              en: 19, data: "My/Funk/ServiceName" } }, messaging_pattern: PublishSubscribe(St
              aticConfig { max_subscribers: 8, max_publishers: 2, history_size: 1, subscriber
              _max_buffer_size: 2, subscriber_max_borrowed_samples: 2, enable_safe_overflow: 
              true, type_name: "transmission_data::TransmissionData" }) }, global_config: Con
              fig { global: Global { root_path: "/tmp/iceoryx2/", prefix: "iox2_", service: S
              ervice { directory: "services", publisher_data_segment_suffix: ".publisher_data
              ", static_config_storage_suffix: ".service", dynamic_config_storage_suffix: ".d
              ynamic", creation_timeout: 500ms, connection_suffix: ".connection" } }, default
              s: Defaults { publish_subscribe: PublishSubscribe { max_subscribers: 8, max_pub
              lishers: 2, subscriber_max_buffer_size: 2, subscriber_max_borrowed_samples: 2, 
              publisher_max_loaned_samples: 2, publisher_history_size: 1, enable_safe_overflo
              w: true, unable_to_deliver_strategy: Block }, event: Event { max_listeners: 2, 
              max_notifiers: 16 } } }, dynamic_storage: Storage { shm: SharedMemory { name: F
              ileName { value: FixedSizeByteString<255> { len: 53, data: "iox2_b61bd15e8c3ea1
              6146985e960906a8e125156a73.dynamic" } }, size: 16384, base_address: 0x1027a8000
              , has_ownership: false, file_descriptor: FileDescriptor { value: 5, is_owned: t
              rue }, memory_lock: None }, name: FileName { value: FixedSizeByteString<255> { 
              len: 40, data: "b61bd15e8c3ea16146985e960906a8e125156a73" } }, _phantom_data: P
              hantomData<iceoryx2::service::dynamic_config::DynamicConfig> }, static_storage:
               Storage { name: FileName { value: FixedSizeByteString<255> { len: 40, data: "b
              61bd15e8c3ea16146985e960906a8e125156a73" } }, config: Configuration { path: Pat
              h { value: FixedSizeByteString<4096> { len: 22, data: "/tmp/iceoryx2/services" 
              } }, suffix: FileName { value: FixedSizeByteString<255> { len: 8, data: ".servi
              ce" } }, prefix: FileName { value: FixedSizeByteString<255> { len: 5, data: "io
              x2_" } } }, has_ownership: false, file: File { path: Some(FilePath { value: Fix
              edSizeByteString<4096> { len: 76, data: "/tmp/iceoryx2/services/iox2_b61bd15e8c
              3ea16146985e960906a8e125156a73.service" } }), file_descriptor: FileDescriptor {
               value: 4, is_owned: true } }, len: 348 } }
              | open service
        9 [D] SharedMemoryBuilder { name: FileName { value: FixedSizeByteString<255> { len: 8
              2, data: "iox2_20123953278630464882616037414168_1917321532845270202198002235382
              00.connection" } }, size: 190, is_memory_locked: false, has_ownership: true, pe
              rmission: OWNER_READ | OWNER_WRITE | OWNER_EXEC | OWNER_ALL, creation_mode: Som
              e(OpenOrCreate), zero_memory: true, access_mode: ReadWrite, enforce_base_addres
              s: None }
              | Unable to open shared memory since the shared memory does not exist.
       10 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 82, data
              : "iox2_20123953278630464882616037414168_191732153284527020219800223538200.conn
              ection" } }, size: 16384, base_address: 0x1027ac000, has_ownership: true, file_
              descriptor: FileDescriptor { value: 3, is_owned: true }, memory_lock: None }
              | create
       11 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 56, data
              : "iox2_254_20123953278630464882616037414168.publisher_data" } }, size: 16384, 
              base_address: 0x1027b0000, has_ownership: false, file_descriptor: FileDescripto
              r { value: 6, is_owned: true }, memory_lock: None }
              | open
       12 [D] "nanosleep_with_clock"
              | Invalid argument in "nanosleep". Either the duration: 1s is out of range or t
              | he clock type Realtime is invalid.
       13 [F] Iox2
              | Failed to wait with cycle time 1s in main event look, caused by (DurationOutO
              | fRange).
thread 'main' panicked at iceoryx2/src/iox2.rs:96:17:
From: Iox2 ::: Failed to wait with cycle time 1s in main event look, caused by (DurationOutOfRange).
stack backtrace:
   0: rust_begin_unwind
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:72:14
   2: iceoryx2::iox2::Iox2::wait_impl
             at ./iceoryx2/src/iox2.rs:96:17
   3: iceoryx2::iox2::Iox2::wait
             at ./iceoryx2/src/iox2.rs:107:9
   4: publish_subscribe_subscriber::main
             at ./examples/examples/publish_subscribe/subscriber.rs:28:33
   5: core::ops::function::FnOnce::call_once
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
       14 [T] "SharedMemory::remove"
              | "iox2_20123953278630464882616037414168_191732153284527020219800223538200.conn
              | ection"
       15 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 82, data
              : "iox2_20123953278630464882616037414168_191732153284527020219800223538200.conn
              ection" } }, size: 16384, base_address: 0x1027ac000, has_ownership: false, file
              _descriptor: FileDescriptor { value: 3, is_owned: true }, memory_lock: None }
              | close
       16 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 56, data
              : "iox2_254_20123953278630464882616037414168.publisher_data" } }, size: 16384, 
              base_address: 0x1027b0000, has_ownership: false, file_descriptor: FileDescripto
              r { value: 6, is_owned: true }, memory_lock: None }
              | close
       17 [T] ServiceState { static_config: StaticConfig { uuid: "b61bd15e8c3ea16146985e96090
              6a8e125156a73", service_name: ServiceName { value: FixedSizeByteString<255> { l
              en: 19, data: "My/Funk/ServiceName" } }, messaging_pattern: PublishSubscribe(St
              aticConfig { max_subscribers: 8, max_publishers: 2, history_size: 1, subscriber
              _max_buffer_size: 2, subscriber_max_borrowed_samples: 2, enable_safe_overflow: 
              true, type_name: "transmission_data::TransmissionData" }) }, global_config: Con
              fig { global: Global { root_path: "/tmp/iceoryx2/", prefix: "iox2_", service: S
              ervice { directory: "services", publisher_data_segment_suffix: ".publisher_data
              ", static_config_storage_suffix: ".service", dynamic_config_storage_suffix: ".d
              ynamic", creation_timeout: 500ms, connection_suffix: ".connection" } }, default
              s: Defaults { publish_subscribe: PublishSubscribe { max_subscribers: 8, max_pub
              lishers: 2, subscriber_max_buffer_size: 2, subscriber_max_borrowed_samples: 2, 
              publisher_max_loaned_samples: 2, publisher_history_size: 1, enable_safe_overflo
              w: true, unable_to_deliver_strategy: Block }, event: Event { max_listeners: 2, 
              max_notifiers: 16 } } }, dynamic_storage: Storage { shm: SharedMemory { name: F
              ileName { value: FixedSizeByteString<255> { len: 53, data: "iox2_b61bd15e8c3ea1
              6146985e960906a8e125156a73.dynamic" } }, size: 16384, base_address: 0x1027a8000
              , has_ownership: false, file_descriptor: FileDescriptor { value: 5, is_owned: t
              rue }, memory_lock: None }, name: FileName { value: FixedSizeByteString<255> { 
              len: 40, data: "b61bd15e8c3ea16146985e960906a8e125156a73" } }, _phantom_data: P
              hantomData<iceoryx2::service::dynamic_config::DynamicConfig> }, static_storage:
               Storage { name: FileName { value: FixedSizeByteString<255> { len: 40, data: "b
              61bd15e8c3ea16146985e960906a8e125156a73" } }, config: Configuration { path: Pat
              h { value: FixedSizeByteString<4096> { len: 22, data: "/tmp/iceoryx2/services" 
              } }, suffix: FileName { value: FixedSizeByteString<255> { len: 8, data: ".servi
              ce" } }, prefix: FileName { value: FixedSizeByteString<255> { len: 5, data: "io
              x2_" } } }, has_ownership: false, file: File { path: Some(FilePath { value: Fix
              edSizeByteString<4096> { len: 76, data: "/tmp/iceoryx2/services/iox2_b61bd15e8c
              3ea16146985e960906a8e125156a73.service" } }), file_descriptor: FileDescriptor {
               value: 4, is_owned: true } }, len: 348 } }
              | close service
       18 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 53, data
              : "iox2_b61bd15e8c3ea16146985e960906a8e125156a73.dynamic" } }, size: 16384, bas
              e_address: 0x1027a8000, has_ownership: false, file_descriptor: FileDescriptor {
               value: 5, is_owned: true }, memory_lock: None }
              | close

Publisher

iceoryx2 $ cargo run --example publish_subscribe_subscriber
    Finished dev [unoptimized + debuginfo] target(s) in 0.10s
     Running `target/debug/examples/publish_subscribe_subscriber`
        0 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 20,
               data: "config/iceoryx2.toml" } }, access_mode: Read, permission: OWNER_READ | 
              OWNER_WRITE | OWNER_EXEC | OWNER_ALL, owner: None, group: None, truncate_size: 
              None, creation_mode: None }
              | opened
        1 [T] Config { global: Global { root_path: "/tmp/iceoryx2/", prefix: "iox2_", service
              : Service { directory: "services", publisher_data_segment_suffix: ".publisher_d
              ata", static_config_storage_suffix: ".service", dynamic_config_storage_suffix: 
              ".dynamic", creation_timeout: 500ms, connection_suffix: ".connection" } }, defa
              ults: Defaults { publish_subscribe: PublishSubscribe { max_subscribers: 8, max_
              publishers: 2, subscriber_max_buffer_size: 2, subscriber_max_borrowed_samples: 
              2, publisher_max_loaned_samples: 2, publisher_history_size: 1, enable_safe_over
              flow: true, unable_to_deliver_strategy: Block }, event: Event { max_listeners: 
              2, max_notifiers: 16 } } }
              | Loaded.
        2 [T] Config { global: Global { root_path: "/tmp/iceoryx2/", prefix: "iox2_", service
              : Service { directory: "services", publisher_data_segment_suffix: ".publisher_d
              ata", static_config_storage_suffix: ".service", dynamic_config_storage_suffix: 
              ".dynamic", creation_timeout: 500ms, connection_suffix: ".connection" } }, defa
              ults: Defaults { publish_subscribe: PublishSubscribe { max_subscribers: 8, max_
              publishers: 2, subscriber_max_buffer_size: 2, subscriber_max_borrowed_samples: 
              2, publisher_max_loaned_samples: 2, publisher_history_size: 1, enable_safe_over
              flow: true, unable_to_deliver_strategy: Block }, event: Event { max_listeners: 
              2, max_notifiers: 16 } } }
              | Set as global config.
        3 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 76,
               data: "/tmp/iceoryx2/services/iox2_b61bd15e8c3ea16146985e960906a8e125156a73.se
              rvice" } }, access_mode: Read, permission: OWNER_READ | OWNER_WRITE | OWNER_EXE
              C | OWNER_ALL, owner: None, group: None, truncate_size: None, creation_mode: No
              ne }
              | opened
        4 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 76,
               data: "/tmp/iceoryx2/services/iox2_b61bd15e8c3ea16146985e960906a8e125156a73.se
              rvice" } }, access_mode: Read, permission: OWNER_READ | OWNER_WRITE | OWNER_EXE
              C | OWNER_ALL, owner: None, group: None, truncate_size: None, creation_mode: No
              ne }
              | opened
        5 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 76,
               data: "/tmp/iceoryx2/services/iox2_b61bd15e8c3ea16146985e960906a8e125156a73.se
              rvice" } }, access_mode: Read, permission: OWNER_READ | OWNER_WRITE | OWNER_EXE
              C | OWNER_ALL, owner: None, group: None, truncate_size: None, creation_mode: No
              ne }
              | opened
        6 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 76,
               data: "/tmp/iceoryx2/services/iox2_b61bd15e8c3ea16146985e960906a8e125156a73.se
              rvice" } }, access_mode: Read, permission: OWNER_READ | OWNER_WRITE | OWNER_EXE
              C | OWNER_ALL, owner: None, group: None, truncate_size: None, creation_mode: No
              ne }
              | opened
        7 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 53, data
              : "iox2_b61bd15e8c3ea16146985e960906a8e125156a73.dynamic" } }, size: 16384, bas
              e_address: 0x102d18000, has_ownership: false, file_descriptor: FileDescriptor {
               value: 5, is_owned: true }, memory_lock: None }
              | open
        8 [T] ServiceState { static_config: StaticConfig { uuid: "b61bd15e8c3ea16146985e96090
              6a8e125156a73", service_name: ServiceName { value: FixedSizeByteString<255> { l
              en: 19, data: "My/Funk/ServiceName" } }, messaging_pattern: PublishSubscribe(St
              aticConfig { max_subscribers: 8, max_publishers: 2, history_size: 1, subscriber
              _max_buffer_size: 2, subscriber_max_borrowed_samples: 2, enable_safe_overflow: 
              true, type_name: "transmission_data::TransmissionData" }) }, global_config: Con
              fig { global: Global { root_path: "/tmp/iceoryx2/", prefix: "iox2_", service: S
              ervice { directory: "services", publisher_data_segment_suffix: ".publisher_data
              ", static_config_storage_suffix: ".service", dynamic_config_storage_suffix: ".d
              ynamic", creation_timeout: 500ms, connection_suffix: ".connection" } }, default
              s: Defaults { publish_subscribe: PublishSubscribe { max_subscribers: 8, max_pub
              lishers: 2, subscriber_max_buffer_size: 2, subscriber_max_borrowed_samples: 2, 
              publisher_max_loaned_samples: 2, publisher_history_size: 1, enable_safe_overflo
              w: true, unable_to_deliver_strategy: Block }, event: Event { max_listeners: 2, 
              max_notifiers: 16 } } }, dynamic_storage: Storage { shm: SharedMemory { name: F
              ileName { value: FixedSizeByteString<255> { len: 53, data: "iox2_b61bd15e8c3ea1
              6146985e960906a8e125156a73.dynamic" } }, size: 16384, base_address: 0x102d18000
              , has_ownership: false, file_descriptor: FileDescriptor { value: 5, is_owned: t
              rue }, memory_lock: None }, name: FileName { value: FixedSizeByteString<255> { 
              len: 40, data: "b61bd15e8c3ea16146985e960906a8e125156a73" } }, _phantom_data: P
              hantomData<iceoryx2::service::dynamic_config::DynamicConfig> }, static_storage:
               Storage { name: FileName { value: FixedSizeByteString<255> { len: 40, data: "b
              61bd15e8c3ea16146985e960906a8e125156a73" } }, config: Configuration { path: Pat
              h { value: FixedSizeByteString<4096> { len: 22, data: "/tmp/iceoryx2/services" 
              } }, suffix: FileName { value: FixedSizeByteString<255> { len: 8, data: ".servi
              ce" } }, prefix: FileName { value: FixedSizeByteString<255> { len: 5, data: "io
              x2_" } } }, has_ownership: false, file: File { path: Some(FilePath { value: Fix
              edSizeByteString<4096> { len: 76, data: "/tmp/iceoryx2/services/iox2_b61bd15e8c
              3ea16146985e960906a8e125156a73.service" } }), file_descriptor: FileDescriptor {
               value: 4, is_owned: true } }, len: 348 } }
              | open service
        9 [D] SharedMemoryBuilder { name: FileName { value: FixedSizeByteString<255> { len: 8
              2, data: "iox2_20123953278630464882616037414168_1916529251220127558821942207289
              76.connection" } }, size: 190, is_memory_locked: false, has_ownership: true, pe
              rmission: OWNER_READ | OWNER_WRITE | OWNER_EXEC | OWNER_ALL, creation_mode: Som
              e(OpenOrCreate), zero_memory: true, access_mode: ReadWrite, enforce_base_addres
              s: None }
              | Unable to open shared memory since the shared memory does not exist.
       10 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 82, data
              : "iox2_20123953278630464882616037414168_191652925122012755882194220728976.conn
              ection" } }, size: 16384, base_address: 0x102d1c000, has_ownership: true, file_
              descriptor: FileDescriptor { value: 3, is_owned: true }, memory_lock: None }
              | create
       11 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 56, data
              : "iox2_254_20123953278630464882616037414168.publisher_data" } }, size: 16384, 
              base_address: 0x102d20000, has_ownership: false, file_descriptor: FileDescripto
              r { value: 6, is_owned: true }, memory_lock: None }
              | open
       12 [D] "nanosleep_with_clock"
              | Invalid argument in "nanosleep". Either the duration: 1s is out of range or t
              | he clock type Realtime is invalid.
       13 [F] Iox2
              | Failed to wait with cycle time 1s in main event look, caused by (DurationOutO
              | fRange).
thread 'main' panicked at iceoryx2/src/iox2.rs:96:17:
From: Iox2 ::: Failed to wait with cycle time 1s in main event look, caused by (DurationOutOfRange).
stack backtrace:
   0: rust_begin_unwind
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:72:14
   2: iceoryx2::iox2::Iox2::wait_impl
             at ./iceoryx2/src/iox2.rs:96:17
   3: iceoryx2::iox2::Iox2::wait
             at ./iceoryx2/src/iox2.rs:107:9
   4: publish_subscribe_subscriber::main
             at ./examples/examples/publish_subscribe/subscriber.rs:28:33
   5: core::ops::function::FnOnce::call_once
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
       14 [T] "SharedMemory::remove"
              | "iox2_20123953278630464882616037414168_191652925122012755882194220728976.conn
              | ection"
       15 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 82, data
              : "iox2_20123953278630464882616037414168_191652925122012755882194220728976.conn
              ection" } }, size: 16384, base_address: 0x102d1c000, has_ownership: false, file
              _descriptor: FileDescriptor { value: 3, is_owned: true }, memory_lock: None }
              | close
       16 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 56, data
              : "iox2_254_20123953278630464882616037414168.publisher_data" } }, size: 16384, 
              base_address: 0x102d20000, has_ownership: false, file_descriptor: FileDescripto
              r { value: 6, is_owned: true }, memory_lock: None }
              | close
       17 [T] ServiceState { static_config: StaticConfig { uuid: "b61bd15e8c3ea16146985e96090
              6a8e125156a73", service_name: ServiceName { value: FixedSizeByteString<255> { l
              en: 19, data: "My/Funk/ServiceName" } }, messaging_pattern: PublishSubscribe(St
              aticConfig { max_subscribers: 8, max_publishers: 2, history_size: 1, subscriber
              _max_buffer_size: 2, subscriber_max_borrowed_samples: 2, enable_safe_overflow: 
              true, type_name: "transmission_data::TransmissionData" }) }, global_config: Con
              fig { global: Global { root_path: "/tmp/iceoryx2/", prefix: "iox2_", service: S
              ervice { directory: "services", publisher_data_segment_suffix: ".publisher_data
              ", static_config_storage_suffix: ".service", dynamic_config_storage_suffix: ".d
              ynamic", creation_timeout: 500ms, connection_suffix: ".connection" } }, default
              s: Defaults { publish_subscribe: PublishSubscribe { max_subscribers: 8, max_pub
              lishers: 2, subscriber_max_buffer_size: 2, subscriber_max_borrowed_samples: 2, 
              publisher_max_loaned_samples: 2, publisher_history_size: 1, enable_safe_overflo
              w: true, unable_to_deliver_strategy: Block }, event: Event { max_listeners: 2, 
              max_notifiers: 16 } } }, dynamic_storage: Storage { shm: SharedMemory { name: F
              ileName { value: FixedSizeByteString<255> { len: 53, data: "iox2_b61bd15e8c3ea1
              6146985e960906a8e125156a73.dynamic" } }, size: 16384, base_address: 0x102d18000
              , has_ownership: false, file_descriptor: FileDescriptor { value: 5, is_owned: t
              rue }, memory_lock: None }, name: FileName { value: FixedSizeByteString<255> { 
              len: 40, data: "b61bd15e8c3ea16146985e960906a8e125156a73" } }, _phantom_data: P
              hantomData<iceoryx2::service::dynamic_config::DynamicConfig> }, static_storage:
               Storage { name: FileName { value: FixedSizeByteString<255> { len: 40, data: "b
              61bd15e8c3ea16146985e960906a8e125156a73" } }, config: Configuration { path: Pat
              h { value: FixedSizeByteString<4096> { len: 22, data: "/tmp/iceoryx2/services" 
              } }, suffix: FileName { value: FixedSizeByteString<255> { len: 8, data: ".servi
              ce" } }, prefix: FileName { value: FixedSizeByteString<255> { len: 5, data: "io
              x2_" } } }, has_ownership: false, file: File { path: Some(FilePath { value: Fix
              edSizeByteString<4096> { len: 76, data: "/tmp/iceoryx2/services/iox2_b61bd15e8c
              3ea16146985e960906a8e125156a73.service" } }), file_descriptor: FileDescriptor {
               value: 4, is_owned: true } }, len: 348 } }
              | close service
       18 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 53, data
              : "iox2_b61bd15e8c3ea16146985e960906a8e125156a73.dynamic" } }, size: 16384, bas
              e_address: 0x102d18000, has_ownership: false, file_descriptor: FileDescriptor {
               value: 5, is_owned: true }, memory_lock: None }
              | close

I'll try #82 and report back

@bschwind
Copy link
Author

I tried the code in #82

The event example seems to work.

Here is the output of the pub-sub example - they no longer panic but I'm not sure if the behavior/output is correct. They both start up, print out some data, then seem to hang:

Subscriber

iceoryx2 $ cargo run --example publish_subscribe_subscriber
   Compiling example v0.2.1 (/Users/brian/projects/iceoryx2/examples)
    Finished dev [unoptimized + debuginfo] target(s) in 0.36s
     Running `target/debug/examples/publish_subscribe_subscriber`
        0 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 20,
               data: "config/iceoryx2.toml" } }, access_mode: Read, permission: OWNER_READ | 
              OWNER_WRITE | OWNER_EXEC | OWNER_ALL, owner: None, group: None, truncate_size: 
              None, creation_mode: None }
              | opened
        1 [T] Config { global: Global { root_path: "/tmp/iceoryx2/", prefix: "iox2_", service
              : Service { directory: "services", publisher_data_segment_suffix: ".publisher_d
              ata", static_config_storage_suffix: ".service", dynamic_config_storage_suffix: 
              ".dynamic", creation_timeout: 500ms, connection_suffix: ".connection" } }, defa
              ults: Defaults { publish_subscribe: PublishSubscribe { max_subscribers: 8, max_
              publishers: 2, subscriber_max_buffer_size: 2, subscriber_max_borrowed_samples: 
              2, publisher_max_loaned_samples: 2, publisher_history_size: 1, enable_safe_over
              flow: true, unable_to_deliver_strategy: Block }, event: Event { max_listeners: 
              2, max_notifiers: 16 } } }
              | Loaded.
        2 [T] Config { global: Global { root_path: "/tmp/iceoryx2/", prefix: "iox2_", service
              : Service { directory: "services", publisher_data_segment_suffix: ".publisher_d
              ata", static_config_storage_suffix: ".service", dynamic_config_storage_suffix: 
              ".dynamic", creation_timeout: 500ms, connection_suffix: ".connection" } }, defa
              ults: Defaults { publish_subscribe: PublishSubscribe { max_subscribers: 8, max_
              publishers: 2, subscriber_max_buffer_size: 2, subscriber_max_borrowed_samples: 
              2, publisher_max_loaned_samples: 2, publisher_history_size: 1, enable_safe_over
              flow: true, unable_to_deliver_strategy: Block }, event: Event { max_listeners: 
              2, max_notifiers: 16 } } }
              | Set as global config.
        3 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 76,
               data: "/tmp/iceoryx2/services/iox2_b61bd15e8c3ea16146985e960906a8e125156a73.se
              rvice" } }, access_mode: Read, permission: OWNER_READ | OWNER_WRITE | OWNER_EXE
              C | OWNER_ALL, owner: None, group: None, truncate_size: None, creation_mode: No
              ne }
              | opened
        4 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 76,
               data: "/tmp/iceoryx2/services/iox2_b61bd15e8c3ea16146985e960906a8e125156a73.se
              rvice" } }, access_mode: Read, permission: OWNER_READ | OWNER_WRITE | OWNER_EXE
              C | OWNER_ALL, owner: None, group: None, truncate_size: None, creation_mode: No
              ne }
              | opened
        5 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 76,
               data: "/tmp/iceoryx2/services/iox2_b61bd15e8c3ea16146985e960906a8e125156a73.se
              rvice" } }, access_mode: Read, permission: OWNER_READ | OWNER_WRITE | OWNER_EXE
              C | OWNER_ALL, owner: None, group: None, truncate_size: None, creation_mode: No
              ne }
              | opened
        6 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 76,
               data: "/tmp/iceoryx2/services/iox2_b61bd15e8c3ea16146985e960906a8e125156a73.se
              rvice" } }, access_mode: Read, permission: OWNER_READ | OWNER_WRITE | OWNER_EXE
              C | OWNER_ALL, owner: None, group: None, truncate_size: None, creation_mode: No
              ne }
              | opened
        7 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 53, data
              : "iox2_b61bd15e8c3ea16146985e960906a8e125156a73.dynamic" } }, size: 16384, bas
              e_address: 0x102e50000, has_ownership: false, file_descriptor: FileDescriptor {
               value: 5, is_owned: true }, memory_lock: None }
              | open
        8 [T] ServiceState { static_config: StaticConfig { uuid: "b61bd15e8c3ea16146985e96090
              6a8e125156a73", service_name: ServiceName { value: FixedSizeByteString<255> { l
              en: 19, data: "My/Funk/ServiceName" } }, messaging_pattern: PublishSubscribe(St
              aticConfig { max_subscribers: 8, max_publishers: 2, history_size: 1, subscriber
              _max_buffer_size: 2, subscriber_max_borrowed_samples: 2, enable_safe_overflow: 
              true, type_name: "transmission_data::TransmissionData" }) }, global_config: Con
              fig { global: Global { root_path: "/tmp/iceoryx2/", prefix: "iox2_", service: S
              ervice { directory: "services", publisher_data_segment_suffix: ".publisher_data
              ", static_config_storage_suffix: ".service", dynamic_config_storage_suffix: ".d
              ynamic", creation_timeout: 500ms, connection_suffix: ".connection" } }, default
              s: Defaults { publish_subscribe: PublishSubscribe { max_subscribers: 8, max_pub
              lishers: 2, subscriber_max_buffer_size: 2, subscriber_max_borrowed_samples: 2, 
              publisher_max_loaned_samples: 2, publisher_history_size: 1, enable_safe_overflo
              w: true, unable_to_deliver_strategy: Block }, event: Event { max_listeners: 2, 
              max_notifiers: 16 } } }, dynamic_storage: Storage { shm: SharedMemory { name: F
              ileName { value: FixedSizeByteString<255> { len: 53, data: "iox2_b61bd15e8c3ea1
              6146985e960906a8e125156a73.dynamic" } }, size: 16384, base_address: 0x102e50000
              , has_ownership: false, file_descriptor: FileDescriptor { value: 5, is_owned: t
              rue }, memory_lock: None }, name: FileName { value: FixedSizeByteString<255> { 
              len: 40, data: "b61bd15e8c3ea16146985e960906a8e125156a73" } }, _phantom_data: P
              hantomData<iceoryx2::service::dynamic_config::DynamicConfig> }, static_storage:
               Storage { name: FileName { value: FixedSizeByteString<255> { len: 40, data: "b
              61bd15e8c3ea16146985e960906a8e125156a73" } }, config: Configuration { path: Pat
              h { value: FixedSizeByteString<4096> { len: 22, data: "/tmp/iceoryx2/services" 
              } }, suffix: FileName { value: FixedSizeByteString<255> { len: 8, data: ".servi
              ce" } }, prefix: FileName { value: FixedSizeByteString<255> { len: 5, data: "io
              x2_" } } }, has_ownership: false, file: File { path: Some(FilePath { value: Fix
              edSizeByteString<4096> { len: 76, data: "/tmp/iceoryx2/services/iox2_b61bd15e8c
              3ea16146985e960906a8e125156a73.service" } }), file_descriptor: FileDescriptor {
               value: 4, is_owned: true } }, len: 348 } }
              | open service
        9 [D] SharedMemoryBuilder { name: FileName { value: FixedSizeByteString<255> { len: 8
              2, data: "iox2_20123953278630464882616037414168_1979911781231539028909147167311
              04.connection" } }, size: 190, is_memory_locked: false, has_ownership: true, pe
              rmission: OWNER_READ | OWNER_WRITE | OWNER_EXEC | OWNER_ALL, creation_mode: Som
              e(OpenOrCreate), zero_memory: true, access_mode: ReadWrite, enforce_base_addres
              s: None }
              | Unable to open shared memory since the shared memory does not exist.
       10 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 82, data
              : "iox2_20123953278630464882616037414168_197991178123153902890914716731104.conn
              ection" } }, size: 16384, base_address: 0x102e54000, has_ownership: true, file_
              descriptor: FileDescriptor { value: 3, is_owned: true }, memory_lock: None }
              | create
       11 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 56, data
              : "iox2_254_20123953278630464882616037414168.publisher_data" } }, size: 16384, 
              base_address: 0x102e58000, has_ownership: false, file_descriptor: FileDescripto
              r { value: 6, is_owned: true }, memory_lock: None }
              | open

Publisher

iceoryx2 $ cargo run --example publish_subscribe_subscriber -- --help
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `target/debug/examples/publish_subscribe_subscriber --help`
        0 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 20,
               data: "config/iceoryx2.toml" } }, access_mode: Read, permission: OWNER_READ | 
              OWNER_WRITE | OWNER_EXEC | OWNER_ALL, owner: None, group: None, truncate_size: 
              None, creation_mode: None }
              | opened
        1 [T] Config { global: Global { root_path: "/tmp/iceoryx2/", prefix: "iox2_", service
              : Service { directory: "services", publisher_data_segment_suffix: ".publisher_d
              ata", static_config_storage_suffix: ".service", dynamic_config_storage_suffix: 
              ".dynamic", creation_timeout: 500ms, connection_suffix: ".connection" } }, defa
              ults: Defaults { publish_subscribe: PublishSubscribe { max_subscribers: 8, max_
              publishers: 2, subscriber_max_buffer_size: 2, subscriber_max_borrowed_samples: 
              2, publisher_max_loaned_samples: 2, publisher_history_size: 1, enable_safe_over
              flow: true, unable_to_deliver_strategy: Block }, event: Event { max_listeners: 
              2, max_notifiers: 16 } } }
              | Loaded.
        2 [T] Config { global: Global { root_path: "/tmp/iceoryx2/", prefix: "iox2_", service
              : Service { directory: "services", publisher_data_segment_suffix: ".publisher_d
              ata", static_config_storage_suffix: ".service", dynamic_config_storage_suffix: 
              ".dynamic", creation_timeout: 500ms, connection_suffix: ".connection" } }, defa
              ults: Defaults { publish_subscribe: PublishSubscribe { max_subscribers: 8, max_
              publishers: 2, subscriber_max_buffer_size: 2, subscriber_max_borrowed_samples: 
              2, publisher_max_loaned_samples: 2, publisher_history_size: 1, enable_safe_over
              flow: true, unable_to_deliver_strategy: Block }, event: Event { max_listeners: 
              2, max_notifiers: 16 } } }
              | Set as global config.
        3 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 76,
               data: "/tmp/iceoryx2/services/iox2_b61bd15e8c3ea16146985e960906a8e125156a73.se
              rvice" } }, access_mode: Read, permission: OWNER_READ | OWNER_WRITE | OWNER_EXE
              C | OWNER_ALL, owner: None, group: None, truncate_size: None, creation_mode: No
              ne }
              | opened
        4 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 76,
               data: "/tmp/iceoryx2/services/iox2_b61bd15e8c3ea16146985e960906a8e125156a73.se
              rvice" } }, access_mode: Read, permission: OWNER_READ | OWNER_WRITE | OWNER_EXE
              C | OWNER_ALL, owner: None, group: None, truncate_size: None, creation_mode: No
              ne }
              | opened
        5 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 76,
               data: "/tmp/iceoryx2/services/iox2_b61bd15e8c3ea16146985e960906a8e125156a73.se
              rvice" } }, access_mode: Read, permission: OWNER_READ | OWNER_WRITE | OWNER_EXE
              C | OWNER_ALL, owner: None, group: None, truncate_size: None, creation_mode: No
              ne }
              | opened
        6 [T] FileBuilder { file_path: FilePath { value: FixedSizeByteString<4096> { len: 76,
               data: "/tmp/iceoryx2/services/iox2_b61bd15e8c3ea16146985e960906a8e125156a73.se
              rvice" } }, access_mode: Read, permission: OWNER_READ | OWNER_WRITE | OWNER_EXE
              C | OWNER_ALL, owner: None, group: None, truncate_size: None, creation_mode: No
              ne }
              | opened
        7 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 53, data
              : "iox2_b61bd15e8c3ea16146985e960906a8e125156a73.dynamic" } }, size: 16384, bas
              e_address: 0x1015ec000, has_ownership: false, file_descriptor: FileDescriptor {
               value: 5, is_owned: true }, memory_lock: None }
              | open
        8 [T] ServiceState { static_config: StaticConfig { uuid: "b61bd15e8c3ea16146985e96090
              6a8e125156a73", service_name: ServiceName { value: FixedSizeByteString<255> { l
              en: 19, data: "My/Funk/ServiceName" } }, messaging_pattern: PublishSubscribe(St
              aticConfig { max_subscribers: 8, max_publishers: 2, history_size: 1, subscriber
              _max_buffer_size: 2, subscriber_max_borrowed_samples: 2, enable_safe_overflow: 
              true, type_name: "transmission_data::TransmissionData" }) }, global_config: Con
              fig { global: Global { root_path: "/tmp/iceoryx2/", prefix: "iox2_", service: S
              ervice { directory: "services", publisher_data_segment_suffix: ".publisher_data
              ", static_config_storage_suffix: ".service", dynamic_config_storage_suffix: ".d
              ynamic", creation_timeout: 500ms, connection_suffix: ".connection" } }, default
              s: Defaults { publish_subscribe: PublishSubscribe { max_subscribers: 8, max_pub
              lishers: 2, subscriber_max_buffer_size: 2, subscriber_max_borrowed_samples: 2, 
              publisher_max_loaned_samples: 2, publisher_history_size: 1, enable_safe_overflo
              w: true, unable_to_deliver_strategy: Block }, event: Event { max_listeners: 2, 
              max_notifiers: 16 } } }, dynamic_storage: Storage { shm: SharedMemory { name: F
              ileName { value: FixedSizeByteString<255> { len: 53, data: "iox2_b61bd15e8c3ea1
              6146985e960906a8e125156a73.dynamic" } }, size: 16384, base_address: 0x1015ec000
              , has_ownership: false, file_descriptor: FileDescriptor { value: 5, is_owned: t
              rue }, memory_lock: None }, name: FileName { value: FixedSizeByteString<255> { 
              len: 40, data: "b61bd15e8c3ea16146985e960906a8e125156a73" } }, _phantom_data: P
              hantomData<iceoryx2::service::dynamic_config::DynamicConfig> }, static_storage:
               Storage { name: FileName { value: FixedSizeByteString<255> { len: 40, data: "b
              61bd15e8c3ea16146985e960906a8e125156a73" } }, config: Configuration { path: Pat
              h { value: FixedSizeByteString<4096> { len: 22, data: "/tmp/iceoryx2/services" 
              } }, suffix: FileName { value: FixedSizeByteString<255> { len: 8, data: ".servi
              ce" } }, prefix: FileName { value: FixedSizeByteString<255> { len: 5, data: "io
              x2_" } } }, has_ownership: false, file: File { path: Some(FilePath { value: Fix
              edSizeByteString<4096> { len: 76, data: "/tmp/iceoryx2/services/iox2_b61bd15e8c
              3ea16146985e960906a8e125156a73.service" } }), file_descriptor: FileDescriptor {
               value: 4, is_owned: true } }, len: 348 } }
              | open service
        9 [D] SharedMemoryBuilder { name: FileName { value: FixedSizeByteString<255> { len: 8
              2, data: "iox2_20123953278630464882616037414168_1983873189357252245789464952342
              24.connection" } }, size: 190, is_memory_locked: false, has_ownership: true, pe
              rmission: OWNER_READ | OWNER_WRITE | OWNER_EXEC | OWNER_ALL, creation_mode: Som
              e(OpenOrCreate), zero_memory: true, access_mode: ReadWrite, enforce_base_addres
              s: None }
              | Unable to open shared memory since the shared memory does not exist.
       10 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 82, data
              : "iox2_20123953278630464882616037414168_198387318935725224578946495234224.conn
              ection" } }, size: 16384, base_address: 0x1015f0000, has_ownership: true, file_
              descriptor: FileDescriptor { value: 3, is_owned: true }, memory_lock: None }
              | create
       11 [T] SharedMemory { name: FileName { value: FixedSizeByteString<255> { len: 56, data
              : "iox2_254_20123953278630464882616037414168.publisher_data" } }, size: 16384, 
              base_address: 0x1015f4000, has_ownership: false, file_descriptor: FileDescripto
              r { value: 6, is_owned: true }, memory_lock: None }
              | open

@elfenpiff
Copy link
Contributor

@bschwind I think you hit one of the open issues of iceoryx2, meaning when a process crashes we do not yet have an instance that cleans up stale resources. Could you reboot your mac and try again, please? On linux you can do a simple sudo rm -rf /dev/shm/iox2_*; sudo rm -rf /tmp/iceoryx2/services/* but on mac os it is not that easy since the shared memory is not accessible via the file system.

@bschwind
Copy link
Author

I see, thanks for the info! Sorry to bail for now but I'm in the Japan timezone and about to sleep 😅

I'll report back tomorrow with what happens after a reboot.

elBoberido added a commit that referenced this issue Jan 12, 2024
…-macos

iox2-#80 Fix 'clock_nanosleep' on macOS
@bschwind
Copy link
Author

You know what, I think I made a stupid mistake on the last check - I'm running the subscriber twice, instead of a subscriber and a publisher. That explains why they're just sitting there waiting. I also passed a --help flag for some reason on the last one...bad copy pasting!

But in summary, I was able to run them again with the new code and it works! Thanks for the quick response :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants