Skip to content

[#573] Add version coverage for gcc and clang debug mode - #594

Merged
jesperpedersen merged 1 commit into
pgmoneta:mainfrom
bassamadnan:asan
Apr 13, 2025
Merged

jesperpedersen merged 1 commit into
pgmoneta:mainfrom
bassamadnan:asan

Conversation

@bassamadnan

Copy link
Copy Markdown
Collaborator

Addressing #573 , The version details for different address sanitizer flags can be found here pgexporter/pgexporter#209 , as a refresher:

  1. -fsanitize-address-use-after-scope: helps detecting when a variable is accessed after it has gone out of scope such as when a pointer to a local variable continues to be used after the function returns or when a reference to a variable in an inner scope is accessed after that scope ends.
  2. -fsanitize-recover=address: continues execution after error detection.
  3. -Wextra for extra warnings around operators

Ignored the sign compare flag, although did resolve warnings which were trivial. Most of the ones left arise from macro usage or are unecessary and may cause bugs. Please let me know if any changes/refactoring is needed.

@bassamadnan
bassamadnan force-pushed the asan branch 2 times, most recently from 92dcf5f to b2fd8b9 Compare April 13, 2025 08:21
@jesperpedersen
jesperpedersen self-requested a review April 13, 2025 09:07
@jesperpedersen jesperpedersen added the enhancement Improvement to an existing feature label Apr 13, 2025
@jesperpedersen

Copy link
Copy Markdown
Member

@bassamadnan CI

@bassamadnan
bassamadnan marked this pull request as draft April 13, 2025 12:04
@bassamadnan
bassamadnan force-pushed the asan branch 4 times, most recently from 1734b04 to 80a21fc Compare April 13, 2025 12:37
@jesperpedersen

Copy link
Copy Markdown
Member

@bassamadnan Remember the authors files

@bassamadnan

Copy link
Copy Markdown
Collaborator Author

@bassamadnan Remember the authors files

yes i will, resolving some of the tests . The issue is in Mac/FreeBSD systems, the attribute unused is just placed randomly(???) which makes the unused parameter warning stop at compilation (due to -Werror) there are a few ways to resolve this (change the location of ifdefs, or mark the parameters as attribute unused where they are supposed to be) I personally vouch for a refactoring to only include platform specific libraries and functions if needed, though that can be done as part of another issue i feel. I am really not sure why gcc debug is failing, i am looking into that ATM.

@jesperpedersen

Copy link
Copy Markdown
Member

@bassamadnan CI

@bassamadnan

Copy link
Copy Markdown
Collaborator Author

@bassamadnan CI

For now can I remove the '-Wextra' from mac and FreeBSD systems? I'll see what I can do for the linux gcc debug check.

@jesperpedersen

Copy link
Copy Markdown
Member

Yeah, try that

@bassamadnan
bassamadnan force-pushed the asan branch 3 times, most recently from 3294685 to 149190f Compare April 13, 2025 15:38
@bassamadnan

bassamadnan commented Apr 13, 2025 •

Copy link
Copy Markdown
Collaborator Author

@jesperpedersen I am running the tests on my fork, I can see they keep getting started under this PR too, I think you start them? I am not sure, thhis is very much appreciated. Rest assured I will inform you after I pass all tests, currently im just playing around to make it work with different solutions i can find online.

@bassamadnan
bassamadnan force-pushed the asan branch 4 times, most recently from c59bb50 to 2dbc4f5 Compare April 13, 2025 17:07
@bassamadnan

Copy link
Copy Markdown
Collaborator Author

@jesperpedersen Sorry to keep you waiting, you can review it now. Credits to everyone here. I had to specify the LD_PRELOAD and disable the verification for linking order for GCC debug run. I am not exactly sure why this error occured, I believe its because clang and gcc try to link it differently simillar to issues I ran into while resolving this for pgexporter. -Wextra is disabled for Mac and FreeBSD systems.

@bassamadnan
bassamadnan marked this pull request as ready for review April 13, 2025 17:38
@jesperpedersen
jesperpedersen merged commit 35dbb07 into pgmoneta:main Apr 13, 2025
@jesperpedersen

Copy link
Copy Markdown
Member

Merged.

Thanks for your contribution !

@jesperpedersen

Copy link
Copy Markdown
Member

@bassamadnan Please, port to pgagroal now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement to an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants