halo / macosvpn

:wrench: Create macOS VPNs programmatically (L2TP & Cisco)
Other
442 stars 72 forks source link

segmentation fault #44

Closed geekgao closed 4 years ago

geekgao commented 4 years ago

Self compile and execute has error:

Processing argument slice: ["--l2tp", "ovpn", "--endpoint", "xx.xx.xx.xxx", "--username", "vpnuser", "--password", "JJJJJJJJJ", "--sharedsecret", "3EG2"] Parsing arguments for service... Parsing succeeded, 0 arguments unaccounted for. You did not pass in any invalid arguments Converting arguments to L2TP ServiceConfig... Conversion succeeded. You wish to create one or more VPN service(s) Obtaining Authorization... Authorization successfully obtained Gained superhuman rights. Initializing L2TP Interface on top of IPv4... [1] 70937 segmentation fault sudo ./macosvpn create --l2tp ...

But the version from brew that's ok.

halo commented 4 years ago

Wait a minute, I remember having had the same problem for a whole day and did not understand why. Since all tests were passing on Travis, I guessed that the problem had to be on my computer. I remember that I cleaned the Xcode cache ⌥⇧⌘K and even restarted my laptop. Then it worked again.

Let's check the obvious first:

The reason why I was so confused when this happened to me is because this line is where it crashes:

https://github.com/halo/macosvpn/blob/73178a3c72d39a1cf21fddaee5bc1ca1bc24b9e4/macosvpn/Classes/NetworkInterface.Initialize.swift#L26

As you can see there is nothing special about that line. It's a normal system command and there are no arguments passed in, only system constants. There is no reason why this command should fail. That led me to the conclusion that I must restart my computer because my operating system must be confused about the network preferences state.

If I come up with anything else, I'll let you know. The good news is that I had the same problem and it was only temporary.

halo commented 4 years ago

I'll close this for now. Feel free to re-open this issue if you feel this is a persisting problem.

Thanks for reporting it!