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

bugfix: NH::HashString Memory Violation #44

Merged
merged 4 commits into from
Aug 8, 2024

Conversation

piotrmacha
Copy link
Member

@piotrmacha piotrmacha commented Jul 31, 2024

Problem

zBassMusic was crashing in very specific conditions because NH::HashString comparison with std::hash<NH::HashString> resulted in illegal memory access.

Step 1

Replace const char* with std::string for NH::HashString Value as a temporary measure to keep its lifetime under control before larger refactoring is possible

Result

Still broken because of other parts.

Step 2

Global refactoring to completely remove NH::HashString in favor of std::string. Because such refactor already spanned the whole project, we also replaced some uses of Union::String and many classes got rid of dependency on union-api, which is the work planned for 0.4.0. Alongside implementing std::string as the base string class, we also fixed some const-correctness issues and NH:: namespace goes in the right direction.

Result

Internal smoke tests passed green. We are waiting for confirmation from the person who reported the bugs. When we get the confirmation, this part of refactoring will be released as 0.3.4 bugfix.

…s a temporary measure to keep its lifetime under control before larger refactoring is possible
@piotrmacha piotrmacha changed the title NH::HashString Memory Violation bugfix: NH::HashString Memory Violation Jul 31, 2024
Copy link
Member

@muczc1wek muczc1wek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All seems good, but without confirmation that the bug was fixed it is only an internal refactor

@piotrmacha piotrmacha merged commit 511e028 into main Aug 8, 2024
3 checks passed
This pull request was closed.
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