mattn/go-ieproxy

Panic when fetching proxy config on macOS 12.3.1

laurazard opened this issue · 4 comments

On an M1 MacBook Pro, macOS 12.3.1:

Whether using ieproxy.GetConf() or the provided ieproxy.GetProxyFunc(), I can reliably get it to panic. Disabling wifi and re-enabling it fixes it for a moment, but enabling/disabling proxies in the network settings panel and rerunning the code gets it to a state where it consistently panics on the same line.

Stacktrace:

goroutine 4 [syscall]:
runtime.cgocall(0x1049958c8, 0x14000052c28)
        /opt/homebrew/Cellar/go/1.17.6/libexec/src/runtime/cgocall.go:156 +0x50 fp=0x14000052bf0 sp=0x14000052bb0 pc=0x10472eea0
github.com/mattn/go-ieproxy._Cfunc_CFNumberGetValue(0x0, 0x9, 0x14000018d88)
        _cgo_gotypes.go:191 +0x44 fp=0x14000052c20 sp=0x14000052bf0 pc=0x104984bb4
github.com/mattn/go-ieproxy.cfNumberGetGoInt.func1(0x0, 0x14000018d88)
        [...removed]/github.com/mattn/go-ieproxy/ieproxy_darwin.go:43 +0x78 fp=0x14000052c50 sp=0x14000052c20 pc=0x104985248
github.com/mattn/go-ieproxy.cfNumberGetGoInt(0x0)
        [...removed]/github.com/mattn/go-ieproxy/ieproxy_darwin.go:43 +0x40 fp=0x14000052c80 sp=0x14000052c50 pc=0x1049851a0
github.com/mattn/go-ieproxy.writeConf()
        [...removed]/github.com/mattn/go-ieproxy/ieproxy_darwin.go:76 +0x27c fp=0x14000052d80 sp=0x14000052c80 pc=0x10498569c
sync.(*Once).doSlow(0x104c92f30, 0x104a7b5d8)
        /opt/homebrew/Cellar/go/1.17.6/libexec/src/sync/once.go:68 +0x10c fp=0x14000052dd0 sp=0x14000052d80 pc=0x10479de9c
sync.(*Once).Do(...)
        /opt/homebrew/Cellar/go/1.17.6/libexec/src/sync/once.go:59
github.com/mattn/go-ieproxy.getConf(...)
        [...removed]/github.com/mattn/go-ieproxy/ieproxy_darwin.go:23
github.com/mattn/go-ieproxy.GetConf(...)
        [...removed]/github.com/mattn/go-ieproxy/ieproxy.go:36

Looks like this has already been fixed, but no tag has been made since the fix -- it would be nice to make one, otherwise people will bump into this same as me. @mattn ?

mattn commented

okay, wull tag in later.

mattn commented

Tagged just now.

network