Skip to content

[SYCL][TableGen] Emit dynamic table variables as inline#22594

Open
wenju-he wants to merge 1 commit into
intel:syclfrom
wenju-he:TableGen-dynamic-table-variables-inline
Open

[SYCL][TableGen] Emit dynamic table variables as inline#22594
wenju-he wants to merge 1 commit into
intel:syclfrom
wenju-he:TableGen-dynamic-table-variables-inline

Conversation

@wenju-he

@wenju-he wenju-he commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

DynamicTableEmitter generates a plain (non-inline) global map variable in a header that is #included from multiple translation units. When those TUs end up in different shared libraries loaded into the same process, this violates the One Definition Rule: two strong definitions of DeviceConfigFile::TargetTable get double destructed at exit, causing "double free or corruption" crashes.

0bb7221 introduced non-inline global. It became a bug on 2026-04-08 with a8dff34 which moved DeviceConfigFile.hpp usage into a second shared library, libLLVMSYCLPostLink.so, creating the second strong definition.

It surfaced as a visible crash on 2026-06-12 with b09acde, which added fp8 unittest that links against sycl-jit -> pulling in both libclangDriver.so and libLLVMSYCLPostLink.so in the same process when BUILD_SHARED_LIBS=ON.

Fix many check-sycl fails in shared lib build, e.g.
SYCL-Unit :: ur/./UrTests-Non_Preview_Tests/failed_to_discover_tests_from_gtest
SYCL-Unit-Preview :: ur/Preview/./UrTests-Preview_Tests/failed_to_discover_tests_from_gtest
CMPLRLLVM-76620, CMPLRLLVM-76699

DynamicTableEmitter generates a plain (non-inline) global map variable
in a header that is #included from multiple translation units. When
those TUs end up in different shared libraries loaded into the same
process, this violates the One Definition Rule: two strong definitions
of DeviceConfigFile::TargetTable get double destructed at exit,
causing "double free or corruption" crashes.

0bb7221 introduced non-inline global. It became a bug on 2026-04-08
with a8dff34 which moved DeviceConfigFile.hpp usage into a second
shared library, libLLVMSYCLPostLink.so, creating the second strong definition.

It surfaced as a visible crash on 2026-06-12 with b09acde, which
added fp8 unittest that links against sycl-jit -> pulling in both
libclangDriver.so and libLLVMSYCLPostLink.so in the same process
when BUILD_SHARED_LIBS=ON.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@wenju-he wenju-he requested a review from a team as a code owner July 10, 2026 07:35
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