iost-official / go-iost

Official Go implementation of the IOST blockchain
https://developers.iost.io/
GNU Lesser General Public License v3.0
565 stars 112 forks source link

runtime error when sign #6

Closed Charleslzp closed 5 years ago

Charleslzp commented 6 years ago

issue: when i want to sign my smart contract , it throw me a error: sudo ./build/iwallet sign test/test.lua -k ~/.ssh/id_secp Password: file broken: runtime error: index out of range panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x44f18f1]

goroutine 1 [running]: github.com/iost-official/Go-IOS-Protocol/core/tx.(Tx).BaseHash(0xc4201dd8b0, 0xc4200baa20, 0x21, 0x21) /Users/lizhipeng/go/src/github.com/iost-official/Go-IOS-Protocol/core/tx/tx.go:71 +0x31 github.com/iost-official/Go-IOS-Protocol/core/tx.SignContract(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...) /Users/lizhipeng/go/src/github.com/iost-official/Go-IOS-Protocol/core/tx/tx.go:34 +0x67 github.com/iost-official/Go-IOS-Protocol/iwallet/cmd.glob..func7(0x4b66c60, 0xc420190d50, 0x1, 0x3) /Users/lizhipeng/go/src/github.com/iost-official/Go-IOS-Protocol/iwallet/cmd/sign.go:78 +0x32a github.com/iost-official/Go-IOS-Protocol/vendor/github.com/spf13/cobra.(Command).execute(0x4b66c60, 0xc420190cc0, 0x3, 0x3, 0x4b66c60, 0xc420190cc0) /Users/lizhipeng/go/src/github.com/iost-official/Go-IOS-Protocol/vendor/github.com/spf13/cobra/command.go:766 +0x2c1 github.com/iost-official/Go-IOS-Protocol/vendor/github.com/spf13/cobra.(Command).ExecuteC(0x4b66a00, 0x6, 0x474f74b, 0x1) /Users/lizhipeng/go/src/github.com/iost-official/Go-IOS-Protocol/vendor/github.com/spf13/cobra/command.go:852 +0x30a github.com/iost-official/Go-IOS-Protocol/vendor/github.com/spf13/cobra.(Command).Execute(0x4b66a00, 0xc420088058, 0x0) /Users/lizhipeng/go/src/github.com/iost-official/Go-IOS-Protocol/vendor/github.com/spf13/cobra/command.go:800 +0x2b github.com/iost-official/Go-IOS-Protocol/iwallet/cmd.Execute() /Users/lizhipeng/go/src/github.com/iost-official/Go-IOS-Protocol/iwallet/cmd/root.go:27 +0x2d main.main() /Users/lizhipeng/go/src/github.com/iost-official/Go-IOS-Protocol/iwallet/main.go:6 +0x20

kaidiren commented 6 years ago
  1. complie test.lua to test.sc
  2. sign test.sc
  3. publish