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

Nil pointer dereference on vpn client #1027

Closed
ersonp opened this issue Dec 15, 2021 · 1 comment
Closed

Nil pointer dereference on vpn client #1027

ersonp opened this issue Dec 15, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@ersonp
Copy link
Contributor

ersonp commented Dec 15, 2021

Describe the bug
There is a panic on starting vpn-client if vpn-client is started before the stun module is initilised.

Environment information:

  • OS: e.g. Linux
  • Platform: the equivalent of uname -smr or uname -smrv e.g. Darwin 17.4.0 x86_64

Steps to Reproduce
Steps to reproduce the behavior:

  1. Run ./skywire-visor -c skywire-config.json
  2. Connect to a VPN server
  3. See error

Actual behavior

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

goroutine 274 [running]:
github.com/skycoin/skywire/pkg/visor.getRouteSetupHooks.func1({0x3, 0xe6, 0xa4, 0x35, 0xb1, 0x6d, 0xe6, 0xac, 0x49, 0xd7, ...}, ...)
        /home/erson/Workspace/Go/skywire/pkg/visor/init.go:517 +0x413
github.com/skycoin/skywire/pkg/router.(*router).DialRoutes(0xc0005500b0, {0x1381bb0, 0xc00003a0b0}, {0x3, 0xe6, 0xa4, 0x35, 0xb1, 0x6d, 0xe6, ...}, ...)
        /home/erson/Workspace/Go/skywire/pkg/router/router.go:253 +0xd54
github.com/skycoin/skywire/pkg/app/appnet.(*SkywireNetworker).DialContext(0xc0005013e0, {0x1381bb0, 0xc00003a0b0}, {{0xc0028769f8, 0x6}, {0x3, 0xe6, 0xa4, 0x35, 0xb1, ...}, ...})
        /home/erson/Workspace/Go/skywire/pkg/app/appnet/skywire_networker.go:60 +0x16b
github.com/skycoin/skywire/pkg/app/appnet.DialContext({0x1381bb0, 0xc00003a0b0}, {{0xc0028769f8, 0x6}, {0x3, 0xe6, 0xa4, 0x35, 0xb1, 0x6d, ...}, ...})
        /home/erson/Workspace/Go/skywire/pkg/app/appnet/networker.go:82 +0x96
github.com/skycoin/skywire/pkg/app/appnet.Dial(...)
        /home/erson/Workspace/Go/skywire/pkg/app/appnet/networker.go:72
github.com/skycoin/skywire/pkg/app/appserver.(*RPCIngressGateway).Dial(0xc0025d4c60, 0xc0028d6000, 0xc002876a00)
        /home/erson/Workspace/Go/skywire/pkg/app/appserver/rpc_ingress_gateway.go:117 +0x208
reflect.Value.call({0xc000422180, 0xc00054afe8, 0x13}, {0xca471a, 0x4}, {0xc0027b3ef8, 0x3, 0x3})
        /usr/local/go/src/reflect/value.go:543 +0x814
reflect.Value.Call({0xc000422180, 0xc00054afe8, 0x0}, {0xc00273b6f8, 0x3, 0x3})
        /usr/local/go/src/reflect/value.go:339 +0xc5
net/rpc.(*service).call(0xc0025f6080, 0x0, 0x0, 0xc0025e42f0, 0xc00029fe00, 0xc00273b7d0, {0xbe3d40, 0xc0028d6000, 0xc00054ae70}, {0xb7b3e0, ...}, ...)
        /usr/local/go/src/net/rpc/server.go:377 +0x239
created by net/rpc.(*Server).ServeCodec
        /usr/local/go/src/net/rpc/server.go:474 +0x405
@ersonp ersonp added the bug Something isn't working label Dec 15, 2021
@ersonp ersonp mentioned this issue Dec 15, 2021
@ersonp
Copy link
Contributor Author

ersonp commented Dec 16, 2021

==================
WARNING: DATA RACE
Write at 0x00c0003a2268 by goroutine 141:
  github.com/skycoin/skywire/pkg/visor.initStunClient()
      /home/erson/Workspace/Go/skywire/pkg/visor/init.go:299 +0xc4
  github.com/skycoin/skywire/pkg/visor.withInitCtx.func1()
      /home/erson/Workspace/Go/skywire/pkg/visor/init.go:1071 +0xce
  github.com/skycoin/skywire/pkg/visor/visorinit.(*Module).InitConcurrent()
      /home/erson/Workspace/Go/skywire/pkg/visor/visorinit/module.go:139 +0x4d6
  github.com/skycoin/skywire/pkg/visor/visorinit.(*Module).InitConcurrent·dwrap·4()
      /home/erson/Workspace/Go/skywire/pkg/visor/visorinit/module.go:117 +0x58

