Skip to content

Fix asan/TestCases/Darwin/scrible.cpp to work on platforms where `l… #3237

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 1 commit into from
Sep 9, 2021

Conversation

delcypher
Copy link

…ong` is not 64-bits.

Previously the test was failing on platforms where long was less than
64-bits wide (e.g. older WatchOS simulators and arm64_32) because the
padding field was too small.

The test currently relies on the my_object->isa being scribbled or
left unmodified after my_object is freed. However, this was not the
case because the isa pointer intersected with
ChunkHeader::free_context_id. free_context_id starts at the
beginning of user memory but it only initialized once the memory is
freed. This caused the isa pointer to change after it was freed
leading to the test crashing.

To fix this the padding field has been made explicitly 64-bits wide
(same size as ChunkHeader::free_context_id).

rdar://75806757

Differential Revision: https://reviews.llvm.org/D109409

(cherry picked from commit 7184114)

…ong` is not 64-bits.

Previously the test was failing on platforms where `long` was less than
64-bits wide (e.g. older WatchOS simulators and arm64_32) because the
`padding` field was too small.

The test currently relies on the `my_object->isa` being scribbled or
left unmodified after `my_object` is freed. However, this was not the
case because the `isa` pointer intersected with
`ChunkHeader::free_context_id`.  `free_context_id` starts at the
beginning of user memory but it only initialized once the memory is
freed. This caused the `isa` pointer to change after it was freed
leading to the test crashing.

To fix this the `padding` field has been made explicitly 64-bits wide
(same size as `ChunkHeader::free_context_id`).

rdar://75806757

Differential Revision: https://reviews.llvm.org/D109409

(cherry picked from commit 7184114)
@delcypher
Copy link
Author

@swift-ci Please smoke test macOS platform

@delcypher
Copy link
Author

@swift-ci Please test macOS platform

@natecook1000 natecook1000 merged commit d758d3c into stable/20210726 Sep 9, 2021
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