-
Notifications
You must be signed in to change notification settings - Fork 49
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
sigbus illegal alignment at gf256.cpp gf256_add_mem line 790 #5
Comments
I find, if use two four bytes operation replace eight bytes operation, it will be ok. |
Just ran into this as well. You can work around this by using We decided to create a byte buffer per recovery block and call
You will likely want to do manual parameter validation as well, since |
Yes on ARM platform the start of the buffers need to be aligned to 16
bytes, so the low 4 bits of the pointer should be zero. On Intel you don't
have that restriction.
…On Thu, Feb 28, 2019, 7:36 AM Robin Nabel ***@***.*** wrote:
Just ran into this as well.
You can work around this by using cm256_encode_block instead of
cm256_encode, since cm256_encode increments the recovery block buffer by
BlockBytes (see https://github.com/catid/cm256/blob/master/cm256.cpp#L215)
which means that your BlockBytes would have to be a multiple of the
std::uint64_t in order to guarantee that the first byte of each recovery
block falls on an aligned address (i.e. if BlockBytes is 3, but your
alignment requirement is 4, your second block would start at a misaligned
address even if the first block is aligned).
We decided to create a byte buffer per recovery block and call
cm256_encode_block directly:
// Set up params and recovery_block_size.
// Create recovery count buffers, each of which will be aligned.
std::vector<std::vector<std::uint8_t>> recovery_blocks(params.RecoveryCount);
for (int block_index = 0; block_index < params.RecoveryCount; ++block_index) {
recovery_blocks[block_index].resize(recovery_block_size); // Ensure correct size of recovery buffer.
cm256_encode_block(params, blocks.data(), params.OriginalCount + block_index, recovery_blocks[block_index].data());
}
You will likely want to do manual parameter validation as well, since
cm256_encode_block doesn't do this for you.
Hope this helps :)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#5 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAPZISb2NLHJhsLo1_LTmsR0wCD6PxGrks5vR_eagaJpZM4YDiuf>
.
|
HI, I am trying to run this program at android platform.
we have define GF256_TARGET_MOBILE and GF256_TRY_NEON, and CpuHasNeon is true.
*x8^=*y8 cause sigbus illegal alignment error. is there some compile arguments must be set?
thanks very much.
The text was updated successfully, but these errors were encountered: