oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.18k stars 2.68k forks source link

Fails loading bcrypt_lib.node with Segmentation fault on Alpine x64 with sgerrand's glibc #10047

Open alxivnov opened 5 months ago

alxivnov commented 5 months ago

What version of Bun is running?

1.1.2+c8d072c2a

What platform is your computer?

Linux 5.15.0-94-generic x86_64 unknown

What steps can reproduce the bug?

Import bcrypt on a x64 Alpine and call it's hash method.

let bcrypt = require('bcrypt');
bcrypt.hash('123', 1, (err, hash) => console.log(err, hash));

What is the expected behavior?

Bcrypt should be able to be used.

What do you see instead?

Segmentation fault (core dumped) happens.

Additional information

Снимок экрана 2024-04-07 в 20 23 43 Снимок экрана 2024-04-07 в 20 23 54
Electroid commented 5 months ago

I assume you're running this using the bun:alpine Docker image? If so, looks like we need to change the glibc we're using there.

alxivnov commented 5 months ago

I assume you're running this using the bun:alpine Docker image? If so, looks like we need to change the glibc we're using there.

I was in fact using my own image. But on even/bun:alpine I get libstdc++.so.6: cannot open shared object file: No such file or directory.

Снимок экрана 2024-04-13 в 21 20 38

And solution is to add api add libstdc++.

Снимок экрана 2024-04-13 в 21 25 38
alxivnov commented 5 months ago

Additional x64 test results:

Alpine Glibc Result
3.19 any Segmentation fault
3.18 2.35-r1 Error relocating /lib/ld-linux-x86-64.so.2: unsupported relocation type 37
3.18 2.34-r0 Success