Skip to content

Wrong code generated with -fextend-variable-liveness and coroutines #163007

@avikivity

Description

@avikivity

In main (51db3c9) and clang 21.1.2 there is a regression with -fextend-variable-liveness and coroutines. I bisected it to 36af734, which makes -fextend-variable-liveness the default under -Og.

The bug manifests in a use-after-free running some coroutine.

Reproducer: (warning: very long)

podman run -it docker.io/avikivity/scylladb-fextend-variable-tracking-reproducer

This drops you into an environment with clang 21.1.2 with the reproducer code and all its dependencies. It is derived from Fedora 43 beta. You can substitute docker for podman if that's what you have.

./configure.py --mode debug
ninja build/debug/test/boost/combined_tests_g
./build/debug/test/boost/combined_tests_g -t restrictions_test -- --smp 1

To add flags to the compiler, append to the ./configure.py line:

./configure.py --mode debug --cflags=-fextend-variable-liveness=none

Which ought to make the crash go away (will confirm soon).

/cc @SLTozer

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions