Go runtime: ppc64x binaries randomly segfault on linux 5.13rc6 (#46803)

Bug #1943447 reported by Frank Heimes
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Ubuntu-power-systems project
Fix Released
Undecided
Ubuntu on IBM Power Systems Bug Triage
golang (Ubuntu)
Fix Released
Undecided
bugproxy

Bug Description

https://github.com/golang/go/issues/46803
(https://go-review.googlesource.com/c/go/+/328110/)
This seems to be a somehow older issue, since we noticed this discussion on 5.11:
https://<email address hidden>/

Issue where the 5.13 kernel makes binaries built with Go before 1.15.15, 1.16.7, 1.17 prone to crashing when they receive a signal. The upstream bug report is here https://github.com/golang/go/issues/46803 but the issue is that the vDSO (virtual dynamic shared object) functions in 5.13 now touch r30 -- of course they preserve it, but before 5.13 they didn't touch it at all and the Go runtime assumed that if a signal arrived during a vDSO function the value it had stored in r30 was still valid.

We made sure that everything works on Impish and rebuilt all Go binaries - so impish (and newer) is fine; since for impish we added the above kernel patch (the one discussed in the lkml) to our Ubuntu kernel 5.13.0-16.16:
 fe57d86f7c3f ("powerpc/vdso: Don't use r30 to avoid breaking Go lang")

But we are still a bit concerned about older kernels / potential backports needed,
since this could be an issue with running older containers on newer hosts, and it potentially can be an issue for snaps, too.

Tags: ppc64el
Frank Heimes (fheimes)
affects: libpmemobj-cpp (Ubuntu) → golang (Ubuntu)
Changed in ubuntu-power-systems:
assignee: nobody → Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage)
Changed in golang (Ubuntu):
assignee: nobody → bugproxy (bugproxy)
Changed in ubuntu-power-systems:
status: New → Opinion
Changed in golang (Ubuntu):
status: New → Opinion
Frank Heimes (fheimes)
description: updated
tags: added: ppc64el
Revision history for this message
Krzysztof Kozlowski (krzk) wrote :

Hirsute/linux (and other v5.11 derivatives) got it as well via stable updates. Kernels older than v5.11 do not have commit switching vDSO to generic implementation (which can touch r30), therefore should not be affected.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote (last edit ):

The fix for hirsute is in proposed already and will be released fairly soon (I don't completely follow the kernel SRU cycle)

Revision history for this message
Frank Heimes (fheimes) wrote :

Okay, so to clean this up:
Commit:
fe57d86f7c3f ("powerpc/vdso: Don't use r30 to avoid breaking Go lang")
landed in impish / 21.10 starting with kernel:
Ubuntu-5.13.0-15
and we rae currently at level:
linux-generic | 5.13.0.16
hence it's already in impish's release pocket
and I can close this as Fix Released.

According to Krzysztof's comment the concerns about older versions are causeless, since
Kernels older than v5.11 do not have commit switching vDSO to generic implementation (which can touch r30), and should therefore not be affected.

Changed in golang (Ubuntu):
status: Opinion → Fix Released
Changed in ubuntu-power-systems:
status: Opinion → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.