Open pvbouwel opened 6 months ago
Hello,
FYI, the support of Traefik v2.10 has ended in 2024/02 https://doc.traefik.io/traefik/deprecation/releases/ The Traefik security issues are only fixed on v2.11 and v3.0.
Traefik v2.10 uses an old version of yaegi and go1.20 (currently, the Go team supports only go1.21 and go1.22)
I think that the segfault comes from a divergence between the min Go required of yaegi v0.15 (go1.19/go1.20), the version of Go used by Traefik v2.10 (go1.20), and the Go version required by your plugin (go1.22.2).
I recommend migration from zap
to slog
because it's the new standard way to use structured logs.
I also highly recommend migrating to, at least, Traefik v2.11.
Thank you for the quick feedback. Yes, upgrade is necessary and one of the reasons of reporting this as it was unclear what would be a viable upgrade strategy. Thank you for the suggestion of slog, that could be the way forward for us.
Because I suspected the old Traefik version I did try with plain yaegi locally so the stacktrace in this ticket is really from an installation using go install github.com/traefik/yaegi/cmd/yaegi@v0.16.1
@pvbouwel said:
Because I suspected the old Traefik version I did try with plain yaegi locally so the stacktrace in this ticket is really from an installation using go install github.com/traefik/yaegi/cmd/yaegi@v0.16.1
The stack trace ends with
github.com/traefik/yaegi/interp.nodeType2(0xc00018e908, 0xc00067e750, 0xc000522500, {0xc000595220, 0x3, 0x4}) /home/peter/go/pkg/mod/github.com/traefik/yaegi@v0.16.1/interp/type.go:1083 +0x3aff
Lines 1079-1083 of interp/type.go
are:
https://github.com/traefik/yaegi/blob/v0.16.1/interp/type.go#L1079-L1083
typ, err := nodeType2(interp, sc, c.child[l-1], seen)
if err != nil {
return nil, err
}
incomplete = incomplete || typ.incomplete
So we get typ, err
from a recursive call of nodetype2
on 1079, there's no error, and the nil pointer is from dereferencing typ
on 1083.
I believe this is an instance (not a dup, exactly, since this issue actually has a test case) of https://github.com/traefik/yaegi/issues/1636.
We have successfully moved to slog and are now transitioning to traefik v3.0.1 so we are not having any further impact from this.
I understand from the update of theclapp it might be useful to still track it separately so I'll leave the decision to close this issue to a maintainer.
The following program
uber.go
triggers an unexpected resultExpected result
Got
Yaegi Version
0.16.1
Additional Notes
We had been using an older version of zap successfully in a custom traefik plugin but that version stops working from traefik v2.11.1 onwards. For the traefik version we are on (v2.10.1) zap v1.23.0 works but newer versions of zap do not. So in summary: