lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

[Bug]: Segmentation fault on Raspberry Pi 5 from 0.19.9 onwards.

Open renegadespork opened this issue 8 months ago • 3 comments

Requirements

  • [x] Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support or the matrix chat.
  • [x] Did you check to see if this issue already exists?
  • [x] Is this only a single bug? Do not put multiple bugs in one issue.
  • [x] Do you agree to follow the rules in our Code of Conduct?
  • [x] Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Summary

While trying to resolve this, I stumbled across this closed issue, which describes exactly what I encountered when running version 0.19.11 on a Raspberry Pi 5. While this was fixed in 0.19.8, It appears there was some regression in version 0.19.9 that caused this issue to reappear.

I am able to start the container by changing the entry-point, but when I docker exec in and try to run lemmy_server directly, I get a segmentation fault. I went back and tested every 0.19.x version until I got back to 0.19.8 and it was resolved.

Steps to Reproduce

docker run --rm -it --entrypoint /bin/bash dessalines/lemmy:0.19.9 ./usr/local/bin/lemmy_server

Repeat for 0.19.10, 0.19.11

Technical Details

Raspbery Pi 5

cat /proc/version: Linux version 6.1225+rpt-rpi-2712 ([email protected]) (aarch64-linux-gnu-gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT Debian 1:6.12.25-1+rpt1 (2025-04-30)

Version

0.19.11

Lemmy Instance URL

No response

renegadespork avatar May 19 '25 06:05 renegadespork

Seems like you have the wrong kernel as mentioned here.

Nutomic avatar May 19 '25 09:05 Nutomic

this issue was also recently brought up on matrix, it seems likely that this is a result of the memory allocator change in 0.19.9 (#5378, backported in cee6975d590e2061d90a5be98d636dac044f469d), which seems to have broken compatibility with 16k page size.

it would be good to include that in the docs somewhere and maybe even adjust the release notes for 0.19.9 to mention this.

Nothing4You avatar May 19 '25 10:05 Nothing4You

Feel free to make a PR for the release notes: https://github.com/LemmyNet/joinlemmy-site/blob/main/src/assets/news/2025-02-10%20-%20Lemmy%20Release%20v0.19.9.md

You can test if the allocator is at fault by compiling with these two lines commented out. From what I found neither jemalloc nor mimalloc properly support different page sizes. The default allocator has another problem with memory fragmentation after long runtime, so there seems to be no perfect option.

Nutomic avatar May 19 '25 12:05 Nutomic

FYI, I did some testing today, and this issue is not fixed. It is still present in version 0.19.12.

renegadespork avatar Sep 06 '25 17:09 renegadespork

@renegadespork The fix to use mimalloc only on x86 is not in 0.19.12 so please try with 0.19.13-beta.1 instead.

Nutomic avatar Sep 08 '25 08:09 Nutomic

Sorry for the delay on this. I just tested with the 0.19.13 release, and it seems to be working normally! It even gracefully upgraded straight from 0.19.8 to 0.19.13 without a fuss.

Thanks! 💜

renegadespork avatar Oct 10 '25 06:10 renegadespork