Open UniversalSuperBox opened 1 year ago
Since aptly is running a modified and locally maintained version of goleveldb, as to be found in /database/goleveldb/
inherited from the original maintainer, I think we would need to backport the goleveldb patch you mentioned to try to fix the test error you encountered.
In the long run, we should discover whether we can use upstream goleveldb, and patch it to what we need it to be, or better yet, try to make aptly only use what is provided upstream anyways. (I said it on this bug tracker, and I'll do so again: I am not a Go developer, but I can read source files and I know a thing or two about software development in general.)
Maybe someone familiar with goleveldb can give us hints on how to progress with getting rid of our local goleveldb package?
Detailed Description
When running Aptly's test suite on linux-arm64 or darwin-arm64, a segmentation fault is hit during the ImportChangesFiles test. The trace goes back through goleveldb into snappy. This appears to be related to https://github.com/golang/snappy/issues/62, the suggested fix is to update to snappy 0.0.4 or higher. goleveldb updated to this version of snappy in
v1.0.1-0.20210819022825-2ae1ddf74ef7
(https://github.com/syndtr/goleveldb/pull/365).Possible Implementation
Fixed by updating goleveldb:
Your Environment
darwin-arm64 on an M1 Mac (where else?) and linux-amd64 via Podman Machine on the same host (it's running Fedora Core OS in a VM)
Full output
Output of "go test -v ./deb/ -gocheck.v=true -check.f 'ImportChangesFiles'"
``` # go test -v ./deb/ -gocheck.v=true -check.f 'ImportChangesFiles' === RUN Test Loading repository test for changes file hardlink_0.2.1_amd64.changes... unexpected fault address 0x7564200a2c785b fatal error: fault [signal SIGSEGV: segmentation violation code=0x1 addr=0x7564200a2c785b pc=0x469a24] goroutine 36 [running]: runtime.throw({0x663dbd?, 0x469880?}) /usr/lib/go-1.18/src/runtime/panic.go:992 +0x50 fp=0x40007bc620 sp=0x40007bc5f0 pc=0x46ca0 runtime.sigpanic() /usr/lib/go-1.18/src/runtime/signal_unix.go:825 +0x1a4 fp=0x40007bc650 sp=0x40007bc620 pc=0x5e284 github.com/golang/snappy.encodeBlock({0x4000232002, 0xe39, 0xe39}, {0x40007b0000, 0xc13, 0xd28}) /root/go/pkg/mod/github.com/golang/snappy@v0.0.2/encode_arm64.s:666 +0x354 fp=0x40007c46f0 sp=0x40007bc660 pc=0x469a24 github.com/golang/snappy.Encode({0x4000232000?, 0x458b38?, 0x40001067b8?}, {0x40007b0000?, 0x4000106801?, 0x467c3c?}) /root/go/pkg/mod/github.com/golang/snappy@v0.0.2/encode.go:39 +0x1dc fp=0x40007c4780 sp=0x40007c46f0 pc=0x468fdc github.com/syndtr/goleveldb/leveldb/table.(*Writer).writeBlock(0x4000194900, 0x4000194958, 0x4000106868?) /root/go/pkg/mod/github.com/syndtr/goleveldb@v1.0.1-0.20190923125748-758128399b1d/leveldb/table/writer.go:170 +0x118 fp=0x40007c47f0 sp=0x40007c4780 pc=0x471ea8 github.com/syndtr/goleveldb/leveldb/table.(*Writer).finishBlock(0x4000194900) /root/go/pkg/mod/github.com/syndtr/goleveldb@v1.0.1-0.20190923125748-758128399b1d/leveldb/table/writer.go:221 +0x40 fp=0x40007c4830 sp=0x40007c47f0 pc=0x472280 github.com/syndtr/goleveldb/leveldb/table.(*Writer).Close(0x4000194900) /root/go/pkg/mod/github.com/syndtr/goleveldb@v1.0.1-0.20190923125748-758128399b1d/leveldb/table/writer.go:294 +0x44 fp=0x40007c4910 sp=0x40007c4830 pc=0x4726a4 github.com/syndtr/goleveldb/leveldb.(*tWriter).finish(0x4000201140) /root/go/pkg/mod/github.com/syndtr/goleveldb@v1.0.1-0.20190923125748-758128399b1d/leveldb/table.go:578 +0x60 fp=0x40007c49c0 sp=0x40007c4910 pc=0x495f50 github.com/syndtr/goleveldb/leveldb.(*tOps).createFrom(0xffffb7128f18?, {0x76aec8, 0x4000129000}) /root/go/pkg/mod/github.com/syndtr/goleveldb@v1.0.1-0.20190923125748-758128399b1d/leveldb/table.go:408 +0x194 fp=0x40007c4a70 sp=0x40007c49c0 pc=0x494864 github.com/syndtr/goleveldb/leveldb.(*Transaction).flush(0x40000cc000) /root/go/pkg/mod/github.com/syndtr/goleveldb@v1.0.1-0.20190923125748-758128399b1d/leveldb/db_transaction.go:97 +0x108 fp=0x40007c4bb0 sp=0x40007c4a70 pc=0x4856c8 github.com/syndtr/goleveldb/leveldb.(*Transaction).Commit(0x40000cc000) /root/go/pkg/mod/github.com/syndtr/goleveldb@v1.0.1-0.20190923125748-758128399b1d/leveldb/db_transaction.go:203 +0xb0 fp=0x40007c4ca0 sp=0x40007c4bb0 pc=0x486430 github.com/aptly-dev/aptly/database/goleveldb.(*transaction).Commit(0x5a3f00?) /code/database/goleveldb/transaction.go:49 +0x24 fp=0x40007c4cc0 sp=0x40007c4ca0 pc=0x49f314 github.com/aptly-dev/aptly/deb.ImportPackageFiles(0x4000110dd0?, {0x400002c840, 0x3, 0x766a58?}, 0x0, {0x769b60, 0xb03f10}, {0x76a6f0, 0x400006e060}, 0x40000c00f0, ...) /code/deb/import.go:230 +0x168 fp=0x40007c5030 sp=0x40007c4cc0 pc=0x4dadd8 github.com/aptly-dev/aptly/deb.ImportChangesFiles({0x4000128600?, 0x5, 0x40002c35e8?}, {0x766a58, 0x400007c050}, 0x0?, 0x0?, 0x0?, 0x0, {0x769b60, ...}, ...) /code/deb/changes.go:375 +0xf0c fp=0x40007c5400 sp=0x40007c5030 pc=0x4d3f1c github.com/aptly-dev/aptly/deb.(*ChangesSuite).TestImportChangesFiles(0x4000212200, 0x0?) /code/deb/changes_test.go:124 +0x71c fp=0x40007c5700 sp=0x40007c5400 pc=0x5066ec runtime.call16(0x400007e2a0, 0x4000010008, 0x0, 0x0, 0x0, 0x10, 0x40007c5c40) /usr/lib/go-1.18/src/runtime/asm_arm64.s:507 +0x7c fp=0x40007c5720 sp=0x40007c5700 pc=0x7805c runtime.reflectcall(0x657720?, 0x40002b4000?, 0x2?, 0x66af8a?, 0x0?, 0x12?, 0x657720?)