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

crash on Fedora #16

Closed
mia0x75 opened this issue Aug 27, 2018 · 0 comments
Closed

crash on Fedora #16

mia0x75 opened this issue Aug 27, 2018 · 0 comments

Comments

@mia0x75
Copy link

mia0x75 commented Aug 27, 2018

ss_s.go

arr := strings.Split(content, ", ")
                        for _, val := range arr {
                                fields := strings.Fields(val)
                                if fields[0] == "timewait" {
                                        timewait_arr := strings.Split(fields[1], "/")
                                        m["timewait"], _ = strconv.ParseUint(timewait_arr[0], 10, 64)
                                        m["slabinfo.timewait"], _ = strconv.ParseUint(timewait_arr[1], 10, 64)
                                        continue
                                }
                                m[fields[0]], _ = strconv.ParseUint(fields[1], 10, 64)
                        }
                        return

ss -s on Fedora returns:

Total: 843
TCP:   89 (estab 56, closed 11, orphaned 0, timewait 2)

Transport Total     IP        IPv6
RAW	  1         0         1        
UDP	  8         5         3        
TCP	  78        48        30       
INET	  87        53        34       
FRAG	  0         0         0

while on CentOS, it returns:

Total: 525 (kernel 0)
TCP:   14 (estab 8, closed 0, orphaned 0, synrecv 0, timewait 0/0), ports 0

Transport Total     IP        IPv6
*	  0         -         -        
RAW	  0         0         0        
UDP	  7         4         3        
TCP	  14        11        3        
INET	  21        15        6        
FRAG	  0         0         0

So, it always crashes on Fedora with:

panic: runtime error: index out of range
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant