GeertJohan / GeertJohan/go.rice

Panic using zip exe

Open
#178 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
2.4k
Forks
185
PR merge metrics
No merged PRs in 30d

Description

I believe this might be a version issue. But i am getting this error recently when running rice.

GOOS=linux GOARCH=amd64 go build -o outputfile main.go
~/go/bin/rice append --exec outputfile
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x18 pc=0x104c55778]

goroutine 1 [running]:
debug/elf.(*Section).ReadAt(0x140002b6000?, {0x1400027e000?, 0x107?, 0x14?}, 0x190?)
:1 +0x28
archive/zip.readDirectoryEnd({0x104d61c38, 0x14000210a00}, 0x214)
/usr/local/go/src/archive/zip/reader.go:526 +0xd0
archive/zip.(*Reader).init(0x14000236540, {0x104d61c38?, 0x14000210a00}, 0x214)
/usr/local/go/src/archive/zip/reader.go:97 +0x44
archive/zip.NewReader({0x104d61c38, 0x14000210a00}, 0x214)
/usr/local/go/src/archive/zip/reader.go:90 +0x50
github.com/daaku/go%2ezipexe.zipExeReaderElf({0x104d62058?, 0x14000206070}, 0xc49d88)
/Users/bvoelker/go/pkg/mod/github.com/daaku/go.zipexe@v1.0.0/zipexe.go:128 +0x98
github.com/daaku/go%2ezipexe.NewReader({0x104d62058, 0x14000206070}, 0x0?)
/Users/bvoelker/go/pkg/mod/github.com/daaku/go.zipexe@v1.0.0/zipexe.go:48 +0x94
github.com/daaku/go%2ezipexe.OpenCloser({0x1400022c0f0?, 0x49?})
/Users/bvoelker/go/pkg/mod/github.com/daaku/go.zipexe@v1.0.0/zipexe.go:30 +0x58
github.com/daaku/go%2ezipexe.Open(...)
/Users/bvoelker/go/pkg/mod/github.com/daaku/go.zipexe@v1.0.0/zipexe.go:16
main.operationAppend({0x14000206058, 0x1, 0x14000064000?})
/Users/bvoelker/go/pkg/mod/github.com/!geert!johan/go.rice@v1.0.2/rice/append.go:39 +0x330
main.main()
/Users/bvoelker/go/pkg/mod/github.com/!geert!johan/go.rice@v1.0.2/rice/main.go:42 +0x1b0
make: *** [deploy] Error 2

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the reported GOOS=linux GOARCH=amd64 build and rice append commands, then inspect rice/append.go and the go.zipexe NewReader path shown in the stack trace. Trace how the generated executable is opened as a zip and verify the fix by confirming append completes without a nil-pointer panic.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.