Skip to content
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

Concurrency: remove workaround for silencing UB #80246

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

compnerd
Copy link
Member

The newer clang properly identifies UB on invalid pointer casts. This was previously being silenced by suppressing the warnings. Adjust the code to use std::bit_cast (or the shim implementation) to avoid the UB in this code.

@compnerd compnerd requested a review from ktoso as a code owner March 24, 2025 18:40
@compnerd
Copy link
Member Author

@swift-ci please smoke test

@compnerd
Copy link
Member Author

@swift-ci please smoke test Linux platform

1 similar comment
@compnerd
Copy link
Member Author

@swift-ci please smoke test Linux platform

@compnerd
Copy link
Member Author

@swift-ci please smoke test macOS platform

@compnerd
Copy link
Member Author

@swift-ci please smoke test Linux platform

@compnerd
Copy link
Member Author

@swift-ci please smoke test macOS platform

2 similar comments
@compnerd
Copy link
Member Author

@swift-ci please smoke test macOS platform

@compnerd
Copy link
Member Author

@swift-ci please smoke test macOS platform

@kubamracek
Copy link
Contributor

macOS failures:

Failed Tests (3):
  Swift(macosx-x86_64) :: embedded/dependencies-concurrency-custom-executor.swift
  Swift(macosx-x86_64) :: embedded/dependencies-concurrency.swift
  Swift(macosx-x86_64) :: embedded/dependencies-concurrency2.swift

are because we gained a "memcpy" dependency:

******************** TEST 'Swift(macosx-x86_64) :: embedded/dependencies-concurrency-custom-executor.swift' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
___assert_rtn
___stack_chk_fail
___stack_chk_guard
_abort
_clock_gettime
_exit
_free
_malloc
_memcpy
_memmove
_memset_s
_posix_memalign
_putchar
_puts
_strlen
_strncpy
_vprintf
_vsnprintf
...
+ test -z _memcpy

Adding "memcpy" to the allowlist of deps should resolve it.

@compnerd
Copy link
Member Author

Is there a reason that these tests are macOS only?

The newer clang properly identifies UB on invalid pointer casts. This
was previously being silenced by suppressing the warnings. Adjust the
code to use `std::bit_cast` (or the shim implementation) to avoid the
UB in this code.
@compnerd compnerd force-pushed the playing-with-pointy-pointers branch from ae20170 to 87f2b88 Compare March 27, 2025 15:27
@compnerd
Copy link
Member Author

@swift-ci please smoke test

@compnerd compnerd enabled auto-merge March 27, 2025 15:27
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.

2 participants