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

Skywiremob fails if stopped before setting a socket #511

Closed
Senyoret1 opened this issue Sep 8, 2020 · 2 comments
Closed

Skywiremob fails if stopped before setting a socket #511

Senyoret1 opened this issue Sep 8, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@Senyoret1
Copy link
Contributor

Describe the bug
If a visor is started with Skywiremob and stopped before creating a socket for connecting the visor and the app, the visor fails and the app is force closed.

Environment information:

  • OS: Android 5 to 10 (x86 emulator).
  • Platform: Android 5 to 10 (x86 emulator).

Steps to Reproduce
Steps to reproduce the behavior:

  1. Start a node with Skywiremob, to the point in which Skywiremob.isVPNReady() returns true.
  2. Without creating a socket for connecting the visor with the app, call visor.stopVisor()

Actual behavior
Skywiremob will panic with an error like this:

E/Go: panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa222c057]
    goroutine 122 [running]:
    net.(*UDPConn).Read(0x0)
    	<autogenerated>:1 +0x17
    io.copyBuffer(0xaf4a3050 ...)
    	c:/go/src/io/io.go:402 +0xe4
    io.Copy(...)
    	c:/go/src/io/io.go:364
    github.com/skycoin/skywire/internal/vpn.(*ClientMobile).Serve.func2(0x81f92480)
    	C:/GoPath/src/github.com/skycoin/skywire/internal/vpn/client_mobile.go:68 +0xb5
    created by github.com/skycoin/skywire/internal/vpn.(*ClientMobile).Serve
    	C:/GoPath/src/github.com/skycoin/skywire/internal/vpn/client_mobile.go:65 +0x10e
A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 4219 (ire.skycoin.vpn)
Disconnected from the target VM, address: 'localhost:8647', transport: 'socket'

Expected behavior
The visor should be stopped without problems.

@Darkren
Copy link
Contributor

Darkren commented Sep 14, 2020

Hey there @Senyoret1 ! just updated #447 , please try it out. also there's one trouble there. when isVpnReady gets true and we push stop, visor now gets shut down properly. but vpn service might be being started. so, when we push stop we need to ensure that all the mobile facilities are closed properly. I'm having issues with debugging the app, so probably my issue is artificial and won't happen for a real user. anyway, please try it out and tell me if there are issues left

@Senyoret1
Copy link
Contributor Author

It works well, thank you. The version of the Android app I’m working on manages the service closure, so there should not be problems.

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