Commit graph

215 commits

Author SHA1 Message Date
Erik Boasson
d920b51b05 fix uninitialised value propagating into key of topic discovery data used by WHC
The only consequence is that the tkmap would probably map the same topic to a different iid each time one was written, or that a different topic would get mapped to some other iid. The latter would cause the WHC to overwrite the older topic. Actual damage is minimal as it would only result in incomplete topic discovery by OpenSplice. That it is mostly harmless today does not mean it couldn't cause any number of interesting surprises in the future.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-04 16:22:35 +01:00
Erik Boasson
f2d0dd2ef4 fix use of initialized memory (in this case, harmless) when a undersized packet is received
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-04 16:22:35 +01:00
Erik Boasson
771eed118b concurrent hopscotch hashtable only needs a load-load barrier in lookup
and that is implied by the x86/x64's memory model ... avoiding the mfence instruction is a significant win

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-04 10:49:25 +01:00
Erik Boasson
95f070d097 cleanup_defrag need not inspect any readers when all readers are in sync
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-04 10:49:21 +01:00
Erik Boasson
4cc7fac8bc clean up tracing for SPDP messages in when discovery category is enabled, but not full tracing
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-04 10:49:21 +01:00
Erik Boasson
c60f4fb797 be consistent in generating the hash for the key value for keyless topics
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-04 10:49:21 +01:00
Erik Boasson
d51a67f74b use plain os_malloc in RHC for performance reasons
simply switching from dds_alloc to os_malloc in alloc_sample removes a redundant memset, which gives 5% improvement in a throughput test (on my laptop); other analogous changes for consistency

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-04 10:48:57 +01:00
Erik Boasson
c61c880fd2 make proxy reader/writer references to sertopics properly counted, strong references
without this, deleting the last reader/writer that references the topic results in a dangling pointer ... but there is another intriguing solution: erase the topic from the proxy reader/writer when the last matching local one disappears, so that the topic completely disappears. I rather like this second solution, but I am not yet sure of the consequences and the first (implemented one) is such a simple change that fixes a real problem that it is a no-brainer

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-03 17:30:25 +01:00
Erik Boasson
0d0a2bd2df increase maximum size of thread name in tracing code to fit "dq.builtin"
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-02 16:44:24 +01:00
Erik Boasson
52a0751055 fix leaking of address sets in network partitions
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-02 16:43:42 +01:00
Erik Boasson
23972aa8f7 change the way WHC state is passed round in the transmit path to allow tighter assertions and silencing of warnings from clang's static analyzer
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-02 15:03:21 +01:00
Erik Boasson
ed06ab8f4b trivial modifications to pacify gcc -O2 and clang --analyze
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-02 15:03:20 +01:00
Erik Boasson
b70e88c16f change initialization of AVL trees to avoid "strict prototype" warnings
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-02 15:03:19 +01:00
Erik Boasson
65ac9b0711 fix error propagation in dds_get_qos
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-02 15:03:18 +01:00
Erik Boasson
9f51c44e50 Avoid deadlock on publication-matched listener invocation
This addresses the deadlock of #41 but leaves another issue open: sequencing of listener invocations on publication/subscription matched events: there is a risk that the "unmatch" even precedes the "match" event from the application perspective, even though it is quite unlike in practice. Various ways of addressing it exist, but it looks like sequencing at the level of the "dds" entities suffers from similar risks. So better to just avoid the deadlock for now.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-02 12:13:40 +01:00
Erik Boasson
ca99fd10aa Refactor handling of an SPDP-republish event
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-02 12:13:40 +01:00
Erik Boasson
0064def595 Set cover in address set generation used a temporary that was too large by a factor of sizeof(void*)
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-02 12:13:40 +01:00
Erik Boasson
c491f321dd Fix incorrect free of unicast socket/connection in rtps_init error handling
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-02 12:13:40 +01:00
Erik Boasson
27913be1c3 Fix memory leak in function to clear all writer address sets
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-02 12:13:40 +01:00
Erik Boasson
0b814df584 Use sizeof(sin_addr) in IPv4 address compare instead of effectively sizeof(size_t)
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-02 12:13:40 +01:00
Erik Boasson
d6306bddbb Properly handle "incompatible if unrecognized" in parameter lists (#79)
Previously it would fall through and assert in a debug build or return an error in a release build. The behaviour in a release build was almost correct, as the flag means the entity should be completely ignored if the parameter is not understood by the implementation, but I don't believe it should result in a warning — certainly not that claims the parameter list is invalid. A specific return code is now used to indicate a parameter list that was rejected because of this flag, and that suppresses the warning.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-02 12:13:40 +01:00
Erik Boasson
e0d5587639 Unified key-to-iid map means a backref to the map is no longer needed
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-02 12:13:40 +01:00
eboasson
96da0c5555
Merge pull request #82 from eboasson/master
participants are not hidden built-in entities in built-in topics and should get an instance handle consistent with the DCPSParticipant topic
2019-01-01 19:54:55 +01:00
Erik Boasson
781c644800 participants are not hidden built-in entities in built-in topics and should get an instance handle consistent with the DCPSParticipant topic
Signed-off-by: Erik Boasson <erik.boasson@prismtech.com>
2019-01-01 18:52:27 +01:00
eboasson
46b1aa5366
Merge pull request #76 from eboasson/builtintopics
Fixes for memory leaks, out-of-bounds reads and race conditions working with instances
2018-12-25 15:21:14 +01:00
Erik Boasson
7a9f845636 enable address sanitizer on clang Debug builds by default
Signed-off-by: Erik Boasson <eb@ilities.com>
2018-12-25 12:40:05 +01:00
Erik Boasson
179a35d192 fix race conditions in instance id-to-key lookup
this is just an intermediate step: firstly, iid-to-key lookup is a linear scan; secondly, the lookup should happen on the RHC or the WHC and not on some internal map to associates key values with instance handles and is independent of entities

Signed-off-by: Erik Boasson <eb@ilities.com>
2018-12-25 12:40:05 +01:00
Erik Boasson
0f7ce1ac43 instance operations must also ensure thread is considered awake or GC may free tkmap instances prematurely
Signed-off-by: Erik Boasson <eb@ilities.com>
2018-12-25 12:40:05 +01:00
Erik Boasson
84506b8518 rollback changes to dispose counts when resource limits reached during RHC update
Signed-off-by: Erik Boasson <eb@ilities.com>
2018-12-25 12:40:05 +01:00
Erik Boasson
e96a47f3f9 fix test issues detected by address sanitizer
Signed-off-by: Erik Boasson <eb@ilities.com>
2018-12-25 12:40:05 +01:00
Erik Boasson
98c53db057 fix leak of config data if a domain id problem leads to an initialization failure
Signed-off-by: Erik Boasson <eb@ilities.com>
2018-12-25 12:40:05 +01:00
eboasson
97c5e06b6a
Merge pull request #69 from FirasSahliADLinktech/rename-functions
Make function names more consistent:

* ``dds_topic_{get,set}_filter`` -> ``dds_{get,set}_topic_filter``
* ``dds_{get,set}_enabled_status`` -> ``dds_{get,set}_status_mask``
* ``dds_instance_lookup`` -> ``dds_lookup_instance``

Plus removal of defunct ddsv2.h.
2018-12-25 12:38:25 +01:00
eboasson
4223fff818
Merge pull request #45 from eboasson/builtintopics
Rework builtin topics and add DCPSPublication and DPCSSubscription
2018-12-16 22:07:31 +01:00
Erik Boasson
1a0fcea0c2 replace old builtin topics by new ones and add implementation of DCPSSubscription and DCPSPublication
Signed-off-by: Erik Boasson <eb@ilities.com>
2018-12-14 14:02:08 +01:00
Erik Boasson
78d49b52a0 add new "builtin topic" types and conversion routines
Signed-off-by: Erik Boasson <eb@ilities.com>
2018-12-14 14:02:08 +01:00
Erik Boasson
945fc94de7 setting "must inspect result" on return_loan is pedantry
Signed-off-by: Erik Boasson <eb@ilities.com>
2018-12-14 14:02:08 +01:00
Erik Boasson
e631567c35 extend sertopic interface and move the concept of a type descriptor to just the sertopic definition
Signed-off-by: Erik Boasson <eb@ilities.com>
2018-12-14 14:02:08 +01:00
Erik Boasson
c169df6227 fix refcount leak of tkmap instances when copying transient-local history from a local writer
Signed-off-by: Erik Boasson <eb@ilities.com>
2018-12-14 14:02:08 +01:00
Erik Boasson
ef65101ad7 pushing released serdata:s onto a freelist was dropped by accident in the rewriting of them
Signed-off-by: Erik Boasson <eb@ilities.com>
2018-12-14 14:02:08 +01:00
Erik Boasson
29f542b916 iid and tkmap are integral to this DDSI stack and should be part of it
They were made available from the DCPS layer to DDSI using some function pointers, but it makes more sense to have them as part of the DDSI core.

Signed-off-by: Erik Boasson <eb@ilities.com>
2018-12-14 14:02:08 +01:00
eboasson
19202d9de8
Merge pull request #70 from k0ekk0ek/fix-55
Do not require table to contain address if interface is down (Fixes #55)
2018-12-12 17:34:23 +01:00
Angelo Corsaro
d0ea1e8389
Updated with latest performance number 2018-12-12 10:38:34 +01:00
Firas Sahli
9f51f6f9dc
Rename get and set filter functions for topic
Signed-off-by: Firas Sahli <firas.sahli@adlinktech.com>
2018-12-11 11:07:09 +01:00
Firas Sahli
05f961dec1
Rename get and set of enabled status to mask
Signed-off-by: Firas Sahli <firas.sahli@adlinktech.com>
2018-12-11 11:07:09 +01:00
Firas Sahli
99f410bc49
Rename dds_instance_lookup to dds_lookup_instance
Signed-off-by: Firas Sahli <firas.sahli@adlinktech.com>
2018-12-11 11:06:50 +01:00
Firas Sahli
af7e34f143
Remove ddsv2.h
Signed-off-by: Firas Sahli <firas.sahli@adlinktech.com>
2018-12-11 11:06:27 +01:00
Jeroen Koekkoek
3c5a209389 Fix build warnings by passing a message to CU_PASS
Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
2018-12-10 13:05:59 +01:00
Jeroen Koekkoek
3b69213f51 Do not require table to contain address if interface is down (Fixes #55)
Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
2018-12-10 13:05:59 +01:00
eboasson
31cc166047
Merge pull request #68 from k0ekk0ek/criterion-be-gone
Replace Criterion by CUnit
2018-12-06 16:01:50 +01:00
Jeroen Koekkoek
74a48c5731 Replace Criterion by CUnit
Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
2018-12-06 14:48:30 +01:00