Gitea: Segmentation Fault on Raspbian 10 with Raspberry 4

Created on 3 Oct 2019  路  19Comments  路  Source: go-gitea/gitea

  • Gitea version (or commit ref): 1.9.3
  • Git version: 2.20.1
  • Operating system: Raspbian 10
  • Database (use [x]):

    • [ ] PostgreSQL

    • [ ] MySQL

    • [ ] MSSQL

    • [ ] SQLite

  • Can you reproduce the bug at https://try.gitea.io:

    • [ ] Yes (provide example URL)

    • [ ] No

    • [x] Not relevant

  • Log gist:

Description

Raspberry Pi 4 with Raspbian 10.
When I launch ./gitea I got "Segmentation Fault"

Used build: arm-6 downloaded from here: https://dl.gitea.io/gitea/1.9.3/gitea-1.9.3-linux-arm-6 .
...

Screenshots

N.A.

edit: I got the error just trying to do ./gitea web after I downloaded the file without doing any kind of configuration.
On my Odroid XU4 with DietPi the same operation works without any error.

edit 2 : the same error appears with Archlinux for Raspi 4. I'll do a gdb and I'll post the results in a gist

edit 3: sooo, after I installed git, I run under gdb and everything works. But when I execute outside gdb I got segmentation fault. I have a "core dump", who arch linux made. Here the dump: https://drive.google.com/open?id=1oP0KpZO4WfGo0lNk6cs45xAwgRP8w_Sp

Most helpful comment

The problem is related to the kernel version you are using.
On my pi running kernel version: 4.19.66-v7+ gitea is working without problems. The other two pi麓s - where gitea gave the "segmentation fault" - are running kernel version: 4.19.75-v7+.

You can check it with following commands:
cat /proc/version
OR
uname -a

Therefore the workaround for the issue would be to go back to the old kernel version:
sudo apt reinstall raspberrypi-kernel=1.20190819-1 raspberrypi-bootloader=1.20190819-1

After the installation you need to reboot the pi.

Release information can be found at raspberrypi kernel project repo.

All 19 comments

Still incomplete. Any logs from your Pi system before segfault?

No logs at all. Is there a method to debug the error?
edit: I got the error just trying to do ./gitea web after I downloaded the file without doing any kind of configuration.

On my Odroid XU4 with DietPi the same operation works without any error.

The same error happens with the binary from 1.7.3 tested on a newley installed raspberrypi.

@steubner Now I'm making another SD card with arch for raspi 4 and I'll update the main message.

last update:
after I installed git, I run gitea under gdb and everything works. But when I execute outside gdb I got segmentation fault. I have a "core dump", who arch linux made. Here the dump: https://drive.google.com/open?id=1oP0KpZO4WfGo0lNk6cs45xAwgRP8w_Sp

The core file is useless to us without the whole environment (hardware, binaries) where it was run. But you can open it with gdb nonetheless and check it yourself. I think the syntax is something like:

gdb gitea core.xxxxxx
$ where

That should give you the stack trace of the function where the core was generated in text format. That we can use. :grin:

The core file is useless to us without the whole environment (hardware, binaries) where it was run. But you can open it with gdb nonetheless and check it yourself. I think the syntax is something like:

gdb gitea core.xxxxxx
$ where

That should give you the stack trace of the function where the core was generated in text format. That we can use. 馃榿

Hi,
here the results:

Core was generated by `/home/alarm/gitea'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0118d598 in brk ()
warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts
of file /home/alarm/gitea.
Use `info auto-load python-scripts [REGEXP]' to list them.
(gdb) where
#0  0x0118d598 in brk ()
#1  0x01167c14 in sbrk ()
#2  0x01140378 in __libc_setup_tls ()
#3  0x0113ff2c in __libc_start_main ()
#4  0x0001022c in _start ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

brk() is a linux system function that allocates space in memory. Your problem seems to happen way before the first line of Gitea code is ran, during libc initialization. Why it seemed to work from within gdb I don't know, but perhaps the running conditions where not exactly the same.

My guess is that there's something wrong with the linux libraries you have installed (e.g. a version mismatch). For example, you may have more than one version of the same library and Gitea is using "the wrong one" because its PATH variable is different or has different permissions (not as likely).

This is a fresh mint installation of archlinux for arm and raspbian 10.

Any ideas?

Edit : gitea was executed as root

Besides the point that Gitea should not be ran as root (for obvious security reasons and unrelated to your problem) unfortunately I know very little about the raspbian environment (only what's generic to all Unixes). So, let's hope somebody else with more experience in that area can step in.

If it may give you any pointers, the problem seems to be related with the allocation for TLS functions:

https://github.molgen.mpg.de/git-mirror/glibc/blob/20003c49884422da7ffbc459cdeee768a6fee07b/csu/libc-tls.c#L105

But it may well be that memory was corrupted before that function is called.

The problem is related to the kernel version you are using.
On my pi running kernel version: 4.19.66-v7+ gitea is working without problems. The other two pi麓s - where gitea gave the "segmentation fault" - are running kernel version: 4.19.75-v7+.

You can check it with following commands:
cat /proc/version
OR
uname -a

Therefore the workaround for the issue would be to go back to the old kernel version:
sudo apt reinstall raspberrypi-kernel=1.20190819-1 raspberrypi-bootloader=1.20190819-1

After the installation you need to reboot the pi.

Release information can be found at raspberrypi kernel project repo.

Thank you. I'll open a ticket, there, too.

Not related to Gitea code or binary, if I understand correctly on referenced issue this has been fixed in latest kernel update

  • raspberry is arm v7, should i use gitea-x.x.x-linux-arm-6?
  • download page have 10.0 and 10, that's very confused

Yes, you should use arm-6 instead.

  • Gitea version (or commit ref): 1.9.3
  • Git version: 2.20.1
  • Operating system: Raspbian 10
  • Database (use [x]):

    • [ ] PostgreSQL
    • [ ] MySQL
    • [ ] MSSQL
    • [ ] SQLite
  • Can you reproduce the bug at https://try.gitea.io:

    • [ ] Yes (provide example URL)
    • [ ] No
    • [x] Not relevant
  • Log gist:

Description

Raspberry Pi 4 with Raspbian 10.
When I launch ./gitea I got "Segmentation Fault"

Used build: arm-6 downloaded from here: https://dl.gitea.io/gitea/1.9.3/gitea-1.9.3-linux-arm-6 .
...

Screenshots

N.A.

edit: I got the error just trying to do ./gitea web after I downloaded the file without doing any kind of configuration.
On my Odroid XU4 with DietPi the same operation works without any error.

edit 2 : the same error appears with Archlinux for Raspi 4. I'll do a gdb and I'll post the results in a gist

edit 3: sooo, after I installed git, I run under gdb and everything works. But when I execute outside gdb I got segmentation fault. I have a "core dump", who arch linux made. Here the dump: https://drive.google.com/open?id=1oP0KpZO4WfGo0lNk6cs45xAwgRP8w_Sp

The same issue

Yes, you should use arm-6 instead.

Raspberry 4's CPU is arm cortex-a72, I tried arm-6 ,arm-5 ,arm64 ,not work, please verify it鈥榮 compatible with Raspberry 4

Arm6 works with rpi4, however the rpi4 introduced a big into their firmware that caused this issue for more than just Gitea. They have since patched the issue but an update to the firmware is needed

Updating the kernel via sudo rpi-update and rebooting fixed the issue for me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tuxfanou picture tuxfanou  路  3Comments

BRMateus2 picture BRMateus2  路  3Comments

adpande picture adpande  路  3Comments

internalfx picture internalfx  路  3Comments

flozz picture flozz  路  3Comments