cortex / gopass

Gopass: A simple password-store GUI
GNU General Public License v3.0
188 stars 13 forks source link

Crash on start without password #1

Closed christopherL91 closed 8 years ago

christopherL91 commented 8 years ago

Running on mac osx 10.11.1 with go version 1.5

Crashing on start without any password:

panic: runtime error: index out of range

goroutine 1 [running, locked to thread]:
main.(*Passwords).Copy(0x42c58a0)
    /Users/Christopher/Development/Go/src/github.com/cortex/gopass/main.go:134 +0x327
reflect.Value.call(0x41bb220, 0x42c58a0, 0x513, 0x41cf920, 0x4, 0xc82004fba0, 0x0, 0xa, 0x0, 0x0, ...)
    /usr/local/Cellar/go/1.5.2/libexec/src/reflect/value.go:432 +0x120a
reflect.Value.Call(0x41bb220, 0x42c58a0, 0x513, 0xc82004fba0, 0x0, 0xa, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.5.2/libexec/src/reflect/value.go:300 +0xb1
gopkg.in/qml%2ev1.hookGoValueCallMethod(0x632ae10, 0xc8200a2000, 0x2, 0x7fff5fbf8770)
    /Users/Christopher/Development/Go/src/gopkg.in/qml.v1/bridge.go:515 +0x425
gopkg.in/qml%2ev1._Cfunc_applicationExec()
    ??:0 +0x31
gopkg.in/qml%2ev1.Run(0x4218550, 0x0, 0x0)
    /Users/Christopher/Development/Go/src/gopkg.in/qml.v1/bridge.go:63 +0x16e
main.main()
    /Users/Christopher/Development/Go/src/github.com/cortex/gopass/main.go:180 +0x247

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /usr/local/Cellar/go/1.5.2/libexec/src/runtime/asm_amd64.s:1721 +0x1

goroutine 20 [semacquire]:
sync.runtime_Semacquire(0xc8200a0274)
    /usr/local/Cellar/go/1.5.2/libexec/src/runtime/sema.go:43 +0x26
sync.(*Mutex).Lock(0xc8200a0270)
    /usr/local/Cellar/go/1.5.2/libexec/src/sync/mutex.go:82 +0x1c4
gopkg.in/qml%2ev1.(*Window).Wait(0xc82000a0c0)
    /Users/Christopher/Development/Go/src/gopkg.in/qml.v1/qml.go:911 +0x9f
main.run(0x0, 0x0)
    /Users/Christopher/Development/Go/src/github.com/cortex/gopass/main.go:170 +0x122
gopkg.in/qml%2ev1.Run.func1(0xc820072120, 0x4218550)
    /Users/Christopher/Development/Go/src/gopkg.in/qml.v1/bridge.go:60 +0x2d
created by gopkg.in/qml%2ev1.Run
    /Users/Christopher/Development/Go/src/gopkg.in/qml.v1/bridge.go:62 +0x169

possibly a deadlock somewhere?

cortex commented 8 years ago

No, it was just a normal missing bounds check. Fix is in master, try again with go get -u github.com/cortex/gopass

I'm very happy to see this thing actually built on OSX =)! Would you mind sending a binary?

christopherL91 commented 8 years ago

Nice work :+1: Started using pass when I saw your post on Facebook :v: Sure thing, where do you want me to send it? You can always cross compile as well.

It would be nice to have everything static so that every asset is compiled into the binary. I started experimenting with go-bindata yesterday but I still haven't figured out what you can do to logo.svg file, since the QML package doesn't support giving external assets as an byte array. The qml file is okey to bundle with the binary if instead of giving it the file path giving it a byte array though the Asset function. Do you have any suggestions?

cortex commented 8 years ago

I think it should be doable with https://godoc.org/gopkg.in/qml.v1#ResourcesPacker.AddString, but I haven't tested it I added a separate ticket about a full static build here: https://github.com/cortex/gopass/issues/3. PR:s are very welcome =)

Closing this issue since it seems to be working now.