Skip to content

conn: Ensure 64-bit alignment for atomics on 32-bit platforms#199

Merged
johnweldon merged 1 commit intogo-ldap:masterfrom
Psychotropos:bugfix/atomic-alignment
Dec 1, 2018
Merged

conn: Ensure 64-bit alignment for atomics on 32-bit platforms#199
johnweldon merged 1 commit intogo-ldap:masterfrom
Psychotropos:bugfix/atomic-alignment

Conversation

@Psychotropos
Copy link

@Psychotropos Psychotropos commented Dec 1, 2018

Summary

As it currently stands, there is no guarantee that the requestTimeout variable on a Conn structure is going to be aligned to a 64-bit boundary. As golang/go#599 is not fixed as of yet, it is still the caller's responsibility to ensure that is the case.

This pull request should resolve issues #185 and #195 by moving requestTimeout to the very beginning of the structure. The alternative would be to manually pad the structure, and that offers no guarantees of no regression occurring due to the length of the structure changing in future versions.

@johnweldon johnweldon merged commit 412981c into go-ldap:master Dec 1, 2018
@johnweldon
Copy link
Member

Thank you!

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