Skip to content

Commit 6512d02

Browse files
committed
Enable message d_groupId field regardless of build
We currently do some cleverness with where and when we enable the incomplete message group ID feature in `CMakeLists.txt`. However, when using the `build-darwin.sh` and `build-ubuntu.sh` scripts, as we currently recommend, the libraries we install using `make install` have this feature enabled. Unfortunately, enabling message group IDs changes the size of `bmqa_message`’s `MessageImpl`, so a library built with message group IDs enabled is ABI-incompatible with an application built with message group IDs disabled. Because we don’t advertise this feature anywhere or export the definition from CMake, users are unlikely to know they need to compile with the flag `-DBMQ_ENABLE_MSG_GROUPID`, and will run into characteristic ABI-incompatibility issues: buffer overruns, stack clobbering, and segmentation faults. This patch makes a minimal change until we decide what to do with message group IDs: the API is still sensitive to `BMQ_ENABLE_MSG_GROUPID`, but the message structure itself always carries a `d_groupId` field, regardless of its presence. This field is default-initialized and is otherwise unused. Signed-off-by: Patrick M. Niedzielski <[email protected]>
1 parent c186674 commit 6512d02

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/groups/bmq/bmqa/bmqa_message.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ struct MessageImpl {
121121
// SubscriptionHandle this message is
122122
// associated with
123123

124-
#ifdef BMQ_ENABLE_MSG_GROUPID
124+
// #ifdef BMQ_ENABLE_MSG_GROUPID
125125
bsl::string d_groupId;
126126
// Optional Group Id this message is
127127
// associated with
128-
#endif
128+
// #endif
129129
};
130130

131131
// ===============================

0 commit comments

Comments
 (0)