Comments (3)
@afpgit This is expected. The types you are allowed to use in zero-copy communication must satisfy multiple properties:
- Self Contained, they are not allowed to use the heap
- They shall not use vtables
- They are not allowed to use pointers in their internal structure
The string violates 1. and 3. But no worries, you can use the iox::string
as alternative, then your code would look like:
#include "iox/string.hpp"
struct RadarObjectWithString {
double x = 0.0;
double y = 0.0;
double z = 0.0;
iox::string<128> s("string"); // creates a fixed size string with the maximum capacity of 128
};
The reason why you have to satisfy strictly the requirements is, that every process has its own local process space that cannot be accessed from within another process. So if your data structure uses the heap, this heap address is not accessible from another process which causes a segfault.
If you use vtables those tables are essentially function pointer that are also no longer valid in another process space.
And if your construct is using pointers internally, those pointers are invalidated in another process space due to the address randomization. For instance in process A
the process space goes from 0x10 ... 0x2020 and in process B from 0xbebe ... 0xcafe
so if the pointer in process A is pointing to memory location 0x12 it is valid only for process A, in process B it would point to an invalid memory address.
from iceoryx.
@afpgit You can find the above info and much more also in the official documentation: https://iceoryx.io/latest/getting-started/overview/#restrictions. A good read is about shared memory which visualizes what @elfenpiff described can be found here: https://github.com/eclipse-iceoryx/iceoryx/blob/v2.0.5/doc/shared-memory-communication.md
from iceoryx.
Closing the issue. elfenpiff and mossmaurice already answered the question.
from iceoryx.
Related Issues (20)
- Add an 'iox1' prefix to all resources created by 'iceoryx_posh' and 'RouDi' HOT 1
- Test Fixtures for RouDi HOT 2
- Gateway: Support Client/Server in GatewayGeneric HOT 4
- Race condition in 'PoshRuntime' during shutdown
- mutex owner died -> POPO__CHUNK_LOCKING_ERROR HOT 17
- RouDi-GTest Multithread Integration Test HOT 1
- Wrong memory order in MpmcLoFFLi fence synchronization
- Iceoryx support fast-dds HOT 1
- 'NamedPipe' should be more robust
- Listener addEvent deadlock HOT 1
- ChunkHeader should expose the size of the entire user payload section, including padding HOT 6
- Explore cmake object libs for modules iceoryx hoofs HOT 1
- Problems with multiple "persistent" publishers on the same topic at subscriber startup HOT 3
- ssize_t: redefinition; different basic types HOT 3
- Generated files cause recompilation even without any changes HOT 2
- IPC channel still there, doing an unlink of instanceName HOT 5
- Declared but undefined copy assignment operator for iox::expected HOT 1
- Add aliases that conform with other STL container types HOT 2
- Linear search when releasing a sample scales very poorly HOT 38
- Can't directly assign `const` underlying value to `iox::optional` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iceoryx.