You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
can I take this up? I want to work with ASAN abit, I remember encountering issues in pgexporter/pgexporter#178 with the memory bit too so maybe I can add a cmake/Sanitizers.cmake file, which will check clang version and see if flags can be added (check_c_compiler_flag("-fsanitize-recover=address"...) in the version.
See src/CMakeLists.txt for the flags we currently have enabled. But, create a list of flags for each clang version, and then do a test if it is available if so enable.
Yes will do! Is it fine if i do this for pgexporter first? Abit in sync with the codebase there and i can test some of the things i've wanted to for a while
fsanitize-recover=address controls error recovery mode for sanitizers
fsanitize-address-use-after-scope detects variables outside their scope (docs)
I'll read up on the support for above flags for different clang versions (6 through 20) or just manually run it on docker containers. I think this is all we would need while going into Debug mode? Let me know if something else would be required
These are supported for all clang x86-64 versions above 4. For 3.x.x they give warnings but from 3.4-3.9 they give compilation errors altogether. Should we add checks for clang 3? because otherwise they are the same. Also similliar scenarios arise for x86-64 gcc compilers, where these flags give error (specifically -fsanitize-address-use-after-scope for gcc versions below 7.1) maybe we can add checks for these too for gcc?
For clang the specific flags which fail in range 3.4-3.9 are -fsanitize-address-use-after-scope -fsanitize-recover. Let me know if it is ok to add these checks and for versions greater than specific versions (4 for clang, 7.1 for gcc) version add all the flags.
Activity
bassamadnan commentedon Apr 5, 2025
can I take this up? I want to work with ASAN abit, I remember encountering issues in pgexporter/pgexporter#178 with the memory bit too so maybe I can add a cmake/Sanitizers.cmake file, which will check clang version and see if flags can be added (check_c_compiler_flag("-fsanitize-recover=address"...) in the version.
bassamadnan commentedon Apr 5, 2025
are there any specific flags you have in mind?
jesperpedersen commentedon Apr 5, 2025
@bassamadnan Go for it !
See src/CMakeLists.txt for the flags we currently have enabled. But, create a list of flags for each clang version, and then do a test if it is available if so enable.
We don't need a special file for it
jesperpedersen commentedon Apr 5, 2025
Maybe do a general doc/manual/dev-05-building.md chapter with the ASAN information as a section.
You can move the building information from the test chapter into it to begin with.
Move the other chapters "up"
bassamadnan commentedon Apr 5, 2025
Yes will do! Is it fine if i do this for pgexporter first? Abit in sync with the codebase there and i can test some of the things i've wanted to for a while
jesperpedersen commentedon Apr 5, 2025
@bassamadnan Sure, just create the issue there
bassamadnan commentedon Apr 5, 2025
Just to be sure, we currently do not have any ASan specific flags right? I am thinking about adding these flags for compiling
I've been reading up on them
I'll read up on the support for above flags for different clang versions (6 through 20) or just manually run it on docker containers. I think this is all we would need while going into Debug mode? Let me know if something else would be required
jesperpedersen commentedon Apr 5, 2025
Yes, it is all the
-fsantizeXYZflags I'm talking about, plus other flags that can help us during development and debuggingbassamadnan commentedon Apr 6, 2025
Im using godbolt. Its the most reliable tool I could find, to test these flags specifically
These are supported for all clang x86-64 versions above 4. For 3.x.x they give warnings but from 3.4-3.9 they give compilation errors altogether. Should we add checks for clang 3? because otherwise they are the same. Also similliar scenarios arise for x86-64 gcc compilers, where these flags give error (specifically
-fsanitize-address-use-after-scopefor gcc versions below 7.1) maybe we can add checks for these too for gcc?For clang the specific flags which fail in range 3.4-3.9 are
-fsanitize-address-use-after-scope -fsanitize-recover. Let me know if it is ok to add these checks and for versions greater than specific versions (4 for clang, 7.1 for gcc) version add all the flags.jesperpedersen commentedon Apr 6, 2025
@bassamadnan Yes, that is the idea -- for Debug include as many options as possible for gcc and clang
bassamadnan commentedon Apr 6, 2025
yup, on it!
[pgmoneta#573] Add version coverage for gcc and clang debug mode
2 remaining items
[pgmoneta#573] Add version coverage for gcc and clang debug mode
[pgmoneta#573] Add version coverage for gcc and clang debug mode
[pgmoneta#573] Add version coverage for gcc and clang debug mode
[pgmoneta#573] Add version coverage for gcc and clang debug mode
[pgmoneta#573] Add version coverage for gcc and clang debug mode
[pgmoneta#573] Add version coverage for gcc and clang debug mode
[pgmoneta#573] Add version coverage for gcc and clang debug mode
[pgmoneta#573] Add version coverage for gcc and clang debug mode
[pgmoneta#573] Add version coverage for gcc and clang debug mode
[pgmoneta#573] Add version coverage for gcc and clang debug mode
[pgmoneta#573] Add version coverage for gcc and clang debug mode
[pgmoneta#573] Add version coverage for gcc and clang debug mode
[pgmoneta#573] Add version coverage for gcc and clang debug mode
[pgmoneta#573] Add version coverage for gcc and clang debug mode