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

capi: fix capi_test with ASAN (#1881) #2576

Merged
merged 1 commit into from
Dec 12, 2024
Merged

capi: fix capi_test with ASAN (#1881) #2576

merged 1 commit into from
Dec 12, 2024

Conversation

battlmonstr
Copy link
Contributor

@battlmonstr battlmonstr commented Dec 10, 2024

Problem:
Linking silkworm_node.lib to both silkworm_capi.dll and silkworm_capi_test.exe produces 2 sets of global data (identical symbols),
which is a conflict according to ASAN ODR:
https://github.com/google/sanitizers/wiki/AddressSanitizerOneDefinitionRuleViolation

Solution:
Build silkworm_capi_static.lib separately, and use it with silkworm_capi_static_test.exe and capi/execute.exe so
that the linker can resolve duplicate symbols.

fixes #1881

@battlmonstr battlmonstr changed the title capi: enable capi_test with ASAN (#1881) capi: fix capi_test with ASAN (#1881) Dec 10, 2024
@battlmonstr battlmonstr requested a review from canepat December 11, 2024 08:29
@battlmonstr battlmonstr marked this pull request as ready for review December 11, 2024 08:29
@battlmonstr battlmonstr enabled auto-merge (squash) December 11, 2024 08:31
Problem:
Linking silkworm_node.lib to both silkworm_capi.dll and silkworm_capi_test.exe produces 2 sets of global data (identical symbols),
which is a conflict according to ASAN ODR:
https://github.com/google/sanitizers/wiki/AddressSanitizerOneDefinitionRuleViolation

Solution:
Build silkworm_capi_static.lib separately, and use it with silkworm_capi_static_test.exe and capi/execute.exe so
that the linker can resolve duplicate symbols.
@canepat canepat added the maintenance Some maintenance work (fix, refactor, rename, test...) label Dec 12, 2024
@battlmonstr battlmonstr merged commit f7078cf into master Dec 12, 2024
5 checks passed
@battlmonstr battlmonstr deleted the pr/1881_debug branch December 12, 2024 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Some maintenance work (fix, refactor, rename, test...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

silkworm_capi_test ODR violation in ASAN build
2 participants