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

Derecho clients must use same CMake target mode (Debug vs Release) as Derecho #138

Open
mpmilano opened this issue Sep 25, 2019 · 7 comments

Comments

@mpmilano
Copy link
Member

mpmilano commented Sep 25, 2019

Weijia's mysterious serialization bug was caused by building an application in debug mode, and linking it against a release-mode Derecho. Because so much of Derecho is implemented in headers, this meant that some Derecho functions were compiled in Debug mode alongside Weijia's client code, but other Derecho functions were compiled in release mode inside the Derecho installation.

@mpmilano
Copy link
Member Author

We should fix this: that is, we should ensure that the client's choice of debug or release mode for their own code does not need to align with their choice of debug or release mode for derecho's code. We are still working out how exactly to make that happen.

One early idea would be to stop using NDEBUG within Derecho itself, and add a Derecho-specific DEBUG flag in its place. There would be a very large number of places where we need to make this change. In particular, the mutils libraries would need to make a corresponding change.

@sagarjha
Copy link
Contributor

yes, I can't imagine how many things will go wrong if we mixed Debug and Release.

@songweijia
Copy link
Contributor

Obviously, mixing application in Debug mode and library in Release mode happens everywhere in software development (Imagine debugging a program.). Libraries like glibc, boost, allows application development with debugging. I think the issue here is that the behavior of derecho code is different in debug mode and release mode. If we align the behaviors in both mode, it should be fine.

@KenBirman
Copy link
Contributor

I would suggest that Matthew add a new debug flag specifically for debugging his serialization messages. Then we avoid this whole issue, because the message format in Derecho would be identical in debug and release mode, and Matthew could simply enable that flag if he is debugging new serialization logic, but this isn't something end-users would normally be doing.

@mpmilano
Copy link
Member Author

mpmilano commented Sep 26, 2019 via email

@etremel
Copy link
Contributor

etremel commented Jul 4, 2020

Has this been fixed yet? Commit 4c4b577 decoupled the serialization debug code from the standard NDEBUG macro, and it looks like our current version of CMakeLists.txt doesn't rely on the NDEBUG flag (it uses DERECHO_DEBUG and NOLOG instead).

@mpmilano
Copy link
Member Author

mpmilano commented Jul 4, 2020 via email

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

No branches or pull requests

5 participants