Commit Graph

260 Commits

Author SHA1 Message Date
Claude
b70595cebe fix(config): reject channel properties of the wrong type
- ptree::get(key, default) returns the default also for a value that
  does not convert, so a typo (e.g. sndBufSize=big) silently gave the
  default value
- Use the default only for a missing key; throw ParserError with the
  key and the value for a value of the wrong type
- Rethrow parser errors in the config plugin: before, the device
  logged the error and continued without its channel configuration
- Enable JSONParser and SuboptParser RejectsValuesOfTheWrongType
- Update the documentation pages that described the defect, and
  the source line links into the changed files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 15:42:53 +01:00
Claude
442b203d0d fix(fsm): refuse all transitions in the Error state
- The Error state is a terminate state: the state machine ignores all
  events in it and calls no action, so ChangeState() returned the
  result of the previous transition (ErrorFound: true)
- Return false for each transition in the Error state, except for
  ErrorFound: the device is already in the Error state, so callers
  such as ChangeStateOrThrow(ErrorFound) in Device::RunWrapper() or
  in user code do not throw
- Enable StateMachine.RefusesTransitionsInError
- Update the documentation pages that described the defect, and
  the source line links into the changed files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 15:42:53 +01:00
Claude
e366c40139 test(shmem): add tests for the shared memory monitor API
- SegmentIsPresent() before, during and after the life of a factory
- RegionIsPresent() during and after the life of a region
- With shm-no-cleanup the segment stays, and Cleanup() removes it
- Add a disabled debug-mode test for a known defect: GetDebugInfo()
  writes past the end of its result vectors and returns them empty

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
4e4d21bbd0 test(device): add tests for the runner options and interactive keys
- --print-options prints the computed options and does not start the
  device
- --print-channels and --version do not start the device
- Interactive control: h, c, p, k and an invalid key print their action
- Register two channel endpoints in the StateAction device
- Add disabled tests for known defects: --print-channels and --version
  print nothing (console severity "nolog"); keys that arrive in one read
  stay in the std::cin buffer and are never handled

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
89cbc968d8 test(shmem): add tests for allocation in a full segment
- For both allocation algorithms (rbtree_best_fit, simple_seq_fit)
- A message larger than the segment throws MessageBadAlloc
- A full segment throws, and allocates again after a release
- bad-alloc-max-attempts and bad-alloc-attempt-interval
- shm-throw-bad-alloc=false waits until memory is free;
  Interrupt() ends the wait with MessageBadAlloc

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
4ae5a6d2f5 test(device): add tests for the data callbacks and ConditionalRun()
- OnData() with single messages and with Parts on all transports;
  a callback that returns false ends Run() and the device goes to Ready
- Two input channels (poller path) and one input channel per transport
  (one poll thread per transport, per-channel transport override)
- ConditionalRun() ends Run() when it returns false; the rate option
  limits the calls

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
788ca57859 test(tools): add tests for the tools library
- RateLimiter: lower bound of the duration at 200 Hz; rate 0 does not
  sleep
- InstanceLimiter: throws above the limit, counts down on destruction
- Semaphore and SharedSemaphore: counts, blocking Wait(), shared count
- ToString(), StrStartsWith(), StrEndsWith(), ToStrVector()
- Uuid() and UuidHash() are unique
- execute(): output with prefix, stderr, exit code, stdin input,
  signal, timeout
- Skip Tools.NetworkDefaultIP on a machine without a default route

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
cc3297b2fd test(parts): add tests for Parts access and pmr messages on all transports
- Parts: variadic constructor, At() and operator[] (const and not),
  At() out of range throws, Empty(), Clear(), move
- Transfer of Parts with an empty part on all transports
- A pmr container from the transport memory resource becomes a message
  without a copy and transfers its data, on all transports
- Add disabled tests for two known defects: zeromq refuses an empty
  Parts and shmem sends it; shmem Receive(Parts) of a single-message
  Send() reads the message size as the number of parts and crashes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
