airsonic-advanced / airsonic-advanced/airsonic-advanced

Uploading a zip file with the unpack option fails results in a crash

Abierto
#984 2 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
1.4k
Forks
159
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

## Problem description
When uploading a zip file in the web UI, the server crashes with a segfault

```
May 02 15:15:24 rottnest systemd-coredump[585793]: [🡕] Process 585354 (java) of user 952 dumped core.

Stack trace of thread 585456:
#0 0x00007f3b2ff86c2b fchown (libc.so.6 + 0xf7c2b)
#1 0x00007f3b2fca2799 Java_sun_nio_fs_UnixNativeDispatcher_fchown0 (libnio.so + 0xd799)
#2 0x00007f3b17d58728 n/a (n/a + 0x0)
#3 0x00007f3b17d543aa n/a (n/a + 0x0)
#4 0x00007f3b17d543aa n/a (n/a + 0x0)
#5 0x00007f3b17d543aa n/a (n/a + 0x0)
#6 0x00007f3b17d543aa n/a (n/a + 0x0)
#7 0x00007f3b17d543aa n/a (n/a + 0x0)
#8 0x00007f3b17d54503 n/a (n/a + 0x0)
#9 0x00007f3b17d543aa n/a (n/a + 0x0)
#10 0x00007f3b17d543aa n/a (n/a + 0x0)
#11 0x00007f3b17d543aa n/a (n/a + 0x0)
#12 0x00007f3b17d547fa n/a (n/a + 0x0)
#13 0x00007f3b17d54503 n/a (n/a + 0x0)
#14 0x00007f3b17d54503 n/a (n/a + 0x0)
#15 0x00007f3b18805afc n/a (n/a + 0x0)
ELF object binary architecture: AMD x86-64
```

### Steps to reproduce

1. Enable uploads
2. Create a zip file containing music files
3. Upload the zip file in the web UI, including checking the "Automatically unpack ZIP-file." option
4. Notice that although the upload completes, the unpacking fails, and the server crashes.

## System information

* **Airsonic version**: 11.0.0-SNAPSHOT.20230409010214 – April 9, 2023, 11:02:14 AM AEST [Commit: [9b43fa47566aa37a3aacdf2255cf9c97cd3b0bd9](https://github.com/airsonic-advanced/airsonic-advanced/commit/9b43fa47566aa37a3aacdf2255cf9c97cd3b0bd9)] - installed via https://aur.archlinux.org/packages/airsonic-advanced-git
* **Operating system**: Arch Linux
* **Java version**: openjdk 20.0.1 2023-04-18
* **Proxy server**: nginx
* **Client**: Firefox on Linux
* **Language**: English

## Additional notes

I can see that the segfault happens in a `fchown` syscall:
* Why would this be necessary during the unpacking process?
* Is there an assumption about file system permissions that is not being met? I've set the upload directory with permissions 777 and owned by the same user/group as the airsonic-advanced service.
* Does systemd prevent it from working somehow?

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.