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

wrk under aarch64 (ARM64) fails #5291

Closed
tobbik opened this issue May 13, 2020 · 2 comments
Closed

wrk under aarch64 (ARM64) fails #5291

tobbik opened this issue May 13, 2020 · 2 comments
Labels
bug report Something is not working properly

Comments

@tobbik
Copy link

tobbik commented May 13, 2020

Running wrk on an ARM-64 platform(ASUS C101) gives bus error
The error could be reproduced on a Raspberry pi4 under ArchLinuxARM64. It is descriped upstream and has an existing pull request upstream: wg/wrk@e2ab808

Steps to reproduce
Run wrk on a ARM-64 hardware against a known server. On my C101 wrk -t 4 -c 10 -d 5 http://www.google.com fails repeatedly.

Expected behavior
It should run without the bus error.

Additional information
I used below patch (copied from the pull request) and compiled it on ARM-64, ARM-32 and x86-64 and it worked without problems. it wouldn't allow to add this patch as attachement so I c'np it here

diff -ur wrk-4.1.0-orig/src/zmalloc.c wrk-4.1.0/src/zmalloc.c
--- wrk-4.1.0-orig/src/zmalloc.c	2020-05-07 01:47:50.562052028 +0000
+++ wrk-4.1.0/src/zmalloc.c	2020-05-07 01:48:12.281671231 +0000
@@ -45,13 +45,19 @@
 #include "zmalloc.h"
 #include "atomicvar.h"
 
+#ifdef _LP64
+#define ALIGMENT (16)
+#else
+#define ALIGMENT (8)
+#endif
+#define ROUND_UP(n,r) (((n + r - 1) / r ) * r)
 #ifdef HAVE_MALLOC_SIZE
 #define PREFIX_SIZE (0)
 #else
 #if defined(__sun) || defined(__sparc) || defined(__sparc__)
-#define PREFIX_SIZE (sizeof(long long))
+#define PREFIX_SIZE (ROUND_UP(sizeof(long long), ALIGMENT))
 #else
-#define PREFIX_SIZE (sizeof(size_t))
+#define PREFIX_SIZE (ROUND_UP(sizeof(size_t), ALIGMENT))
 #endif
 #endif
 
@ghost ghost added the bug report Something is not working properly label May 13, 2020
ghost pushed a commit that referenced this issue May 13, 2020
Apply patch suggested in issue #5291.
@ghost
Copy link

ghost commented May 14, 2020

Should be fixed in 4.1.0-2. Try pkg upgrade.

@ghost ghost closed this as completed May 14, 2020
@tobbik
Copy link
Author

tobbik commented May 14, 2020

Thank you, confirmed to work on ASUS C101 (armv8l).

@ghost ghost locked and limited conversation to collaborators Oct 9, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug report Something is not working properly
Projects
None yet
Development

No branches or pull requests

1 participant