fadhilyori/subping

Some targets are missing from the results after running the `Run()` command sometimes.

Closed this issue · 1 comments

Describe the bug:
Some targets are missing from the results after running the Run() command sometimes.

To Reproduce:
Steps to reproduce the behavior:

  1. Modify main.go to print the length of s.Results and s.Targets.
  2. Run the command using large hosts, for example, /16 or /24, and use high concurrency (256).
  3. The length of s.Results sometimes does not match the length of s.Targets. If we print the map, we can observe that some IP addresses are not present.

Expected behavior:
The length of s.Results should be the same as the length of s.Targets.

Screenshots:
The IP address 127.0.0.3 is not present in s.Results.
image

Additional context
This issue arises due to unsynchronized data stores among goroutines.

i've got same issue here as you said above as shown below :
image

and i've come out with the solution about this, i'll create the pull request of the solution for you
image