-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Generalise development build options, and add --enable-devel-streamcheck #1887
Generalise development build options, and add --enable-devel-streamcheck #1887
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @matt335672
This looks good. I'd also suggest adding the sanitize compile flags to catch more memory errors. Here's my attempt at adding the sanitize flags: aquesnel@27a0eaf
@@ -58,6 +58,7 @@ libcommon_la_SOURCES = \ | |||
log.h \ | |||
os_calls.c \ | |||
os_calls.h \ | |||
parse.c \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parse.c file is missing from this commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. Should be there now!
Might I suggest taking a page from FreeRDP's book: https://github.com/FreeRDP/FreeRDP/blob/master/cmake/ConfigOptions.cmake#L100 Essentially: Options that are for debugging are explicitly labeled so, and you also have the ability to toggle all debug options. |
Thanks for that. I like the idea a lot, but we already have the
So my question is; how do we get from where we are to where we want to be? One idea is just to use a single Here's an other idea, which can be improved on I'm sure.
This is more disruptive but gives an extensible system it should be easy to plug other things into (e.g. the sanitize options). Thoughts, anyone? |
I agree with your suggestion to split up the debug config flags. |
I agree. |
da0e021
to
b866fd6
Compare
Thanks to all for comments. This is now ready for review. I've split it into 5 commits:-
Configure options are now as follows:-
The way it's set up means that combinations like I've moved the necessary pre-processor options into config_ac.h, which means I've removed a lot of these kind of stanzas from Makefile.am files:-
I haven't added @aquesnel's suggested sanitiser calls yet, but it should be trivial to do so. Maybe a separate commit? |
I'd say that we can add the sanitize flags later in a separate PR. |
b866fd6
to
eda01f0
Compare
I could really do with this for testing the stuff I've got in #1900. Since it's developer-only I'll merge it now. |
Fixes --enable-devel-streamcheck (update to #1887)
This [draft] PR which adds a new development-only option --enable-streamcheck
Essentially it adds a check after every stream operation in parse.h that all is working as expected. If not a dump is taken. So it will impact performance, but should let us catch and find stream violations relatively easily during development. I'm not intending for this to be used at runtime!
It seemed to me it would be useful when working on #1885.
I've found a few gremlins already which I'm working through so this isn't yet ready. However, at this stage I'd appreciate any thoughts people have on this.