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

Problem: zsys is re-initialized when logging an error in zsys_shutdown #2086

Merged
merged 1 commit into from
Jun 12, 2020

Conversation

sappo
Copy link
Member

@sappo sappo commented Jun 12, 2020

Solution: Set the s_initialized variable to false only at the end of the
function instead of the beginning.

Fixes #2084

Solution: Set the s_initialized variable to false only at the end of the
function instead of the beginning.
@bluca
Copy link
Member

bluca commented Jun 12, 2020

The problem with initializing at the end is that you then have a race with two threads going through init at the same time, no?

@somdoron somdoron merged commit afc815e into zeromq:master Jun 12, 2020
@sappo
Copy link
Member Author

sappo commented Jun 13, 2020 via email

@bluca
Copy link
Member

bluca commented Jun 13, 2020

@bluca the issues was that the last error "Dangling socket" was asserted and not logged. Doron Somech notifications@github.com schrieb am Sa., 13. Juni 2020, 01:55:

Merged #2086 <#2086> into master. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#2086 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADYNOSRRFCHJWKTRAZFODDRWK55VANCNFSM4N4QKM6A .

Right, but the problem now is that a second thread doing shutdown at the same time will block on the mutex, and then the mutex will be destroyed under it, which is undefined behaviour, and will break things badly

@sappo
Copy link
Member Author

sappo commented Jun 13, 2020 via email

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.

zsys_shutdown() assert on zsys_error()
3 participants