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

Fixed-width hexadecimal encodings perform unaligned writes #184

Closed
andrewthad opened this issue Sep 22, 2019 · 6 comments
Closed

Fixed-width hexadecimal encodings perform unaligned writes #184

andrewthad opened this issue Sep 22, 2019 · 6 comments
Labels
blocked: patch-needed somebody needs to write a patch or contribute code bug

Comments

@andrewthad
Copy link
Contributor

word8FixedHex and friends perform unaligned writes to their buffer. While this is fine on x86, I believe this would cause crashes on ARM.

@hvr hvr added the blocked: patch-needed somebody needs to write a patch or contribute code label Dec 19, 2019
@hvr
Copy link
Member

hvr commented Dec 19, 2019

There's certainly merit in having additional aligned-write codepaths for platforms which may run into unalignment-faults which can either crash the process as you suggest or suffer a significant performance penalty. I do recall that Duncan has been suggesting for quite some time for GHC to be taught about having more primitives in its APIs dealing with unaligned/aligned writes more explicitly.

@andrewthad
Copy link
Contributor Author

ghc-prim already provides primitives for unaligned writes, both to Addr# and the ByteArray#. So, nothing new is needed there. I can prepare something to address this issue.

@sjakobi
Copy link
Member

sjakobi commented Dec 19, 2019

#133 seems somewhat related, since it's also about unaligned writes.

@sjakobi sjakobi added the bug label Jun 25, 2020
@Bodigrim
Copy link
Contributor

@andrewthad a patch would be highly appreciated, especially considering an advent of Apple M1.

@Bodigrim
Copy link
Contributor

Given that all our CI builds, including ARM both 32 and 64 bits, work fine, I'd like to close this, unless there is a reproducible evidence of the issue.

@andrewthad
Copy link
Contributor Author

I looked at the code again. I had misread when I originally opened this issue. I do not believe this is actually a problem. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: patch-needed somebody needs to write a patch or contribute code bug
Projects
None yet
Development

No branches or pull requests

4 participants