kriszyp / lmdb-js

Simple, efficient, ultra-fast, scalable data store wrapper for LMDB
Other
481 stars 39 forks source link

Segmentation fault on aarch64 Linux #188

Closed floriangosse closed 1 year ago

floriangosse commented 1 year ago

Steps to reproduce

I'm using Docker on a Linux host.

kriszyp commented 1 year ago

So far I haven't had any luck in reproducing this. I just tested this on an AWS graviton2 (with the node:16-alpine container), and not only does lmdb-js load and open dbs, but the whole unit test suite passes without issue. Any ideas of anything more specific that I might need to reproduce this?

floriangosse commented 1 year ago

I've used a t2.micro for testing.

This is how i've set it up:

# Update installed packages
sudo yum -y update

# Install amazon-linux-extras and enable some extras
sudo yum install -y amazon-linux-extras
sudo amazon-linux-extras enable docker

# Install docker and assign ec2-user to docker group
sudo yum install -y docker
sudo usermod -a -G docker ec2-user

# Start docker and make it auto-start
sudo service docker start
sudo chkconfig docker on

# Setup qemu for multiarch emulation
sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

# Install docker buildx
sudo curl --location "https://github.com/docker/buildx/releases/download/v0.9.1/buildx-v0.9.1.linux-amd64" --output "/usr/libexec/docker/cli-plugins/docker-buildx"
sudo chmod +x /usr/libexec/docker/cli-plugins/docker-buildx

After that I logged out and logged in again to be able to work with docker because of the group change and ran the comments in the original post.

kriszyp commented 1 year ago

Thank you for the detailed report, this was super helpful! I was able to easily identify the issue with this info. It turns out that this was due to a failure to set the robust setting on mutexes for platform that usually supports robust mutexes (must be some idiosyncrasy on the emulated platform), and some improper handling of that.

floriangosse commented 1 year ago

Thanks for you fast response. Do you already know in which version the fix will be made available?

kriszyp commented 1 year ago

Published the fix for this in v2.5.5. Let me know if you still have any problems with this.

floriangosse commented 1 year ago

Looks good. It didn't throw any error. :)

Thanks a lot for the quick bug fix.