bf128e0044 test(transport): add tests for the transport factory API edges
- An unknown transport name throws; an empty id gets a uuid
- shmem refuses pub and sub sockets, zeromq creates them
- GetType() per transport
- Receive is interrupted after Interrupt() and works after Resume()
- NewSimpleMessage() copies string, literal and value data;
  NewStaticMessage() uses the caller's buffer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
03465e1993 test(channel): add tcp tests with and without auto-bind
- AutoBind: a second bind on a port in use gets a port in the range,
  and both endpoints transfer data
- NoAutoBind: BindEndpoint() fails and keeps the endpoint
- PAIR over tcp in both directions, on all transports

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
69064731af test(properties): add tests for the JSON and suboption channel parsers
- JSONParser: sub-channels inherit and override the channel values,
  numSockets expansion, defaults, device selection by key or id,
  errors for no id, no fairMQOptions, no channel name and no file
- SuboptParser: all keys with their types, one sub-channel per address,
  numSockets, unknown keys, no channel name, no device id
- Add disabled tests for a known defect: a value of the wrong type
  silently gives the default

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
dadbecf49b test(fsm): add tests for the state machine and the state names
- Walk the device lifecycle; in each state check that the illegal
  transitions are refused and leave the state unchanged
- ResetDevice from each device state, ErrorFound from each state
- A transition is refused while another one is pending
- State change and new transition subscriptions, unsubscribe,
  PrepareState() and HandleStates() order
- Name round trips for all states and transitions; unknown names throw
- Add a disabled test for a known defect: ChangeState() returns true in
  the Error state

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
f1ae05b45c test: use comparison assertions that print both values
- EXPECT_EQ/EXPECT_NE instead of EXPECT_TRUE(a == b) in the parts,
  memory resource and plugin manager tests; split the && checks
- ASSERT_NE on the message pointer before it is dereferenced
- ASSERT_TRUE/ASSERT_FALSE instead of ASSERT_EQ(x, true/false)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
8ff2214f9c test: parameterize the device state tests by state and control
- Add test::StateParam (state, control mode, stdin input) and
  WithControls() for INSTANTIATE_TEST_SUITE_P()
- Turn the 60 TEST() copies in the Exceptions, ErrorState, Signals and
  WaitFor files into one TEST_P() each
