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

Data Race in skysocks #845

Closed
ersonp opened this issue Jul 14, 2021 · 0 comments
Closed

Data Race in skysocks #845

ersonp opened this issue Jul 14, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@ersonp
Copy link
Contributor

ersonp commented Jul 14, 2021

Describe the bug
A clear and concise description of the problem and bug effects.
Data race occours when a visor built with -race flag is closed with Ctrl+C.

Environment information:

  • OS: Linux
  • Platform: Linux 5.8.0-59-generic x86_64

Steps to Reproduce
Steps to reproduce the behavior:

  1. Build skywire with -race flag
  2. Config must have skysocks app
  3. Start the visor
  4. Ctrl + C

Actual behavior

[2021-07-14T22:10:39+05:30] INFO [9/10] [visor:shutdown:transport_setup.rpc]: Module stopped cleanly. elapsed=659.658_s
[2021-07-14T22:10:39+05:30] INFO [8/10] [visor:shutdown:launcher.proc_manager]: Shutting down module...
[2021-07-14T22:10:39+05:30] INFO (STDERR) [proc:skysocks:551b55409a564389a7e4f92c33ad1c63]: ==================
[2021-07-14T22:10:39+05:30] INFO (STDERR) [proc:skysocks:551b55409a564389a7e4f92c33ad1c63]: WARNING: DATA RACE
[2021-07-14T22:10:39+05:30] INFO (STDERR) [proc:skysocks:551b55409a564389a7e4f92c33ad1c63]: Read at 0x00c0000771a8 by goroutine 11:
[2021-07-14T22:10:39+05:30] INFO (STDERR) [proc:skysocks:551b55409a564389a7e4f92c33ad1c63]:   github.com/skycoin/skywire/internal/skysocks.(*Server).Close()
[2021-07-14T22:10:39+05:30] INFO (STDERR) [proc:skysocks:551b55409a564389a7e4f92c33ad1c63]:       /home/erson/Workspace/Go/skywire/internal/skysocks/server.go:83 +0x64
[2021-07-14T22:10:39+05:30] INFO (STDERR) [proc:skysocks:551b55409a564389a7e4f92c33ad1c63]:   main.main.func1()
[2021-07-14T22:10:39+05:30] INFO (STDERR) [proc:skysocks:551b55409a564389a7e4f92c33ad1c63]:       /home/erson/Workspace/Go/skywire/cmd/apps/skysocks/skysocks.go:59 +0x53
[2021-07-14T22:10:39+05:30] INFO (STDERR) [proc:skysocks:551b55409a564389a7e4f92c33ad1c63]:
[2021-07-14T22:10:39+05:30] INFO (STDERR) [proc:skysocks:551b55409a564389a7e4f92c33ad1c63]: Previous write at 0x00c0000771a8 by main goroutine:
[2021-07-14T22:10:39+05:30] INFO (STDERR) [proc:skysocks:551b55409a564389a7e4f92c33ad1c63]:   github.com/skycoin/skywire/internal/skysocks.(*Server).Serve()
[2021-07-14T22:10:39+05:30] INFO (STDERR) [proc:skysocks:551b55409a564389a7e4f92c33ad1c63]:       /home/erson/Workspace/Go/skywire/internal/skysocks/server.go:39 +0x5b
[2021-07-14T22:10:39+05:30] INFO (STDERR) [proc:skysocks:551b55409a564389a7e4f92c33ad1c63]:   main.main()
[2021-07-14T22:10:39+05:30] INFO (STDERR) [proc:skysocks:551b55409a564389a7e4f92c33ad1c63]:       /home/erson/Workspace/Go/skywire/cmd/apps/skysocks/skysocks.go:65 +0x7a4
[2021-07-14T22:10:39+05:30] INFO (STDERR) [proc:skysocks:551b55409a564389a7e4f92c33ad1c63]:
[2021-07-14T22:10:39+05:30] INFO (STDERR) [proc:skysocks:551b55409a564389a7e4f92c33ad1c63]: Goroutine 11 (running) created at:
[2021-07-14T22:10:39+05:30] INFO (STDERR) [proc:skysocks:551b55409a564389a7e4f92c33ad1c63]:   main.main()
[2021-07-14T22:10:39+05:30] INFO (STDERR) [proc:skysocks:551b55409a564389a7e4f92c33ad1c63]:       /home/erson/Workspace/Go/skywire/cmd/apps/skysocks/skysocks.go:56 +0x779
[2021-07-14T22:10:39+05:30] INFO (STDERR) [proc:skysocks:551b55409a564389a7e4f92c33ad1c63]: ==================

Expected behavior
Close without data race.

Additional context
This was observed in Interactive test environment in skywire-services.

Possible implementation
Add a mutex lock

@ersonp ersonp added the bug Something isn't working label Jul 14, 2021
@ersonp ersonp mentioned this issue Jul 22, 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