linuxserver / docker-nzbget

GNU General Public License v3.0
149 stars 83 forks source link

nzbget segfaults with time64 on arm32 #127

Closed capntrips closed 3 years ago

capntrips commented 3 years ago

linuxserver.io


Expected Behavior

nzbget should not segfault on arm32

Current Behavior

nzbget segfaults when a time is encountered (when an nzb is in the queue or history).

Steps to Reproduce

  1. Add an nzb on an arm32 platform.

Environment

OS: linux CPU architecture: arm32 How docker service was installed: from the official docker repo

Command used to create docker container (run/create/compose/screenshot)

docker run -d --name=nzbget --env=PUID=65534 --env=PGID=65534 --env=TZ=America/Chicago --volume=nzbget_data:/config -p 6789:6789 linuxserver/nzbget:latest

Docker logs

[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing... 
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing... 
usermod: no changes
-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \ 
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/
Brought to you by linuxserver.io
-------------------------------------
To support the app dev(s) visit:
NZBGet: https://nzbget.net/donate
To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------
User uid:    65534
User gid:    65534
-------------------------------------
[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing... 
[cont-init.d] 30-config: exited 0.
[cont-init.d] 99-custom-files: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
github-actions[bot] commented 3 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

capntrips commented 3 years ago

I already submitted a bug report with nzbget, but I don't expect immediate resolution, and the arm32 builds won't work, in the meantime.

The issue is that with v21.0-ls71, Alpine was was upgraded to 3.13, which uses musl 1.2.2. As of 1.2.0, musl uses time64, even on 32-bit archs:

musl 1.2.0 changes the definition of time_t, and thereby the definitions of all derived types, to be 64-bit across all archs. This and related changes are collectively referred to as "time64", and are necessary so that data types and functions dealing with time can represent time past early 2038, where the existing 32-bit type on 32-bit archs would overflow.

I asked about legacy compatibility on the musl IRC and was told that apps built against the old headers will continue to use time32. I tested this by compiling nzbget on Alpine 3.12 in the build stage then running it on Alpine 3.13, and it works fine.

I also tested it on the latest Ubuntu base image (which obviously doesn't use musl), and it worked fine (with nearly double the image size).

I'm happy to submit a PR for either of those scenarios.

For anyone that ends up here that wants a quick fix, just roll back to linuxserver/nzbget:v21.0-ls70 for now.

j0nnymoe commented 3 years ago

Sounds like you need to upgrade your libseccomp2: https://docs.linuxserver.io/faq#my-host-is-incompatible-with-images-based-on-ubuntu-focal

capntrips commented 3 years ago
# docker exec nzbget date
Tue Mar  2 02:51:45 CST 2021

Also, if the nzbget binary is compiled on Alpine 3.12, it runs on Alpine 3.13 without issue.

Roxedus commented 3 years ago

I think compiling on 3.12 until/if this get fixed upstream is the best approach.