Previous read at 0x00c0003a2268 by goroutine 117:
  github.com/skycoin/skywire/pkg/visor.getRouteSetupHooks.func1()
      /home/erson/Workspace/Go/skywire/pkg/visor/init.go:517 +0x664
  github.com/skycoin/skywire/pkg/router.(*router).DialRoutes()
      /home/erson/Workspace/Go/skywire/pkg/router/router.go:253 +0x675
  github.com/skycoin/skywire/pkg/app/appnet.(*SkywireNetworker).DialContext()
      /home/erson/Workspace/Go/skywire/pkg/app/appnet/skywire_networker.go:60 +0x23c
  github.com/skycoin/skywire/pkg/app/appnet.DialContext()
      /home/erson/Workspace/Go/skywire/pkg/app/appnet/networker.go:82 +0xd7
  github.com/skycoin/skywire/pkg/app/appnet.Dial()
      /home/erson/Workspace/Go/skywire/pkg/app/appnet/networker.go:72 +0x2ad
  github.com/skycoin/skywire/pkg/app/appserver.(*RPCIngressGateway).Dial()
      /home/erson/Workspace/Go/skywire/pkg/app/appserver/rpc_ingress_gateway.go:117 +0x20c
  runtime.call32()
      /usr/local/go/src/runtime/asm_amd64.s:626 +0x48
  reflect.Value.Call()
      /usr/local/go/src/reflect/value.go:339 +0xd7
  net/rpc.(*service).call()
      /usr/local/go/src/net/rpc/server.go:377 +0x28c
  net/rpc.(*Server).ServeCodec·dwrap·4()
      /usr/local/go/src/net/rpc/server.go:474 +0x16b

Goroutine 141 (running) created at:
  github.com/skycoin/skywire/pkg/visor/visorinit.(*Module).InitConcurrent()
      /home/erson/Workspace/Go/skywire/pkg/visor/visorinit/module.go:117 +0x21b
  github.com/skycoin/skywire/pkg/visor.NewVisor()
      /home/erson/Workspace/Go/skywire/pkg/visor/visor.go:150 +0xbcf
  github.com/skycoin/skywire/cmd/skywire-visor/commands.runVisor()
      /home/erson/Workspace/Go/skywire/cmd/skywire-visor/commands/root.go:109 +0xb0e
  github.com/skycoin/skywire/cmd/skywire-visor/commands.runApp()
      /home/erson/Workspace/Go/skywire/cmd/skywire-visor/commands/nosystray.go:17 +0x44
  github.com/skycoin/skywire/cmd/skywire-visor/commands.glob..func2()
      /home/erson/Workspace/Go/skywire/cmd/skywire-visor/commands/root.go:60 +0x2d
  github.com/spf13/cobra.(*Command).execute()
      /home/erson/Workspace/Go/skywire/vendor/github.com/spf13/cobra/command.go:860 +0xaf3
  github.com/spf13/cobra.(*Command).ExecuteC()
      /home/erson/Workspace/Go/skywire/vendor/github.com/spf13/cobra/command.go:974 +0x5da
  github.com/spf13/cobra.(*Command).Execute()
      /home/erson/Workspace/Go/skywire/vendor/github.com/spf13/cobra/command.go:902 +0x126
  github.com/skycoin/skywire/cmd/skywire-visor/commands.Execute()
      /home/erson/Workspace/Go/skywire/cmd/skywire-visor/commands/root.go:141 +0x10f
  main.main()
      /home/erson/Workspace/Go/skywire/cmd/skywire-visor/skywire-visor.go:16 +0x35

Goroutine 117 (running) created at:
  net/rpc.(*Server).ServeCodec()
      /usr/local/go/src/net/rpc/server.go:474 +0x5f7
  net/rpc.(*Server).ServeConn()
      /usr/local/go/src/net/rpc/server.go:449 +0x63d
  github.com/skycoin/skywire/pkg/app/appserver.(*Proc).awaitConn·dwrap·2()
      /home/erson/Workspace/Go/skywire/pkg/app/appserver/proc.go:149 +0x58
==================

@ersonp ersonp reopened this Dec 16, 2021
@ersonp ersonp mentioned this issue Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants