Skip to content

magicsock: panic: call to ReSTUN before Start #2733

@crawshaw

Description

@crawshaw

Seen at b49d9bc in the CI VM test running on Ubuntu 20.04:

logtail started
Program starting: vdate.20210823, Go 1.17: []string{"/usr/sbin/tailscaled", "--cleanup"}
LogID: 333d9c9a1e8cbdeba58720e2e47eecf61dfec4db66da75565ce0a2fcd55f6bdd
logpolicy: using $STATE_DIRECTORY, "/var/lib/tailscale"
ale/tailscaled.log.conf: open /var/lib/tailscale/tailscaled.log.conf: no such file or directory
dns: [rc=resolved nm=no ret=*dns.resolvedManager]
creating dns cleanup: route ip+net: no such network interface
flushing log.
logger closing down
logtail: dialed "143.198.143.59:40025" in 16ms
logtail started
Program starting: vdate.20210823, Go 1.17: []string{"/usr/sbin/tailscaled", "--state=/var/lib/tailscale/tailscaled.state", "--socket=/run/tailscale/tailscaled.sock", "--port", "41641"}
LogID: 333d9c9a1e8cbdeba58720e2e47eecf61dfec4db66da75565ce0a2fcd55f6bdd
logpolicy: using $STATE_DIRECTORY, "/var/lib/tailscale"
wgengine.NewUserspaceEngine(tun "tailscale0") ...
logtail: dialed "143.198.143.59:40025" in 9ms
router: v6nat = true
dns: [rc=resolved nm=no ret=*dns.resolvedManager]
dns: using *dns.resolvedManager
link state: interfaces.State{defaultRoute=enp0s2 ifs={enp0s2:[10.0.2.15/24 fec0::8828:5cff:fe30:1f25/64]} v4=true v6=false}
Creating wireguard device...
Bringing wireguard device up...
UDP bind has been updated
Interface state was Down, requested Up, now Up
Bringing router up...
Routine: receive incoming v4 - started
Routine: receive incoming v6 - started
external route: up
Routine: receive incoming receiveDERP - started
Clearing router settings...
Starting link monitor...
Starting magicsock...
monitor: RTM_NEWROUTE: src=, dst=ff00::/8, gw=, outif=3, table=255
monitor: RTM_NEWROUTE: src=, dst=fe80::/64, gw=, outif=3, table=254
monitor: RTM_NEWROUTE: src=, dst=fe80::3a08:25bf:f69e:21c1/128, gw=, outif=3, table=255
LinkChange: minor
panic: call to ReSTUN before Start

goroutine 19 [running]:
tailscale.com/wgengine/magicsock.(*Conn).ReSTUN(0xc000128840, {0xab442d, 0x0})
    /root/repo/tailscale/wgengine/magicsock/magicsock.go:2547 +0x3dc
tailscale.com/wgengine.(*userspaceEngine).linkChange(0xc000122900, 0x0, 0xc000094050)
    /root/repo/tailscale/wgengine/userspace.go:1129 +0x3a8
tailscale.com/wgengine.NewUserspaceEngine.func1(0xd, 0xc00016e000)
    /root/repo/tailscale/wgengine/userspace.go:282 +0x3f
created by tailscale.com/wgengine/monitor.(*Mon).debounce
    /root/repo/tailscale/wgengine/monitor/monitor.go:328 +0x565

Not particularly easy to reproduce, one of hundreds of runs over many hours.

cc @danderson @bradfitz

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions