Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Messaging] ASSERTS as a new Messaging stream #1822

Merged
merged 87 commits into from
Feb 5, 2025

Conversation

VeithMetro
Copy link
Contributor

The idea behind these changes has been described more in this Jira ticket.

After this PR is merged, the second one to ThunderNanoServices will follow, which adjusts MessageControl accordingly. And then the same will apply to ThunderUI and other repos with some minor adaptations.

…ssage, both used not only in Messaging, but now also in core for the Asserts
…er starts, just like in case of WarningReporting
@VeithMetro VeithMetro marked this pull request as ready for review January 16, 2025 06:43
if (length != 0) {
const uint16_t extra = static_cast<uint16_t>(sizeof(_processId) + (_processName.size() + 1) + (_fileName.size() + 1) + sizeof(_lineNumber) + (_callstack.size() + 1));

ASSERT(bufferSize >= (length + extra));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering what happens when ASSERT() happens during processing of an assert?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depends, if we are talking about Debug and having abort in the ASSERT macro, then I suppose we would only get this ASSERT in the buffer and not the "original" one, since we would abort right after the bufferSize >= (length + extra) ASSERT, so before the original one can be put into the buffer

@sebaszm sebaszm self-requested a review January 24, 2025 08:47
Copy link
Contributor

@sebaszm sebaszm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that ASSERTs on serialize path have non-zero chance of endless recursion and need to be removed (maybe replaced with TRACE_L1 for some sign of the double fault happening) and if needed the assert situation guarded by a condition statement instead.

@VeithMetro
Copy link
Contributor Author

VeithMetro commented Jan 27, 2025

It seems to me that ASSERTs on serialize path have non-zero chance of endless recursion and need to be removed (maybe replaced with TRACE_L1 for some sign of the double fault happening) and if needed the assert situation guarded by a condition statement instead.

@sebaszm correct, the chance of an endless recursion was definitely not zero - if an another ASSERT happened before the original ASSERT was fully serialized, then we could end up with an endless recursion..

To handle that, I replaced each ASSERT on the messages serialization path with a new macro INTERNAL_ASSERT, which, like we discussed on Skype, prints the ASSERT directly onto the console

@pwielders pwielders requested a review from sebaszm January 31, 2025 09:19

AssertionUnitProxy::AssertionUnitProxy()
: _handler(nullptr)
, _adminLock(new Core::CriticalSection())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can this not be a member (composit), Is there a real purpose to the new ?

Copy link
Contributor

@pwielders pwielders Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind found the answer, forward declaration.

@MFransen69 MFransen69 merged commit 1310de6 into master Feb 5, 2025
80 checks passed
@MFransen69 MFransen69 deleted the development/messaging-asserts branch February 5, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants