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

crypto: Fix segv crash after purge and reload of crypto on musl libc #7450

Merged
merged 1 commit into from
Jun 30, 2023

Conversation

sverker
Copy link
Contributor

@sverker sverker commented Jun 28, 2023

Fixes #7436

Symptom: Different kind of segv crashes seen after crypto is loaded, purged and loaded again.

Problem:
dlclose on musl libc is a no-op.

Mutex 'mtx_init_curve_types' was destroyed by unload (called at module purge) and then not re-created at reload as static variable library_initialized in crypto.c was true because musl dlclose is a no-op and dlopen reuses the existing loaded crypto.so library with static variables intact.

Symptom: Different kind of segv crashes after crypto is loaded,
purged and loaded again.

Problem:
dlclose on musl libc is a no-op.

Mutex 'mtx_init_curve_types' was destroyed at unload and then not
re-created at reload as static variable `library_initialized`
in crypto.c is true because musl dlclose is a no-op and dlopen
reuses the existing loaded crypto.so library with static variables
intact.
@sverker sverker added team:VM Assigned to OTP team VM fix labels Jun 28, 2023
@sverker sverker self-assigned this Jun 28, 2023
@github-actions
Copy link
Contributor

CT Test Results

Tests are running... https://github.com/erlang/otp/actions/runs/5402652644

Results for commit fae85c2

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

  • No CT logs found
  • No HTML docs found
  • No Windows Installer found

// Erlang/OTP Github Action Bot

@sverker sverker added the testing currently being tested, tag is used by OTP internal CI label Jun 29, 2023
@sverker sverker merged commit 8822a39 into erlang:maint Jun 30, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant