Open dusaint opened 1 year ago
Ack, thanks! We'll keep an eye on the sqlite dependency
This seems to happen on NetBSD 9.1 as well, switching the journal_mode pragma to 'delete' allows gotosocial to operate normally. Can confirm gotosocial versions 6.0, 7.1, and 8.1 are impacted.
# /usr/pkg/bin/gotosocial --config-path /vol/gotosocial/config.yml server start
timestamp="27/04/2023 15:26:24.486" func=bundb.sqliteConn level=INFO msg="connected to SQLITE database with address file:/vol/gotosocial/social.db?_txlock=immediate"
unexpected fault address 0x7f7fd09c9000
fatal error: fault
[signal SIGBUS: bus error code=0x2 addr=0x7f7fd09c9000 pc=0x466eca]
goroutine 1 [running]:
runtime.throw({0x24a7167?, 0x7f7fd07020a0?})
runtime/panic.go:1047 +0x5d fp=0xc00091dd88 sp=0xc00091dd58 pc=0x4345dd
runtime.sigpanic()
runtime/signal_unix.go:834 +0x1ac fp=0xc00091dde8 sp=0xc00091dd88 pc=0x44a3ec
runtime.memmove()
runtime/memmove_amd64.s:103 +0xaa fp=0xc00091ddf0 sp=0xc00091dde8 pc=0x466eca
modernc.org/libc.Xmemcpy(...)
modernc.org/libc@v1.22.3/libc.go:824
modernc.org/sqlite/lib.walIndexRecover(0xc0002c4000, 0x7f7fcfd00528)
modernc.org/sqlite@v1.21.1/lib/sqlite_netbsd_amd64.go:24801 +0x707 fp=0xc00091df28 sp=0xc00091ddf0 pc=0x19e0507
modernc.org/sqlite/lib.walIndexReadHdr(0xc0002c4000, 0x7f7fcfd00528, 0x7f7fd0700fc0)
modernc.org/sqlite@v1.21.1/lib/sqlite_netbsd_amd64.go:25550 +0x252 fp=0xc00091df98 sp=0xc00091df28 pc=0x19e34b2
modernc.org/sqlite/lib.walTryBeginRead(0x19dea9b?, 0x7f7fcfd00528, 0xc00091e030?, 0x0, 0x1)
modernc.org/sqlite@v1.21.1/lib/sqlite_netbsd_amd64.go:25759 +0xc9 fp=0xc00091dff0 sp=0xc00091df98 pc=0x19e3d49
modernc.org/sqlite/lib.Xsqlite3WalBeginReadTransaction(0x7f7fd0700fc4?, 0x7f7fcfd00528, 0x7f7fd0700fc0)
modernc.org/sqlite@v1.21.1/lib/sqlite_netbsd_amd64.go:25957 +0x7b fp=0xc00091e040 sp=0xc00091dff0 pc=0x19e42db
modernc.org/sqlite/lib.pagerBeginReadTransaction(0xc0002c4000, 0x7f7fcfb00428)
modernc.org/sqlite@v1.21.1/lib/sqlite_netbsd_amd64.go:21308 +0xaa fp=0xc00091e098 sp=0xc00091e040 pc=0x19d7bea
modernc.org/sqlite/lib.Xsqlite3PagerSharedLock(0xc0002c4000, 0x7f7fcfb00428)
modernc.org/sqlite@v1.21.1/lib/sqlite_netbsd_amd64.go:22733 +0x4f5 fp=0xc00091e130 sp=0xc00091e098 pc=0x19dbbd5
modernc.org/sqlite/lib.lockBtree(0xc0002c4000, 0x7f7fcfd00428)
modernc.org/sqlite@v1.21.1/lib/sqlite_netbsd_amd64.go:29148 +0xa5 fp=0xc00091e1b8 sp=0xc00091e130 pc=0x19ed305
modernc.org/sqlite/lib.Xsqlite3BtreeBeginTrans(0xc0002c4000?, 0x7f7fd01000a8, 0x0, 0x0)
I, too, have seen this SIGBUS
once I applied the the fix for the SIGSYS
above. It looks just a little different on OpenBSD, but same idea. Some experimentation shows that setting journal_mode
(as gotosocial
does on starup) when the db already has it set to "WAL
" triggers this. I'll report it upstream.
Filed the SIGBUS
as https://gitlab.com/cznic/sqlite/-/issues/144
Describe the bug with a clear and concise description of what the bug is.
gotosocial
crashes immediately on startup whendb-type
is set to"sqlite"
on OpenBSD 7.3. This is due to a change in the syscall formmap
between OpenBSD 7.2 and 7.3.This isn't a bug in
gotosocial
per se, but once the bug is fixed inmodernc.org/libc
viamodernc.org/sqlite
, a version bump will be needed ingo.mod
to pull the fix in. (I don't expect the actual upstream bug inx/sys/unix
to be fixed anytime soon.).The upstream bug is https://gitlab.com/cznic/libc/-/issues/29 (
modernc.org/sqlite
usesmodernc.org/libc
) The up-upstream bug is https://github.com/golang/go/issues/59661The gist of the bug is that OpenBSD removed the "padded" version of several syscalls in 7.3, having created new versions over a year prior. In doing so, the syscall number changed, so when the old one is called,
SIGSYS
is raised. See https://github.com/openbsd/src/commit/1d60349d0b961891264d426ffe1c0ced24b2374c#diff-e8c6a075c6e1240e27216779540b66f3db43b14a3b3615c2ecb7a111faa54504 and https://github.com/openbsd/src/commit/8c7f5cc47d34f1bd83a08278dad544a34184dabf for the history there.Here's the pertinent console output of a failing run:
What's your GoToSocial Version?
v0.8.0
GoToSocial Arch
OpenBSD 7.3 amd64
What happened?
gotosocial
crashes immediatelyWhat you expected to happen?
gotosocial
should start up normallyHow to reproduce it?
rcctl start gotosocial
or just launchgotosocial
from the command line normallyAnything else we need to know?
No response