- The test names change, e.g. Exceptions.interactive_InRun is now
  Exceptions.Throw/interactive_Run, Signal_SIGINT.* is Signals.RaiseSIGINT/*
  and ErrorState.OrphanMessages is OrphanMessages.shmem

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
5da5a35b4d test: parameterize the message, region, channel and option tests by transport
- Turn the per-transport TEST() copies into TEST_P() suites:
  Messages, ShmMessages, Regions, ConnectedPeers and Options
- The test names change, e.g. Resize.shmem_expanded_metadata is now
  Messages.Resize/shmem_expanded_metadata

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
6a55bf1d55 test: parameterize the protocol, poller and transfer tests by transport
- Add test::TransportParam with the transport, the expanded shm metadata
  flag and a name generator for INSTANTIATE_TEST_SUITE_P()
- Turn the per-transport TEST() copies into TEST_P() suites; the poller
  and transfer tests now also run with the expanded shm metadata
- Name the multipart suite PushPullMultipart (it shared PushPull)
- Discover the tests with NO_PRETTY_VALUES, so the ctest names are
  Suite.Case/transport
- The test names change, e.g. Pair.SingleMsg_MultiThreaded_ipc_shmem
  is now Pair.SingleMsg_MultiThreaded_ipc/shmem

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
2a57a38efe refactor(test): merge the state action test devices
- Replace TestExceptions, TestErrorState, TestSignals and TestWaitFor
  with one StateAction device; the id selects the action and the state
- Run the device tests through test::RunDevices() instead of
  EXPECT_EXIT() and check the exit code and the expected log line

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
be400e4752 test: run multi-process tests with one harness
- Add test::RunDevices(): starts the devices with the same session,
  transport, shm options and channel config, with a deadline per run
- Add the TestDevice base: Check() fails the device, Succeed() prints
  a marker with the transport name that the harness verifies
- Make the protocol, poller and transfer-timeout devices check their
  own results and drop the InitTask() sleeps
- Replace EXPECT_EXIT() and the copied launch code in the protocol,
  poller and transfer-timeout tests
- A device that uses the wrong transport now fails the test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
3c752937a4 test: use unique ipc addresses that the tests remove
- the in-process tests used fixed, relative ipc addresses; the socket
  files stayed in the build directory (99 files after 6 runs), and two
  runs of the same test at the same time could share a socket
- use test::IpcAddress: a unique path in /tmp that the destructor
  removes
- drop the session suffix of the inproc addresses: an inproc address
  is local to the process

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
0367c2a4a8 refactor(test): set up test configs with test::Configure()
- 33 places repeated the same session, shm segment size, shm monitor
  and expanded metadata properties
- call test::Configure() and set only the properties that differ

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
d4a85086aa test: wait for conditions instead of fixed sleeps
- Channel.GetNumberOfConnectedPeers slept 100 ms and then expected the
  peer count; on a slow runner the count can change later
- poll the count with a deadline instead
- remove the 500 ms sleep in Init() of the MultipleDevices sender and
  receiver: the transfer does not depend on the order of bind and
  connect

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
d67a6c0745 fix(test): join threads and end the device on an early return
- an ASSERT_* between thread start and join() returned with a joinable
  std::thread, and its destructor called std::terminate()
- the PluginServices fixture ended the device only from Idle; after a
  failure in another state, the join waited until the ctest timeout
- use StateMachineThread in the Transitions tests and in the fixture,
  and JoiningThread in Region.LockOrder

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
5994ea44de fix(test): fail instead of hang when a region callback check fails
- an ASSERT_* in a region callback returned before blocker.Signal(),
  and the test then waited in blocker.Wait() until the ctest timeout
- use EXPECT_* in the callbacks, so that the signal always comes
- wait with a deadline (test::Semaphore) in the region and message
  tests
- in RegionEventSubscriptions, make the semaphore outlive the factory
  that calls the callback

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
f8e1b34fb1 test: add helpers for timed waits, threads, configs and addresses
- Sync.h: WaitUntil() polls a condition with a deadline; Semaphore
  waits with a deadline; JoiningThread joins on destruction
- ControlDevice.h: Shutdown() drives a device to Exiting from any
  state; StateMachineThread runs the state machine and shuts it down
  on destruction
- Transport.h: Configure() sets the session and shm properties of a
  test config; IpcAddress makes a unique ipc address in /tmp and
  removes the socket file

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
35caaab403 fix(test): do not change the global log severity in tests
- ZeroCopyFromUnmanaged and RegionEventSubscriptions set the console
  severity to debug and did not restore it
- the setting stayed active for all later tests in the same process,
  e.g. with --gtest_repeat or a direct run of the test binary

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
ddb365efe4 fix(test): check the results of Bind, Connect, Send and Receive
- the message, region, channel and transport tests ignored the return
  values of these calls; a failed bind or a short transfer showed up
  later as an unrelated failure, or not at all
- assert each result where the test uses it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
df7d99bb76 fix(test): remove two undefined reads
- PluginServices.Control: the condition variable predicate could read
  nextState before the callback wrote it; initialize it
- MemoryResources.allocator: &*v.end() dereferences the end iterator;
  compute the end address from v.data() + v.size()

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
e59a410951 fix(test): check the values of the state and transition conversions
- the conversion tests only checked that no exception was thrown, so a
  wrong mapping passed
- check each name and value in both directions, include the states
  and transitions that the tests missed (UNDEFINED, INITIALIZED, BOUND,
  AUTO, BIND, CONNECT), and check that an unknown name throws

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
65c02d182b fix(test): read the bulk-updated property from the plugin services
- the Accessors test read the value back from its own local property
  map, which it had just written, so the check could not fail
- check the result of UpdateProperties() and read the value back from
  the plugin services

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
df403279a5 fix(test): compare the string event value with the expected value
- the SubscribeAsString() callback compared the received value with its
  own string conversion, so the check could not fail
- compare it with the string conversion of the value that the test set

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:01 +01:00
Claude
3077d1c0ab test: use 100 MB shm segments in all shmem tests
- The shmem default segment is 2 GiB, and Boost reserves it with
  posix_fallocate, so each test takes 2 GiB of /dev/shm
- Parallel test runs then exhaust /dev/shm and segment creation
  fails with "No space left on device"
- Set --shm-segment-size 100000000 like the other tests already do

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:00 +01:00
Claude
d05ec00d54 chore(test): remove dead test code
- remove the StateMachine test: CMake did not build it, and it used an
  API that no longer exists
- remove memory_resources/runner.cxx: no target uses it
- remove the mqConfig declaration (never defined) and the
  SDK_TESTSUITE_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR macros (unused,
  test/sdk does not exist)
- remove the unused boost/process includes from the device tests, and
  the compile definition that selected their header

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:00 +01:00
Claude
589f51c73a test: name the pair tests and devices after what they use
- the Pair tests use an ipc address, but their names said tcp
- add the missing separator in the req and sub device ids
  (sub_1zeromq -> sub_1_zeromq)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:00 +01:00
Claude
6fde1da288 fix(test): run protocol and poller devices on the tested transport
- the Pair, PushPull, ReqRep, PubSub and Poller tests started the test
  devices without --transport
- the devices used the default transport (zeromq), also in the tests
  for shmem; the shm options on the command line had no effect
- 8 tests named *shmem* tested zeromq only
- pass --transport to each device

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:00:00 +01:00
Claude
e7f6c37247 test(shmem): guard size of Message and layout of MetaHeader
- Fail if `sizeof(shmem::Message)` grows above 72 bytes on LP64.
- Fail if `sizeof(shmem::MetaHeader)` changes from 40 bytes, because
  it is the wire format of the metadata message.
- Check the field order of `MetaHeader` with positional aggregate
  initialization and `offsetof`. Users such as AliceO2 create it by
  field position.

Refs: #477

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 15:11:03 +01:00
Claude
f1312aefe3 fix(shmem): release region blocks of reused messages to their own region
- Remove the `fRegionPtr` member of `shmem::Message`. It cached the
  region of the last `GetData()`, `GetRefCount()` or `Copy()` call.
  `Rebuild()` and `Socket::Receive()` did not reset it.
- When a message received a block of region A, was read, rebuilt, and
  then received a block of region B, its release went to region A.
  Region A got a wrong callback and region B never got its block back.
- Look up the region with `Manager::GetRegionFromCache()` where it is
  needed. The lookup is a thread-local fast path.
- `sizeof(shmem::Message)` goes from 80 to 72 bytes on LP64.

Refs: #477

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 15:11:03 +01:00
Claude
f4e265a562 fix(shmem): lock the region mutexes in one order
- GetRegion() locks the local region mutex first and then the
  session-wide shmem mutex; CreateRegion() locked them in the opposite
  order
- a thread that creates a region and a thread that opens a region of
  another process in the same session can deadlock (ABBA)
- lock the local region mutex first also in CreateRegion()
- add a regression test

Refs: #334
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 13:37:01 +01:00
Claude
139111a0c5 fix(shmem): do not hold region locks while region acks stop
- RemoveRegion() held the session-wide shmem mutex and the local region
  mutex while it joined the ack threads of the region
- the ack receiver calls the user callback for each outstanding ack
  during the linger period; a callback that calls into the transport
  (e.g. GetRegionInfo(), or a message destruction that opens a region)
  waits for one of these mutexes, and the destruction never ends
- the shmem mutex is shared by all processes of the session, so the
  other processes hang also, and new processes hang at startup
- stop the acks without a lock, then lock each mutex separately and
  only for the access to the shared data
- add a regression test

Refs: #334
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 13:37:01 +01:00
Claude
c5b52e622f ci: add libstdcxx-tsan recipe version for gcc 15.3.0
- spack now resolves gcc@15 to 15.3.0, but the recipe only knew 15.2.0,
  so the tsan wiring check failed on the version lockstep test
- checksum taken from spack's gcc package

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-02 18:26:54 +01:00
Claude
f876b58363 ci: keep tsan-instrumented libzmq out of non-tsan environments
- the shared buildcache holds the instrumented libzmq/libsodium; spec
  reuse picked them up for gcc@15 jobs of the latest and boost187
  environments, crashing every test in fork() under libtsan
- exclude them from reuse in both environments

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-02 18:26:54 +01:00
Dennis Klein
7e63d4ae9a test: drop thread-sanitizer suppressions
- every entry stood in for a library tsan could not see into; with libzmq,
  libsodium and libstdc++ now tsan-instrumented in the tsan CI job, the
  happens-before edges they establish are visible and nothing is left to
  suppress
- suppressions were blunt (a race: entry matches any frame in the stack),
  so they could also mask real races passing through those frames
2026-06-10 19:31:19 +02:00
Dennis Klein
add85cb18d ci: add tsan spack environment with instrumented libzmq
- mirror spack-latest.yaml, with -fsanitize=thread on the libzmq and
  libsodium nodes so tsan can observe the happens-before edges established
  inside libzmq's lock-free queues, plus the libstdcxx-tsan root spec
- flags are applied per node instead of via the propagating '==' operator,
  which could reach the gcc node and trigger a compiler rebuild
- unchanged roots (fairlogger, boost, ninja, cmake) keep their spec hashes,
  so they are shared with the regular buildcache entries; the instrumented
  nodes hash differently and coexist in the content-addressed cache
- exclude libstdcxx-tsan from concretizer reuse so recipe changes always
  take effect; unchanged recipes still hit the buildcache because the spec
  hash is identical
- add the tsan env to the buildcache matrix (rebuilding also on spack_repo
  changes) so the instrumented binaries are cached instead of rebuilt on
  every CI run
2026-06-10 19:31:19 +02:00
Dennis Klein
331c50ab0e ci: add spack package for a tsan-instrumented libstdc++
- gcc ships no supported switch to build libstdc++ with -fsanitize=thread,
  and spack's gcc recipe filters all flags out of the target-library build
  (CXXFLAGS_FOR_TARGET is owned by its generated --with-build-config=spack
  makefile), so provide a dedicated libstdcxx-tsan package in a custom repo
- build only the libstdc++-v3 subtree from the matching gcc release tarball,
  configured standalone against the already-installed toolchain (recipe
  modeled on https://iree.dev/developers/debugging/sanitizers/), instead of
  rebuilding all of gcc
- the result is a drop-in runtime replacement for the compiler's libstdc++
  (same soname and symbol versions), to be loaded only by the instrumented
  test executables
- normalize the install layout after make install: the standalone build puts
  the runtime libraries into the multilib os dir (lib64 on x86_64) regardless
  of --libdir, and --with-toolexeclibdir only applies to cross builds
- register the repo in the setup-deps action before creating the env
2026-06-10 19:31:19 +02:00
Dennis Klein
b568535910 test: support an alternative runtime library dir per test
- introduce FAIRMQ_TEST_LD_LIBRARY_PATH, which prepends a directory to
  each test's environment via ctest, so the tests can run against an
  alternative runtime library (e.g. a tsan-instrumented libstdc++)
- LD_LIBRARY_PATH rather than an injected rpath: an rpath added via the
  linker flags cannot precede the rpath spack's gcc adds through its
  specs file, so the compiler's own libstdc++ would keep winning the
  runtime search order
- scoped per test on purpose: an instrumented library has unresolved
  __tsan_* symbols and must not be loaded into uninstrumented tools
  like cmake, ctest or ninja
- fail the configuration instead of silently dropping the injection on
  CMake < 3.22 (ENVIRONMENT_MODIFICATION)
- cover the example tests too; they share the instrumented runtime but
  not the locale-cache warmup (their main() is the installed public
  header). The custom-controller env block was dead before: it tested
  lsan_options, which only ever existed in the add_example() function
  scope, so the test also never received the LSan suppressions
2026-06-10 19:31:19 +02:00
Dennis Klein
2bd9a072a9 test: pre-fill libstdc++ ctype caches before threads exist
- std::ctype<char> caches narrow()/widen() results per character in
  plain char arrays of the global classic-locale facet, written without
  synchronization from header-inlined code (locale_facets.h); two
  threads exercising an uncached character concurrently (e.g. compiling
  a std::regex in Channel::Validate) constitute a true data race that
  ThreadSanitizer rightfully reports
- the stores are real and unsynchronized, so a tsan-instrumented
  libstdc++ cannot help here; instead fill the caches before any thread
  is spawned, which turns every later access into a pure read
- warm the lazily-installed num_put/num_get caches used by stream
  insertion/extraction as well, via a small format/parse round-trip
- wire the warm-up into the gtest runner main() and, via a static
  initializer, into the test device runner
2026-06-10 19:31:19 +02:00
Dennis Klein
19e607e486 test: fix racy loop-variable capture in SubscriptionThreadSafety
- the subscriber threads captured the loop counter by reference while
  the spawning loop kept incrementing it: a genuine data race
- depending on timing, threads could also end up with duplicate
  subscriber names; capture the counter by value instead
2026-06-10 19:31:19 +02:00
Alexey Rybalchenko
215c31428b feat(shmem): expose side-channel metadata API for unsent messages
Add two public entry points needed by the ALICE use case where shmem
messages are allocated via a transport but never sent — their metadata
is instead serialised into Arrow tables and delivered over a separate
channel, allowing consumer devices to resolve the payload pointer
without taking ownership.

shmem::Message::GetMeta() returns the MetaHeader of the message,
mirroring the existing positional-init pattern already used in Socket.h.

shmem::GetDataAddressFromHandle(TransportFactory&, const MetaHeader&)
is a free function declared in Common.h and defined in Manager.cxx.
Keeping it out of the TransportFactory class body means callers only
need to include Common.h (available transitively via Message.h) and do
not drag in Socket.h or zmq.h. The implementation handles both managed
segments and unmanaged regions, and throws SharedMemoryError with a
typed message on a bad segment or region id. TransportFactory also
gains a same-named member for callers that already have the concrete
type. Lifetime of the returned pointer is the caller's responsibility;
the cache device is expected to hold the messages alive.

A SideChannel test covers the GetMeta/GetDataAddressFromHandle
round-trip for both standard and expanded-metadata configurations.
2026-06-10 18:51:04 +02:00
Dennis Klein
a0e8271aca test: suppress libzmq-induced thread-sanitizer false positives
- libzmq is not tsan-instrumented, so tsan cannot see the happens-before
  its queues establish between user threads and libzmq I/O threads,
  producing false-positive data races on message buffers
- add test/thread_sanitizer_suppressions.txt and point TSAN_OPTIONS at it
  via the sanitizers job env so it reaches the tests and their device
  subprocesses
- suppress: accesses made directly from libzmq, the zero-copy message
  deleters libzmq runs from msg_t::close, shmem receive-side metadata
  reads, and std::regex/locale lazy-init races in libstdc++
2026-06-09 23:00:58 +02:00
Dennis Klein
7a44c5e19e style: add braces around single-statement bodies
- wrap single-statement control-flow bodies in braces
- clang-tidy readability-braces-around-statements
  https://clang.llvm.org/extra/clang-tidy/checks/readability/braces-around-statements.html
2026-06-09 23:00:58 +02:00
Dennis Klein
0fd27cbbc3 ci: match renamed libzmq leak frame in lsan suppressions
- LSan symbolizes the leak as the C++ method `zmq::msg_t::init_size`
  in the Debug sanitizer build, no longer the C wrapper
  `zmq_msg_init_size`
- substring match failed (`_` vs `::`), so the suppression no longer
  applied and the asan+lsan+ubsan job failed in Pair/PubSub/Poller tests
- add the demangled frame, keep the old pattern for older libzmq
2026-06-09 23:00:58 +02:00