You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the sequence array is not defined or only some elements in the array are defined, the segmentation fault will occur in the program. I would like to ask if this is the agreed behavior (all elements in the sequence array need to be defined), or is this a problem? Looking forward to your response!
for (int i = 0; i < 5; i++) {
msg->data[i]._buffer = dds_alloc(100);
msg->data[i]._length = 100;
msg->data[i]._release = true;
}
=== [MyTestPublisher] Waiting for a reader to be discovered ...
[MyTestPublisher] Writing : Segmentation fault (core dumped)
The text was updated successfully, but these errors were encountered:
Yes, in general samples that you pass into the API need to be valid. That means:
strings must point to a null-terminated string or be a null pointer
sequences need _length ≤ _maximum and _buffer may not be a null pointer if _length > 0
the sequence buffer will not be allocated/resized/freed if _release is falseexcept that if everything is 0 it will take over ownership in read/take and allocate and that it is somewhat forgiving of _maximum < _length
all elements of an array need to be initialized
the union case identified by the discriminant must be correctly initialized
@external pointers may never be a null pointer on write.
Maybe I forgot something, maybe not 😂 I'm sure you understand. That exception noted above about sequences exists so you can memset everything 0 and you'll be good for read and take.
There are few functions that only care about the values of the key fields, for example dds_dispose. Those ignore all other fields, so in your example, you can call dds_dispose with id set correctly and everything else garbage.
The text was updated successfully, but these errors were encountered: