Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swarm segmentation fault in network protocol on deplyoing chequebook #3566

Closed
5chdn opened this issue Jan 14, 2017 · 8 comments
Closed

Swarm segmentation fault in network protocol on deplyoing chequebook #3566

5chdn opened this issue Jan 14, 2017 · 8 comments
Labels

Comments

@5chdn
Copy link
Contributor

5chdn commented Jan 14, 2017

System information

Geth version: geth 1.5.6-stable, swarm 0.2
OS & Version: ArchLinux, w/ kernel 4.8.13-1
Commit hash : n/a

Expected behaviour

  • running Swarm on Ropsten testnet the first time in --swap mode
  • deploying the chequebook contract
  • profit

Actual behaviour

  • running Swarm on Ropsten testnet the first time in --swap mode
  • segmentation fault:
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5339d7]
  • however, it seems the contract was deployed correctly:

https://testnet.etherscan.io/tx/0x7f940e418b2b0bb9f4de98e82e8aa968cf4ea9a0634f0c24ee9779f08a778ca4

  • upon restart, it does not recognize the deployed contract

Steps to reproduce the behaviour

  • running Swarm on Ropsten testnet the first time in --swap mode with the following parameters:
    0 ✓ user@ursae ~ $ swarm --swap --datadir ~/.ethereum/testnet/ --ethapi ~/.ethereum/testnet/geth.ipc --keystore ~/.ethereum/testnet/keystore/ --bzzaccount dcf407eae88d480e280db2d0deaa3a11c82eaa9b
  • segmentation fault:
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5339d7]
  • deployed the contract twice:

https://testnet.etherscan.io/tx/0xdd9ce99a0d7034e2646c875304e1bb6ecd3948c8c048515bb8318eec002a8829

Backtrace

    0 ✓ user@ursae ~ $ swarm --swap --datadir ~/.ethereum/testnet/ --ethapi ~/.ethereum/testnet/geth.ipc --keystore ~/.ethereum/testnet/keystore/ --bzzaccount dcf407eae88d480e280db2d0deaa3a11c82eaa9b
    Unlocking swarm account 0xdcf407eae88d480e280db2d0deaa3a11c82eaa9b [1/3]
    Passphrase: 
    I0114 20:22:28.197086 node/node.go:176] instance: swarm/v1.5.6-stable/linux/go1.7.4
    I0114 20:22:28.203641 p2p/server.go:340] Starting Server
    I0114 20:22:30.395153 p2p/discover/udp.go:227] Listening, enode://96cb7d48942d9c81ca59e4d23f0b805ff9d55852d4515773d53dfa907bb215028da8f520334a78301b12145ec3395627d7df7f3ca62ee1f951903e0bcf658d18@[::]:30399
    I0114 20:22:30.395395 p2p/server.go:608] Listening on [::]:30399
    I0114 20:22:30.396446 swarm/services/swap/swap.go:220] Deploying new chequebook (owner: 0xdcf407eae88d480e280db2d0deaa3a11c82eaa9b)
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5339d7]

    goroutine 417 [running]:
    panic(0xb05f00, 0xc420012120)
      /usr/lib/go/src/runtime/panic.go:500 +0x1a1
    github.com/ethereum/go-ethereum/swarm/network.(*bzz).selfAddr(0xc4204139e0, 0xba9040)
      /build/geth/src/go-ethereum-1.5.6/build/_workspace/src/github.com/ethereum/go-ethereum/swarm/network/protocol.go:468 +0x77
    github.com/ethereum/go-ethereum/swarm/network.(*bzz).handleStatus(0xc4204139e0, 0xc43077a9e0, 0xc85720)
      /build/geth/src/go-ethereum-1.5.6/build/_workspace/src/github.com/ethereum/go-ethereum/swarm/network/protocol.go:346 +0x43
    github.com/ethereum/go-ethereum/swarm/network.run(0xc42025e480, 0x121f220, 0xc420204f60, 0x1222660, 0xc420090050, 0xc4201aa000, 0xc420274ac0, 0xc420274060, 0xc4202d2000, 0x3, ...)
      /build/geth/src/go-ethereum-1.5.6/build/_workspace/src/github.com/ethereum/go-ethereum/swarm/network/protocol.go:185 +0x24c
    github.com/ethereum/go-ethereum/swarm/network.Bzz.func1(0xc4307aa0c0, 0x12193e0, 0xc43055dd50, 0x0, 0x0)
      /build/geth/src/go-ethereum-1.5.6/build/_workspace/src/github.com/ethereum/go-ethereum/swarm/network/protocol.go:146 +0xa9
    github.com/ethereum/go-ethereum/p2p.(*Peer).startProtocols.func1(0xc43055dd50, 0xc4307aa0c0)
      /build/geth/src/go-ethereum-1.5.6/build/_workspace/src/github.com/ethereum/go-ethereum/p2p/peer.go:303 +0x78
    created by github.com/ethereum/go-ethereum/p2p.(*Peer).startProtocols
      /build/geth/src/go-ethereum-1.5.6/build/_workspace/src/github.com/ethereum/go-ethereum/p2p/peer.go:312 +0x25c
    2 ✗ user@ursae ~ $ swarm version
    Swarm
    Version: 0.2
    Network Id: 0
    Go Version: go1.7.4
    OS: linux
    GOPATH=
    GOROOT=/usr/lib/go
    0 ✓ user@ursae ~ $ geth version
    Geth
    Version: 1.5.6-stable
    Protocol Versions: [63 62]
    Network Id: 1
    Go Version: go1.7.4
    OS: linux
    GOPATH=
    GOROOT=/usr/lib/go
    0 ✓ user@ursae ~ $ uname -a
    Linux ursae 4.8.13-1-ARCH #1 SMP PREEMPT Fri Dec 9 07:24:34 CET 2016 x86_64 GNU/Linux
@holisticode
Copy link
Contributor

I haven't been able to reproduce this:

./geth version
Geth
Version: 1.5.9-unstable
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.7.5
OS: linux
GOPATH=/home/fabio/go
GOROOT=/usr/lib/go
./swarm version
Swarm
Version: 0.2

Started geth like this : $GOPATH/bin/geth --testnet --fast --datadir /home/fabio/dat/ethereum/
and swarm: $GOPATH/bin/swarm --swap --datadir ~/dat/ethereum/testnet/ --ethapi ~/dat/ethereum/testnet/geth.ipc --keystore ~/dat/ethereum/testnet/keystore/ --bzzaccount 6d08cefa802c57ca3b2b478d08d1c0a2577e31e7

results here: https://gist.github.com/holisticode/c748d045bc4db0f56bf38fa276baa56b

I0317 19:09:06.362060 swarm/services/swap/swap.go:220] Deploying new chequebook (owner: 0x6d08cefa802c57ca3b2b478d08d1c0a2577e31e7)

I0317 19:09:16.731055 swarm/services/swap/swap.go:226] new chequebook deployed at 0xd8b98e14437c3a999ae77bf1f6b6b4f0c1e0713d (owner: 0x6d08cefa802c57ca3b2b478d08d1c0a2577e31e7)

Maybe latest releases got this fixed?

@JMVoid
Copy link

JMVoid commented May 24, 2017

I got same issue running ubuntu linux 16.04 on Virtual machine.
When I try to deploy chequebook on private blockchain.
every is working fine before add --swap option

- System information:
OS:
Linux ubuntu150 4.8.0-52-generic #55~16.04.1-Ubuntu SMP Fri Apr 28 14:36:29 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

swarm@ubuntu150:~/eth$ swarm version
Swarm
Version: 1.6.2-unstable
Network Id: 0
Go Version: go1.8.1
OS: linux
GOPATH=/home/swarm/goProject
GOROOT=/usr/local/go

swarm@ubuntu150:~/eth$ geth version
Geth
Version: 1.6.2-unstable
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.8.1
Operating System: linux
GOPATH=/home/swarm/goProject
GOROOT=/usr/local/go

Expected behaviour:
running Swarm on private blockchain --swap mode for swap test
Swarm should be run flawless

Actual behaviour:
Swarm panic
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa97375]

