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

use memcpy on unaligned pointer to avoid crash on armv7 (BUS_ADRALN) #1959

Merged
merged 3 commits into from
Nov 30, 2018

Conversation

hgourvest
Copy link

There is a crash in zhash_pack method when writting the 4 bytes corresponding to value length, to unaligned pointer address, this occur on Android armv7. I solve the problem using memcpy instead.

@hgourvest
Copy link
Author

probably same problem on zlistx_pack and zhashx_pack_own

Henri Gourvest added 2 commits November 30, 2018 08:58
use memcpy on unaligned pointer to avoid crash on armv7 (BUS_ADRALN)
avoid unnecessary calls to strlen
@sappo
Copy link
Member

sappo commented Nov 30, 2018

Thanks for your contribution :)

memcopy has been used before. Due to your refactoring I find it hard to get the actual change. Can you please point me to the correct code lines.

P. S. for future commits please use the problem solution Formular described in our contribution and style guidelines. Also see the commit history for examples

@sappo sappo merged commit bca0888 into zeromq:master Nov 30, 2018
@sappo
Copy link
Member

sappo commented Nov 30, 2018

Ah got it after all.

@hgourvest
Copy link
Author

[zhash] before: 704 after: 706
[zhashx] before: 822 after: 824
[zlistx] before: 674 after: 675

sorry for the spaces, Android studio automatically remove unncecessary space :/

@sappo
Copy link
Member

sappo commented Nov 30, 2018 via email

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