goland отладить ошибку go-ethereum с файлом secp256.go - PullRequest
0 голосов
/ 20 октября 2018

Mac версия: macOS Mojave Версия 10.14 (18A391)

Версия GO: 1.11.1

GOLand 2018.2.3

Когда я отлаживаю источник go-ethereumкод: он зависает с CGO, кажется, что secp256.go вызывает язык C, он паникует.

Если я запускаю его нормально вместо отладки программы.Чтобы понять код отдельно, я должен отладить код в Goland.

Ошибки следующие:

    GOROOT=/usr/local/Cellar/go/1.11.1/libexec #gosetup
GOPATH=/Users/friends/gopath #gosetup
/usr/local/Cellar/go/1.11.1/libexec/bin/go build -gcflags "all=-N -l" -o /Users/friends/gopath/src/github.com/ethereum/go-ethereumBackup/build/bin/geth_testnet -gcflags "all=-N -l" github.com/ethereum/go-ethereum/cmd/geth #gosetup
/Applications/GoLand.app/Contents/plugins/go/lib/dlv/mac/dlv --listen=localhost:64113 --headless=true --api-version=2 --backend=native exec /Users/friends/gopath/src/github.com/ethereum/go-ethereumBackup/build/bin/geth_testnet -- --testnet --datadir /Users/friends/var/testnet --ethash.dagdir /Users/friends/var/testnet/dagdir #gosetup
API server listening at: 127.0.0.1:64113
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x4bfe120 pc=0x4bfe120]

runtime stack:
runtime.throw(0x4f10c89, 0x2a)
    /usr/local/Cellar/go/1.11.1/libexec/src/runtime/panic.go:608 +0x72
runtime.sigpanic()
    /usr/local/Cellar/go/1.11.1/libexec/src/runtime/signal_unix.go:374 +0x288

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x4bfe120, 0xc0000d1c40, 0xc0000d6500)
    /usr/local/Cellar/go/1.11.1/libexec/src/runtime/cgocall.go:128 +0x5e fp=0xc0000d1c10 sp=0xc0000d1bd8 pc=0x40058fe
github.com/ethereum/go-ethereum/crypto/secp256k1._Cfunc_secp256k1_context_create_sign_verify(0x0)
    _cgo_gotypes.go:199 +0x4a fp=0xc0000d1c40 sp=0xc0000d1c10 pc=0x423d2ba
github.com/ethereum/go-ethereum/crypto/secp256k1.init.1()
    /Users/friends/gopath/src/github.com/ethereum/go-ethereum/crypto/secp256k1/secp256.go:37 +0x26 fp=0xc0000d1c78 sp=0xc0000d1c40 pc=0x4240666
github.com/ethereum/go-ethereum/crypto/secp256k1.init()
    <autogenerated>:1 +0x255 fp=0xc0000d1ca8 sp=0xc0000d1c78 pc=0x42414e5
github.com/ethereum/go-ethereum/crypto.init()
    <autogenerated>:1 +0x95 fp=0xc0000d1d08 sp=0xc0000d1ca8 pc=0x4244855
github.com/ethereum/go-ethereum/core/types.init()
    <autogenerated>:1 +0x86 fp=0xc0000d1d88 sp=0xc0000d1d08 pc=0x43cf3d6
github.com/ethereum/go-ethereum.init()
    <autogenerated>:1 +0x63 fp=0xc0000d1db8 sp=0xc0000d1d88 pc=0x43d2703
github.com/ethereum/go-ethereum/accounts.init()
    <autogenerated>:1 +0x59 fp=0xc0000d1de8 sp=0xc0000d1db8 pc=0x43dbd69
main.init()
    <autogenerated>:1 +0x75 fp=0xc0000d1f98 sp=0xc0000d1de8 pc=0x4bec775
runtime.main()
    /usr/local/Cellar/go/1.11.1/libexec/src/runtime/proc.go:189 +0x17b fp=0xc0000d1fe0 sp=0xc0000d1f98 pc=0x4034e4b
runtime.goexit()
    /usr/local/Cellar/go/1.11.1/libexec/src/runtime/asm_amd64.s:1333 +0x1 fp=0xc0000d1fe8 sp=0xc0000d1fe0 pc=0x4065e11

Debugger finished with exit code 0
...