Skip to content

Re-introduce GVL unlock#260

Merged
tenderlove merged 2 commits into
bcrypt-ruby:masterfrom
nwjsmith:unlock-gvl
May 13, 2022
Merged

Re-introduce GVL unlock#260
tenderlove merged 2 commits into
bcrypt-ruby:masterfrom
nwjsmith:unlock-gvl

Conversation

@nwjsmith
Copy link
Copy Markdown
Contributor

@nwjsmith nwjsmith commented Apr 29, 2022

Re-introduce @tenderlove's change from e1320b0 but with a fix for the bug causing bad hashes on Linux. The original patch was incorrectly copying the data struct into the string returned by the function.

Tested and working on both macOS and Linux.

Also, re-introduce a free that was clobbered by the revert of the original change.

This was clobbered in the revert.
Re-introduce the change from e1320b0 but with a fix for the bug causing
bad hashes on Linux. The original patch was incorrectly copying the
`data` struct into the string returned by the function.
@tjschuck tjschuck requested a review from tenderlove April 29, 2022 22:27
@nwjsmith
Copy link
Copy Markdown
Contributor Author

I've been digging in to figure out why @tenderlove's original change worked on macOS but not Linux, and while I'm not quite to the bottom of it, on macOS crypt_ra is always putting 61 into size, but 32768 (32kb) on Linux.

@nwjsmith
Copy link
Copy Markdown
Contributor Author

nwjsmith commented May 12, 2022

So I'm not very experienced with the Ruby extension toolchain, but I'm pretty certain the gem links against the system's libcrypt when present. The tests on the original commit pass on Alpine Linux, which doesn't have libcrypt, but fail on Debian which has libcrypt.

@nwjsmith
Copy link
Copy Markdown
Contributor Author

@tenderlove let me know if you need any other information in order to review this. I think the libcrypt linking might indicate a different issue in bcrypt-ruby, but I can work on that separately.

Copy link
Copy Markdown
Collaborator

@tenderlove tenderlove left a comment

Choose a reason for hiding this comment

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

LGTM. Lets try it and see what happens!

@tenderlove tenderlove merged commit a7e873c into bcrypt-ruby:master May 13, 2022
@nwjsmith nwjsmith deleted the unlock-gvl branch May 13, 2022 20:38
@nwjsmith nwjsmith mentioned this pull request May 16, 2022
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