Closed chengguizi closed 1 year ago
Hi @chengguizi,
Thanks for reporting this and especially for providing the sourcecode. That should make it easy for us to reproduce and debug the issue. But are you sure, you are running on ARM 64, as you mentioned? One of the error messages clearly states x86 and a quick google search told me that the "Vostro-5320" has a regular Intel processor, as well.
Kind regards Florian
Ahh sorry. I run both on ARM64 and AMD64. Tested on both platforms!
Hi, just to check in, are you guys able to reproduce on your end?
Hi @chengguizi,
I didn't try to reproduce it, yet, but I checked the source code to see what could cause the alignment issue. I think it is the following line:
with:
ecal_magic = 4
sizeof(uint16_t) = 2
header_size =
length of additional protobuf headerAfter the header consisting of those 3 parts (ecal_magic, header_length, proto_header), the user payload is directly appended. There is no padding, so basically the capnproto data is never aligned. It should be easy to add some padding, but we need to make sure, that the proto header can still be parsed.
Ok! That makes sense :)
@chengguizi : I created a fix that should solve this issue. It is 100% compatible, but that also makes it ugly, unfortunately. Would you be able to test it out and report back, if it fixes the issue for you?
Here is the branch: https://github.com/eclipse-ecal/ecal/tree/feature/tcp_payload_alignment
@chengguizi: the branch was accidentally merged to master, already. Could you maybe still test it?
Hi @FlorianReimold Thanks for the effort in fixing it! May I know what is the best way to test this? I have been using binaries all along.
Do I have to uninstall the binary, compile the branch from source, and then install to the system in order to test?
Can you grab the binary from our CI? You need to be logged in with your GitHub accout, but then you should be able to just download a zip file ubuntu-debian
containing the eCAL .deb installer. Here is a link to the Ubuntu 20.04 build:
https://github.com/eclipse-ecal/ecal/actions/runs/4627122057
It's only for amd64, as the arm binaries only come from the launchpad PPA. I hope that's ok.
After unzipping, you can install it with:
sudo dpkg -i eCAL-5.12.0-Linux.deb
.
When you later want to go back to the Version coming from our ppa, you can just remove the installed eCAL and install it with apt
again:
sudo apt remove ecal
sudo apt install ecal
@chengguizi @FlorianReimold can this issue be closed?
Yes, let's close it. I hoped that chengguizi would try out the fix, but he didn't.
Problem Description
I run in to this issue on the receiver side, when I am in TCP mode
After a few debugging steps, I have single out the line that raise this issue, which is
initMessageBuilderFromFlatArrayCopy
which checks for memory alignment I suppose.This leads me to believe eCAL didn't perform proper memory alignment of the buffer memory. This seems not happening always, but a lot of times.
How to reproduce
First, compile and run https://github.com/chengguizi/ecal/tree/memory-unaligned-tcp/samples/cpp/capnp/addressbook_snd
Second, compile and run https://github.com/chengguizi/ecal/tree/memory-unaligned-tcp/samples/cpp/capnp/addressbook_rec_cb
Maybe need the following lines in CMakeLists.txt
How did you get eCAL?
Ubuntu PPA (apt-get)
Environment
Ubuntu 20.04 ARM64
eCAL System Information