Backtrace:
swarm@ubuntu150:~/eth$ swarm --bzzaccount $BZZACCOUNT --swap --datadir $SWARMDIR --keystore $SWARMDIR/keystore --ethapi $SWARMDIR/geth.ipc --bzznetworkid 201703 26
Unlocking swarm account 0x300c757170a81e584ff0a3d5fa88d47ddca039ab [1/3]
Passphrase:
INFO [05-24|17:31:21] Starting peer-to-peer node instance=swarm/v1 .6.2-unstable/linux-amd64/go1.8.1
INFO [05-24|17:31:21] Starting P2P networking
INFO [05-24|17:31:23] UDP listener up self=enode://2faa 79718924e8945827666cfcf9823e91214e6824f9c642a27d232742bad72aea9043d397cb6deb453c 993c9545fdb74214b24c6ea68c2ee182875bd84b1cd0@100.64.99.175:30399
INFO [05-24|17:31:23] RLPx listener up self=enode://2faa 79718924e8945827666cfcf9823e91214e6824f9c642a27d232742bad72aea9043d397cb6deb453c 993c9545fdb74214b24c6ea68c2ee182875bd84b1cd0@100.64.99.175:30399
INFO [05-24|17:31:23] Deploying new chequebook (owner: 0x300c757170a81e584ff0a3d 5fa88d47ddca039ab)
INFO [05-24|17:31:24] Mapped network port proto=udp extport =30399 intport=30399 interface="UPNP IGDv1-IP1"
INFO [05-24|17:31:24] Mapped network port proto=tcp extport =30399 intport=30399 interface="UPNP IGDv1-IP1"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa97375]

goroutine 616 [running]:
github.com/ethereum/go-ethereum/swarm/network.(*bzz).selfAddr(0xc42032e900, 0x10 )
/home/swarm/goProject/src/github.com/ethereum/go-ethereum/swarm/network/ protocol.go:436 +0x75
github.com/ethereum/go-ethereum/swarm/network.(*bzz).handleStatus(0xc42032e900, 0xc42032e900, 0x16)
/home/swarm/goProject/src/github.com/ethereum/go-ethereum/swarm/network/ protocol.go:314 +0x43
github.com/ethereum/go-ethereum/swarm/network.run(0xc420461650, 0x13abca0, 0xc42 0017200, 0x13af4a0, 0xc42019a058, 0xc4201a6000, 0xc4200148a0, 0xc420460040, 0xc4 2009c000, 0x133c656, ...)
/home/swarm/goProject/src/github.com/ethereum/go-ethereum/swarm/network/ protocol.go:153 +0x1cf
github.com/ethereum/go-ethereum/swarm/network.Bzz.func1(0xc420679d10, 0x13a4e20, 0xc420666cb0, 0xc422a00e793788cb, 0x3a3ae0fe2bc3d0e3)
/home/swarm/goProject/src/github.com/ethereum/go-ethereum/swarm/network/ protocol.go:118 +0xa9
github.com/ethereum/go-ethereum/p2p.(*Peer).startProtocols.func1(0xc420666cb0, 0 xc420679d10)
/home/swarm/goProject/src/github.com/ethereum/go-ethereum/p2p/peer.go:30 1 +0x5d
created by github.com/ethereum/go-ethereum/p2p.(*Peer).startProtocols
/home/swarm/goProject/src/github.com/ethereum/go-ethereum/p2p/peer.go:31 0 +0x24a

@stale
Copy link

stale bot commented May 26, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@arokapil
Copy link

i am also facing similar issue

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x77bae7]

looks like its related with the Golang

@stale stale bot removed the status:inactive label Jun 15, 2018
@holisticode
Copy link
Contributor

@arokapil thanks for adding to this issue. However, your stack trace is too small to be able to validate it is indeed related to the same issue or if it's due to something else. Could you please provide a more extensive stack trace (you may look at the original report above for what we are requesting)? Thanks

@arokapil
Copy link

arokapil commented Jun 18, 2018 via email

@holisticode
Copy link
Contributor

I am sorry but looking at this stack trace it seems unrelated to this issue. Please open a new ticket to report your problem. Thanks

@cobordism
Copy link
Contributor

Closing this issue because Swap is currently being rewritten from scratch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants