-
Notifications
You must be signed in to change notification settings - Fork 181
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
Testsuite crashes with "Bus error" on sparc64 due to bad alignment #835
Comments
Here is the backtrace:
|
It looks like the code is using custom functions to convert between big end little endianness. I suggest switching to the endianness functions provided by the glibc. |
OK, I replaced the custom byte-swap functions with the ones provided by glibc and the crash persists which means that the parameter itself is already misaligned:
|
I tried the following change in the hope that --- diamond-aligner-2.1.9.orig/src/util/binary_buffer.h
+++ diamond-aligner-2.1.9/src/util/binary_buffer.h
@@ -41,7 +41,8 @@ struct BinaryBuffer : public std::vector
void read(T &x)
{
check(sizeof(T));
- x = *(T*)(&*ptr_);
+ //x = *(T*)(&*ptr_);
+ memcpy(&x, &*ptr_, sizeof(T));
ptr_ += sizeof(T);
}
template<typename T> Currently out of ideas. |
I'll try to look into it but I don't have access to a sparc64 system so it may not be that easy. |
On Oct 20, 2024, at 2:26 PM, Benjamin Buchfink ***@***.***> wrote:
I'll try to look into it but I don't have access to a sparc64 system so it may not be that easy.
There is a sparc64 machine running Solaris 11.4 in the GCC Compile Farm which can be accessed by anyone who requests an account for the GCC Compile Farm.
I can also help provide access to Linux on sparc64.
|
Your idea was right but the problem also occurs in Deserializer::read. Plenty of other alignment-related issues in the code. I believe I tracked all of them down and will include this in the next release. |
Okay, thanks a lot for looking into this. Much appreciated! |
The testsuite crashes on sparc64 with a "Bus error" which is usually an indicator for unaligned access:
This is most likely related to the discussion in #778 and I assume that fixing the crash on sparc64 will also fix the issue reported by @tamdao216.
The text was updated successfully, but these errors were encountered: