Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Goodhosts issues on OSX #16

@Mte90

Description

@Mte90

We are getting some crashes on OSX.

==> default: Issue executing goodhosts CLI: panic: runtime error: slice bounds out of range [381:379]
==> default: 
==> default: goroutine 1 [running]:
==> default: github.com/goodhosts/hostsfile.(*Hosts).removeByPosition(...)
==> default: 	/home/runner/go/pkg/mod/github.com/goodhosts/[email protected]/hosts.go:297
==> default: github.com/goodhosts/hostsfile.(*Hosts).combineIp(0xc0000d9ac8, 0xc0000145e0, 0x7)
==> default: 	/home/runner/go/pkg/mod/github.com/goodhosts/[email protected]/hosts.go:285 +0x582
==> default: github.com/goodhosts/hostsfile.(*Hosts).RemoveDuplicateIps(0xc0000d9ac8)
==> default: 	/home/runner/go/pkg/mod/github.com/goodhosts/[email protected]/hosts.go:224 +0x1f3
==> default: github.com/goodhosts/hostsfile.(*Hosts).Clean(0xc0000d9ac8)
==> default: 	/home/runner/go/pkg/mod/github.com/goodhosts/[email protected]/hosts.go:130 +0x40
==> default: github.com/goodhosts/cli/cmd.remove(0xc00001ea00, 0x3, 0x4)
==> default: 	/home/runner/work/cli/cli/cmd/remove.go:75 +0x7f3
==> default: github.com/urfave/cli/v2.(*Command).Run(0xc0000127e0, 0xc00001e840, 0x0, 0x0)
==> default: 	/home/runner/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:161 +0x4b9
==> default: github.com/urfave/cli/v2.(*App).RunContext(0xc000001200, 0x127d980, 0xc00001a080, 0xc000010050, 0x5, 0x5, 0x0, 0x0)
==> default: 	/home/runner/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:302 +0x790
==> default: github.com/urfave/cli/v2.(*App).Run(...)
==> default: 	/home/runner/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:211
==> default: main.main()
==> default: 	/home/runner/work/cli/cli/main.go:55 +0x48e

Seems the line with the issue is https://github.com/goodhosts/hostsfile/blob/master/hosts.go#L297

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions