Skip to content

Conversation

augusto2112
Copy link

No description provided.

…m#152607)

The previous commit was reverted because it broke a test on the bots.

Original commit message:

By profiling LLDB debugging a Swift application without a dSYM and a
large amount of .o files, I identified that querying shared modules was
the biggest bottleneck when running "frame variable", and Clang types
need to be searched.

One of the reasons for that slowness is that the shared module list can
can grow very large, and the search through it is O(n).

To solve this issue, this patch adds a new hashmap to the shared module
list whose key is the name of the module, and the value is all the
modules that share that name. This should speed up any search where the
query contains the module name.

rdar://156753350
(cherry picked from commit bd1b1a5)
…llvm#155331)

This fixes a potential use after free where
ModuleList::RemoveSharedModuleIfOrphaned ->
SharedModuleList::RemoveIfOrphaned -> SharedModuleList::RemoveFromMap
would potentially dereference a freed pointer. This fixes it by not
calling ModuleList::RemoveSharedModuleIfOrphaned at all if the pointer
was just freed.

(cherry picked from commit 397181d)
Now that the use after free bug has been fixed (397181d), actually use
the new SharedModuleList class.

(cherry picked from commit 8523c6a)
@augusto2112
Copy link
Author

@swift-ci test

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.

1 participant