Skip to content

Remove dlsym() lookup for TSan functions from common path #36478

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

Merged
merged 2 commits into from
Apr 6, 2021
Merged

Conversation

yln
Copy link
Contributor

@yln yln commented Mar 18, 2021

Move TSan function lookup via dlsym() out of the common path. The
TSan runtime will now call __tsan_on_initialize() which we can use to
initialize the TSan functions in the Swift runtime.

This avoids paying the cost of dlsym() in the common, non-TSan case.

Depends on: https://reviews.llvm.org/D98810

rdar://7549337

@yln yln self-assigned this Mar 18, 2021
Copy link
Contributor

@mikeash mikeash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love deleting code.

@yln yln changed the title Remove initialization of TSan functions via dlsym() Remove dlsym() lookup for TSan functions from common path Mar 23, 2021
Julian Lettner added 2 commits March 23, 2021 16:51
Move TSan function lookup via `dlsym()` out of the common path.  The
TSan runtime will now call `__tsan_on_initialize()` which we can use to
initialize the TSan functions in the Swift runtime.

This avoids paying the cost of `dlsym()` in the common, non-TSan case.

Depends on: https://reviews.llvm.org/D98810

rdar://75493372
Thread Sanitizer is not supported on Windows.
@yln
Copy link
Contributor Author

yln commented Apr 1, 2021

@swift-ci Please test and merge

@yln
Copy link
Contributor Author

yln commented Apr 1, 2021

Only unrelated tests failed:

23:55:25 Failed Tests (5):
23:55:25   lldb-api :: lang/swift/array_tuple_resilient/TestSwiftArrayTupleResilient.py
23:55:25   lldb-api :: lang/swift/generic_objcclasswrapper/TestGenericObjcClassWrapper.py
23:55:25   lldb-api :: lang/swift/swiftieformatting/TestSwiftieFormatting.py
23:55:25   lldb-shell :: SwiftREPL/ResilientArray.test
23:55:25   lldb-shell :: SwiftREPL/ResilientDict.test

@yln
Copy link
Contributor Author

yln commented Apr 1, 2021

@swift-ci Please smoke test and merge

@yln
Copy link
Contributor Author

yln commented Apr 1, 2021

Same unrelated tests are still failing:

13:10:13 Failed Tests (5):
13:10:13   lldb-api :: lang/swift/array_tuple_resilient/TestSwiftArrayTupleResilient.py
13:10:13   lldb-api :: lang/swift/generic_objcclasswrapper/TestGenericObjcClassWrapper.py
13:10:13   lldb-api :: lang/swift/swiftieformatting/TestSwiftieFormatting.py
13:10:13   lldb-shell :: SwiftREPL/ResilientArray.test
13:10:13   lldb-shell :: SwiftREPL/ResilientDict.test

@yln
Copy link
Contributor Author

yln commented Apr 1, 2021

@gottesmm Can we merge this?

@yln
Copy link
Contributor Author

yln commented Apr 2, 2021

@swift-ci Please smoke test and merge

@yln
Copy link
Contributor Author

yln commented Apr 2, 2021

macOS failures:

13:26:16 Cloning the remote Git repository
13:26:16 Cloning repository [email protected]:apple/swift.git
13:26:16  > git init /Users/buildnode/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/swift # timeout=10
13:26:16 ERROR: Error cloning remote repo 'origin'

Linux failures:

14:00:54 Failed Tests (1):
14:00:54   Swift(linux-x86_64) :: AutoDiff/compiler_crashers_fixed/rdar71191415-nested-differentiation-of-extension-method-optimized.swift

@yln
Copy link
Contributor Author

yln commented Apr 2, 2021

@swift-ci Please smoke test and merge

@yln
Copy link
Contributor Author

yln commented Apr 2, 2021

macOS build failure:

15:23:43  > git rev-parse --is-inside-work-tree # timeout=10
15:23:43 ERROR: Workspace has a .git repository, but it appears to be corrupt.

@yln
Copy link
Contributor Author

yln commented Apr 2, 2021

@swift-ci Please smoke test macOS

1 similar comment
@yln
Copy link
Contributor Author

yln commented Apr 5, 2021

@swift-ci Please smoke test macOS

@yln
Copy link
Contributor Author

yln commented Apr 5, 2021

Unrelated macOS failure:

11:18:18 Failed Tests (1):
11:18:18   Swift(macosx-x86_64) :: IDE/complete_from_stdlib.swift

@yln
Copy link
Contributor Author

yln commented Apr 5, 2021

@swift-ci Please smoke test macOS

@yln
Copy link
Contributor Author

yln commented Apr 5, 2021

Unrelated macOS failures:

Failed Tests (2):
  Swift(macosx-x86_64) :: Driver/Dependencies/dependencies-preservation-fine.swift
  Swift(macosx-x86_64) :: Driver/Dependencies/one-way-merge-module-fine.swift

@yln
Copy link
Contributor Author

yln commented Apr 5, 2021

@shahmishal @gottesmm Can we merge this? I don't know what to do anymore.

@shahmishal
Copy link
Member

@swift-ci Please smoke test macOS

@shahmishal
Copy link
Member

#36760

@mikeash
Copy link
Contributor

mikeash commented Apr 6, 2021

That was an ordeal. Quick, click Merge before something else happens.

@yln yln merged commit e1b82d8 into main Apr 6, 2021
@yln yln deleted the tsan-remove-dlsym branch April 6, 2021 16:16
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

Successfully merging this pull request may close these issues.

3 participants