-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[build-script] Add support for compiling swift with leaks sanitizer. #10504
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
Conversation
@swift-ci python lint |
@swift-ci smoke test |
utils/build-script
Outdated
@@ -2018,6 +2027,11 @@ iterations with -O", | |||
parser.add_argument( | |||
"--enable-tsan-runtime", | |||
help="enable Thread Sanitizer on the swift runtime") | |||
parser.add_argument( | |||
"--enable-lsan", | |||
help="enable Leaks Sanitizer for swift tools", |
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.
nit: should be "Leak Sanitizer"
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.
I will fix in a follow up 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.
I ran into a python lint issue, so I addressed your comment in the updated commit where I also fixed the python lint issues.
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.
Looks like there are still a few cases of "Leaks" instead of "Leak" ("Leak" is the existing clang convention).
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.
@fjricci To be honest, if this is an issue, I think I need to also make a small LLVM change since I called the flag their Leaks as well. Your thoughts?
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.
Hrm. I don't have strong opinions about it if it's going to be a pain to change. It's pretty consistently Leak across llvm currently, but I also don't think it's necessarily a big deal.
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.
It won't be a big deal. Consistency is important.
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.
I have a few other things to take care of today, so I am going to loop back around.
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.
Sounds good.
This only enables the swift compiler (not its output) to be used with leaks sanitizer on linux. Some important notes: On Linux, right now we are not completely leak clean. I was only able to get a -Onone build of the stdlib without triggering lsan (I was unable to run the optimizer and the tests successfully). Additionally even at -Onone, I had to suppress some leaks in the driver. The point of this though is to prevent any further -Onone leaks from being committed to the tree since -Onone leaks that are not bounded (unlike the driver bugs) could cause SourceKit to leak memory. Since SourceKit is a long running process... such a type of leak would be bad. rdar://32876901
@swift-ci smoke test and merge |
1 similar comment
@swift-ci smoke test and merge |
This only enables the swift compiler (not its output) to be used with leaks
sanitizer on linux.
Some important notes: On Linux, right now we are not completely leak clean. I
was only able to get a -Onone build of the stdlib without triggering lsan (I was
unable to run the optimizer and the tests successfully). Additionally even at
-Onone, I had to suppress some leaks in the driver. The point of this though is
to prevent any further -Onone leaks from being committed to the tree since
-Onone leaks that are not bounded (unlike the driver bugs) could cause SourceKit
to leak memory. Since SourceKit is a long running process... such a type of leak
would be bad.
rdar://32876901