sord segfaults on s390x / ppc64el - related to gcc-10.2 optimizations

Bug #1911142 reported by Christian Ehrhardt 
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-10 (Ubuntu)
Invalid
Undecided
Unassigned
sord (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Sord has issues on these platforms if built with a recent toolchain.
I reported it upstream as I got good workarounds but failed to spot the root cause.
See: https://gitlab.com/drobilla/sord/-/issues/1

The effect in Ubuntu is that packages using sort can segfault on free.
Currently this blocks https://launchpad.net/ubuntu/+source/gst-plugins-bad1.0/1.18.2-1ubuntu2
as it runs:
$ /usr/lib/s390x-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-codec-info-1.0 debian/gstreamer1.0-plugins-bad/usr/lib/s390x-linux-gnu/gstreamer-1.0/libgstlv2.so

That segfaults then.
I've found that it works:
- with gcc-9
- on x86/armhf/arm64/riscv64
- with -fno-schedule-insns -fno-schedule-insns2 set

This could be either gcc-10 being too aggressive or (more likely) an issue in sord that is hard to see and not triggered up to now, but exposed by the new optimizations.
I'll file this against sord (to track the mitigation upload, as well as any discussion and point to upstream) as well as gcc-10 (since we have seen a bunch of those 'fails due to new toolchain') in case there is something in the toolchain to fix.

Steps to reproduce in Hirsute-proposed
$ sudo apt install gstreamer1.0-plugins-bad libgstreamer1.0-dev
$ /usr/lib/powerpc64le-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-codec-info-1.0 /usr/lib/powerpc64le-linux-gnu/gstreamer-1.0/libgstlv2.so
gst-codec-info-1.0: ../src/zix/btree.c:716: zix_btree_get: Assertion `frame->node' failed.
Aborted (core dumped)

In the upstream bug I outlined how to (re)compile sord as needed for any experiments.
=> https://gitlab.com/drobilla/sord/-/issues/1

A Test PPA which had various iterations of trying to be surgical with the change (well, more surgical than global -O1) is at: https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/4392

Changed in sord (Ubuntu):
status: New → In Progress
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

We've found the fix in the upstream discussion.
gcc is not more a suspect :-)
Uploading a fix to unblock gst-plugins in Hirsute.

Since this is upstream it will be able to be a sync soon again.

Changed in gcc-10 (Ubuntu):
status: New → Invalid
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Tests from PPA and LP build were ok, uploaded as https://launchpad.net/ubuntu/+source/sord/0.16.6-1ubuntu1 which - once ready - will unblock https://launchpad.net/ubuntu/+source/gst-plugins-bad1.0/1.18.2-1ubuntu2 (I'll trigger a rebuild then)

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sord - 0.16.6-1ubuntu1

---------------
sord (0.16.6-1ubuntu1) hirsute; urgency=medium

  * d/p/0001-Fix-crash-with-optimized-builds-with-GCC-10.1.0.patch
    avoid crashes with optimized builds. Those were especially present
    on s390x/ppc64el around gstreamer (LP: #1911142)

 -- Christian Ehrhardt <email address hidden> Tue, 12 Jan 2021 12:33:51 +0100

Changed in sord (Ubuntu):
status: In Progress → 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.