GNU GCC 15 fails on musttail in LibWasm/AbstractMachine/BytecodeInterpreter.cpp
Testing ladybird on Ubuntu 25.10 and it has GNU GCC 15 out of the box.
$ g++ --version
g++ (Ubuntu 15.2.0-4ubuntu4) 15.2.0
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Getting this error in profiles Sanitizer, Debug and All_Debug. Release seems to be fine. Distribution I'm not sure yet, as it has a different issue with delete operator in AK/RefCounted.h
-- Configuring done (8.7s)
-- Generating done (1.3s)
-- Build files have been written to: /home/bobo/projects/ladybird/Build/debug
ninja: Entering directory `/home/bobo/projects/ladybird/Build/debug'
[1157/3813] Building CXX object Lagom/Libraries/LibWasm/CMakeFiles/LibWasm.dir/AbstractMachine/BytecodeInterpreter.cpp.o
FAILED: Lagom/Libraries/LibWasm/CMakeFiles/LibWasm.dir/AbstractMachine/BytecodeInterpreter.cpp.o
/usr/bin/ccache /usr/bin/c++ -DENABLE_COMPILETIME_FORMAT_CHECK -DLibWasm_EXPORTS -D_FILE_OFFSET_BITS=64 -I/home/bobo/projects/ladybird -I/home/bobo/projects/ladybird/Services -I/home/bobo/projects/ladybird/Libraries -I/home/bobo/projects/ladybird/Build/debug/Lagom -I/home/bobo/projects/ladybird/Build/debug/Lagom/Services -I/home/bobo/projects/ladybird/Build/debug/Lagom/Libraries -I/home/bobo/projects/ladybird/Meta/Lagom/../.. -I/home/bobo/projects/ladybird/Meta/Lagom/../../Libraries -I/home/bobo/projects/ladybird/Meta/Lagom/../../Services -I/home/bobo/projects/ladybird/Build/debug -isystem /home/bobo/projects/ladybird/Build/debug/vcpkg_installed/x64-linux-dynamic/include -g -std=c++23 -fPIC -fdiagnostics-color=always -march=native -Wall -Wextra -fno-exceptions -ffp-contract=off -Wcast-qual -Wformat=2 -Wimplicit-fallthrough -Wlogical-op -Wmissing-declarations -Wmissing-field-initializers -Wsuggest-override -Wno-invalid-offsetof -Wno-unknown-warning-option -Wno-unused-command-line-argument -Werror -Wno-expansion-to-defined -Wno-literal-suffix -Wno-unqualified-std-cast-call -Wvla -Wno-array-bounds -Wno-stringop-overflow -Wno-dangling-reference -fno-semantic-interposition -fvisibility-inlines-hidden -fstack-protector-strong -fstrict-flex-arrays=2 -Wno-maybe-uninitialized -Wno-shorten-64-to-32 -fsigned-char -ggnu-pubnames -ggdb3 -Og -fvisibility=hidden -MD -MT Lagom/Libraries/LibWasm/CMakeFiles/LibWasm.dir/AbstractMachine/BytecodeInterpreter.cpp.o -MF Lagom/Libraries/LibWasm/CMakeFiles/LibWasm.dir/AbstractMachine/BytecodeInterpreter.cpp.o.d -o Lagom/Libraries/LibWasm/CMakeFiles/LibWasm.dir/AbstractMachine/BytecodeInterpreter.cpp.o -c /home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp: In static member function ‘static Wasm::Outcome Wasm::InstructionHandler<28>::operator()(Wasm::BytecodeInterpreter&, Wasm::Configuration&, const Wasm::Instruction*, Wasm::SourcesAndDestination, u64, const Wasm::Dispatch*) [with bool HasDynamicInsnLimit = false; Continue = Wasm::Continue]’:
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:154:44: error: address of automatic variable ‘rhs’ can escape to ‘musttail’ call [-Werror=maybe-musttail-local-addr]
154 | #define continue_(...) Continue::operator()(__VA_ARGS__)
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:1934:21: note: in expansion of macro ‘continue_’
1934 | TAILCALL return continue_(HANDLER_PARAMS(DECOMPOSE_PARAMS_NAME_ONLY));
| ^~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp: In static member function ‘static Wasm::Outcome Wasm::InstructionHandler<27>::operator()(Wasm::BytecodeInterpreter&, Wasm::Configuration&, const Wasm::Instruction*, Wasm::SourcesAndDestination, u64, const Wasm::Dispatch*) [with bool HasDynamicInsnLimit = false; Continue = Wasm::Continue]’:
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:154:44: error: address of automatic variable ‘rhs’ can escape to ‘musttail’ call [-Werror=maybe-musttail-local-addr]
154 | #define continue_(...) Continue::operator()(__VA_ARGS__)
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:1923:21: note: in expansion of macro ‘continue_’
1923 | TAILCALL return continue_(HANDLER_PARAMS(DECOMPOSE_PARAMS_NAME_ONLY));
| ^~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp: In static member function ‘static Wasm::Outcome Wasm::InstructionHandler<18230571291595767890>::operator()(Wasm::BytecodeInterpreter&, Wasm::Configuration&, const Wasm::Instruction*, Wasm::SourcesAndDestination, u64, const Wasm::Dispatch*) [with bool HasDynamicInsnLimit = false; Continue = Wasm::Continue]’:
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:154:44: error: address of automatic variable ‘true_vector’ can escape to ‘musttail’ call [-Werror=maybe-musttail-local-addr]
154 | #define continue_(...) Continue::operator()(__VA_ARGS__)
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:2659:21: note: in expansion of macro ‘continue_’
2659 | TAILCALL return continue_(HANDLER_PARAMS(DECOMPOSE_PARAMS_NAME_ONLY));
| ^~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp: In static member function ‘static Wasm::Outcome Wasm::InstructionHandler<18230571291595767891>::operator()(Wasm::BytecodeInterpreter&, Wasm::Configuration&, const Wasm::Instruction*, Wasm::SourcesAndDestination, u64, const Wasm::Dispatch*) [with bool HasDynamicInsnLimit = false; Continue = Wasm::Continue]’:
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:154:44: error: address of automatic variable ‘vector’ can escape to ‘musttail’ call [-Werror=maybe-musttail-local-addr]
154 | #define continue_(...) Continue::operator()(__VA_ARGS__)
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:2666:21: note: in expansion of macro ‘continue_’
2666 | TAILCALL return continue_(HANDLER_PARAMS(DECOMPOSE_PARAMS_NAME_ONLY));
| ^~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp: In static member function ‘static Wasm::Outcome Wasm::InstructionHandler<69>::operator()(Wasm::BytecodeInterpreter&, Wasm::Configuration&, const Wasm::Instruction*, Wasm::SourcesAndDestination, u64, const Wasm::Dispatch*) [with bool HasDynamicInsnLimit = false; Continue = Wasm::Continue]’:
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:154:44: error: address of parameter ‘addresses’ can escape to ‘musttail’ call [-Werror=maybe-musttail-local-addr]
154 | #define continue_(...) Continue::operator()(__VA_ARGS__)
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:1941:21: note: in expansion of macro ‘continue_’
1941 | TAILCALL return continue_(HANDLER_PARAMS(DECOMPOSE_PARAMS_NAME_ONLY));
| ^~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp: In static member function ‘static Wasm::Outcome Wasm::InstructionHandler<70>::operator()(Wasm::BytecodeInterpreter&, Wasm::Configuration&, const Wasm::Instruction*, Wasm::SourcesAndDestination, u64, const Wasm::Dispatch*) [with bool HasDynamicInsnLimit = false; Continue = Wasm::Continue]’:
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:154:44: error: address of parameter ‘addresses’ can escape to ‘musttail’ call [-Werror=maybe-musttail-local-addr]
154 | #define continue_(...) Continue::operator()(__VA_ARGS__)
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:1948:21: note: in expansion of macro ‘continue_’
1948 | TAILCALL return continue_(HANDLER_PARAMS(DECOMPOSE_PARAMS_NAME_ONLY));
| ^~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp: In static member function ‘static Wasm::Outcome Wasm::InstructionHandler<71>::operator()(Wasm::BytecodeInterpreter&, Wasm::Configuration&, const Wasm::Instruction*, Wasm::SourcesAndDestination, u64, const Wasm::Dispatch*) [with bool HasDynamicInsnLimit = false; Continue = Wasm::Continue]’:
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:154:44: error: address of parameter ‘addresses’ can escape to ‘musttail’ call [-Werror=maybe-musttail-local-addr]
154 | #define continue_(...) Continue::operator()(__VA_ARGS__)
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:1955:21: note: in expansion of macro ‘continue_’
1955 | TAILCALL return continue_(HANDLER_PARAMS(DECOMPOSE_PARAMS_NAME_ONLY));
| ^~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp: In static member function ‘static Wasm::Outcome Wasm::InstructionHandler<72>::operator()(Wasm::BytecodeInterpreter&, Wasm::Configuration&, const Wasm::Instruction*, Wasm::SourcesAndDestination, u64, const Wasm::Dispatch*) [with bool HasDynamicInsnLimit = false; Continue = Wasm::Continue]’:
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:154:44: error: address of parameter ‘addresses’ can escape to ‘musttail’ call [-Werror=maybe-musttail-local-addr]
154 | #define continue_(...) Continue::operator()(__VA_ARGS__)
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:1962:21: note: in expansion of macro ‘continue_’
1962 | TAILCALL return continue_(HANDLER_PARAMS(DECOMPOSE_PARAMS_NAME_ONLY));
| ^~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp: In static member function ‘static Wasm::Outcome Wasm::InstructionHandler<73>::operator()(Wasm::BytecodeInterpreter&, Wasm::Configuration&, const Wasm::Instruction*, Wasm::SourcesAndDestination, u64, const Wasm::Dispatch*) [with bool HasDynamicInsnLimit = false; Continue = Wasm::Continue]’:
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:154:44: error: address of parameter ‘addresses’ can escape to ‘musttail’ call [-Werror=maybe-musttail-local-addr]
154 | #define continue_(...) Continue::operator()(__VA_ARGS__)
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:1969:21: note: in expansion of macro ‘continue_’
1969 | TAILCALL return continue_(HANDLER_PARAMS(DECOMPOSE_PARAMS_NAME_ONLY));
| ^~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp: In static member function ‘static Wasm::Outcome Wasm::InstructionHandler<74>::operator()(Wasm::BytecodeInterpreter&, Wasm::Configuration&, const Wasm::Instruction*, Wasm::SourcesAndDestination, u64, const Wasm::Dispatch*) [with bool HasDynamicInsnLimit = false; Continue = Wasm::Continue]’:
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:154:44: error: address of parameter ‘addresses’ can escape to ‘musttail’ call [-Werror=maybe-musttail-local-addr]
154 | #define continue_(...) Continue::operator()(__VA_ARGS__)
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:1976:21: note: in expansion of macro ‘continue_’
1976 | TAILCALL return continue_(HANDLER_PARAMS(DECOMPOSE_PARAMS_NAME_ONLY));
| ^~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp: In static member function ‘static Wasm::Outcome Wasm::InstructionHandler<75>::operator()(Wasm::BytecodeInterpreter&, Wasm::Configuration&, const Wasm::Instruction*, Wasm::SourcesAndDestination, u64, const Wasm::Dispatch*) [with bool HasDynamicInsnLimit = false; Continue = Wasm::Continue]’:
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:154:44: error: address of parameter ‘addresses’ can escape to ‘musttail’ call [-Werror=maybe-musttail-local-addr]
154 | #define continue_(...) Continue::operator()(__VA_ARGS__)
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/bobo/projects/ladybird/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp:1983:21: note: in expansion of macro ‘continue_’
1983 | TAILCALL return continue_(HANDLER_PARAMS(DECOMPOSE_PARAMS_NAME_ONLY));
| ^~~~~~~~~
adding a more complete output
If I change the code slightly to not use musttail with GCC 15, I don't get any other issues in Sanitizer, Debug, and All_Debug profiles. This is the only issue for those profiles.
Hi @alimpfard, just wanted to highlight this issue to you as I know this is one of your areas of expertise. Don't know if you have any quick idea at what it could be. If it is a problem with GCC 15 or maybe something wrong in Ladybird.
Oh, sorry I missed this initially.
We should really just disable -Wmaybe-musttail-local-addr, I'll take a look at the errors but the "addresses can leak into tailcall" one is just stupid when that object is a formal parameter :P
No worries. If you want me to test something, just say so.