This is an archive of the discontinued LLVM Phabricator instance.

[libc++][format] Implements string escaping.
ClosedPublic

Authored by Mordante on Sep 16 2022, 6:19 AM.

Details

Summary

Implements parts of

  • P2286R8 Formatting Ranges

Diff Detail

Event Timeline

Mordante created this revision.Sep 16 2022, 6:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 16 2022, 6:19 AM
Mordante updated this revision to Diff 460731.Sep 16 2022, 6:37 AM

Fixes CI and minor improvement.

Mordante updated this revision to Diff 460745.Sep 16 2022, 7:12 AM

Fixes CI.

Mordante updated this revision to Diff 460982.Sep 17 2022, 2:25 AM

Fixes CI and some cleanups.

Mordante updated this revision to Diff 460997.Sep 17 2022, 5:58 AM

CI fixes.

Mordante published this revision for review.Sep 17 2022, 11:49 AM
Mordante added reviewers: ldionne, vitaut.
Mordante added inline comments.
libcxx/test/std/utilities/format/format.functions/escaped_output.unicode.pass.cpp
166

Note example s4 is wrong in P2286, but has been corrected in the WP.
https://github.com/cplusplus/draft/pull/5751

Herald added a project: Restricted Project. · View Herald TranscriptSep 17 2022, 11:49 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Mordante added inline comments.Sep 17 2022, 12:01 PM
libcxx/test/std/utilities/format/format.functions/escaped_output.ascii.pass.cpp
35

As mentioned in D134031 this should be a function and not a lambda.

Mordante updated this revision to Diff 464556.Oct 2 2022, 8:40 AM

Improves handling of ill-formed Unicode.

Mordante updated this revision to Diff 464565.Oct 2 2022, 11:08 AM

Attempts to fix CI.

Mordante updated this revision to Diff 464693.Oct 3 2022, 8:23 AM

CI fixes.

Mordante updated this revision to Diff 464713.Oct 3 2022, 9:19 AM

Attempt to fix CI.

Overall, this looks really good to me. I think I spotted an issue with handling of ill-formed UTF-16 though. The code also appears to assume that characters in the ASCII range have the same value for all CharT types. In general, that is not true. For Clang specifically that would not be true when targeting an EBCDIC-based platform (unless wchar_t is for a wide-EBCDIC variant in that case? But even then, there would be mismatches for char8_t, char16_t and char32_t though specification for those types is currently lacking).

libcxx/include/__format/formatter_output.h
446

I think these case statements should use _LIBCPP_STATICALLY_WIDEN or similar as there is no guarantee that the wchar_t value for \t is the same as for char.

517–519

__consume_p2286() has a condition where a __consume_p2286_result value is returned with __ill_formed_size equal to 2 that would appear to violate the assertion here. The assertion of 1 is also at odds with the comment and the need for the following loop. I suspect this is intended to assert a value of either 1 or 2. If so, this implies a missing test case.

libcxx/include/__format/unicode.h
279–282

If the second code unit is not in the low surrogate range, than it is necessarily in the BMP or high surrogate range in which case, it may begin the next character. This should probably be handled as a single ill-formed code unit (in which case, there is interaction with some of my other comments).

282

There is an assertion of __ill_formed_size == 1 in __escape() for the sizeof(CharT)==2 case that would appear to be violated here.

Mordante updated this revision to Diff 465021.Oct 4 2022, 8:23 AM

CI fixes and adresses review comments.

tahonermann added inline comments.Oct 10 2022, 2:20 PM
libcxx/include/__format/formatter_output.h
446

Any further thoughts on this? Or is there an existing libc++ policy that requires that characters that can be represented in a single code unit in both the ordinary and wide literal encodings must have the same value? If there is, I expect that policy will have to be revisited if -fexec-charset is expanded to include additional encodings like IBM-1047 as was proposed in D93031.

517–519

The changes made address most of the concern I raised, but if __ill_formed_size can only be 1, then there is no need for the for loop.

Mordante updated this revision to Diff 468224.Oct 17 2022, 8:53 AM

Attempt to get better CI output.

Mordante marked 6 inline comments as done.Oct 17 2022, 11:04 AM

Thanks for the review @tahonermann. Seems I didn't submit my replies before.

libcxx/include/__format/formatter_output.h
446

Thanks for the additional link. The assumption _CharT('\t') that works correctly is hard-coded in several places in libc++ (not limited to the format library). I think it's good to address this, but I prefer to do it in a separate review. I really want to look at how we're going to do that properly and properly test it.

(I expect we need a CI job where we use different encodings for char and wchar_t.)

517–519

Thanks!

libcxx/test/std/utilities/format/format.functions/escaped_output.ascii.pass.cpp
35

Edit that won't work in these kind of tests.

Mordante updated this revision to Diff 468280.Oct 17 2022, 11:41 AM
Mordante marked 2 inline comments as done.

Rebased, fix CI, and address review comment.

tahonermann added inline comments.Oct 17 2022, 1:43 PM
libcxx/include/__format/formatter_output.h
446

Doing so separately makes sense to me. And I agree that a CI job is needed once a solution is in place.

ldionne accepted this revision as: Restricted Project.Oct 18 2022, 9:29 AM

I did not look at the algorithms used in detail, but the overall shape LGTM. I'm happy if tests are passing and @tahonermann is happy. Unblocking libc++ review, @tahonermann please let @Mordante know once you're satisfied!

Thanks!

libcxx/include/__format/formatter_output.h
388

?

446

Or is there an existing libc++ policy that requires that characters that can be represented in a single code unit in both the ordinary and wide literal encodings must have the same value?

There is no policy, however like @Mordante this is used everywhere. I am somewhat skeptical of the value of supporting that -- I'd have to see the cost/benefit of supporting that to really form an opinion. In all cases, IMO supporting this shouldn't be a concern in this patch, since we don't anywhere else.

libcxx/utils/generate_escaped_output_table.py
339

Any reason to keep the MSVC_ prefix here?

tahonermann accepted this revision.Oct 18 2022, 10:43 AM

@tahonermann please let @Mordante know once you're satisfied!

I'm satisfied!

This revision is now accepted and ready to land.Oct 18 2022, 10:43 AM
Mordante updated this revision to Diff 468643.Oct 18 2022, 11:49 AM
Mordante marked an inline comment as done.

Rebased, address review comments, and fix CI.

Mordante marked an inline comment as done.Oct 18 2022, 11:50 AM

Thanks for the reviews!

libcxx/include/__format/formatter_output.h
388

Nice catch!

h-vetinari added inline comments.
libcxx/utils/ci/run-buildbot
190

Seems there's a tab-vs-spaces mismatch

Mordante marked an inline comment as done.Oct 20 2022, 8:29 AM
This revision was automatically updated to reflect the committed changes.

So I'm seeing a libcxx build failure from this patch, though it is pretty clear it is revealing a Clang bug. I'm having trouble minimizing it though, so I was hoping you/someone here could help with it?

 llvm-lit: /iusers/ekeane1/workspaces/delayed-concepts/libcxx/utils/libcxx/test/newconfig.py:19: note: (llvm-libc++-shared.cfg.in) Using %{cxx} substitution: '/iusers/ekeane1/workspaces/delayed-concepts/build/./bin/clang++'
llvm-lit: /iusers/ekeane1/workspaces/delayed-concepts/libcxx/utils/libcxx/test/newconfig.py:19: note: (llvm-libc++-shared.cfg.in) Using %{flags} substitution: ' --target=x86_64-unknown-linux-gnu'
llvm-lit: /iusers/ekeane1/workspaces/delayed-concepts/libcxx/utils/libcxx/test/newconfig.py:19: note: (llvm-libc++-shared.cfg.in) Using %{compile_flags} substitution: '-nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support -std=c++2b -fmodules -fcxx-modules -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-noexcept-type -Wno-atomic-alignment -W
no-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings'
llvm-lit: /iusers/ekeane1/workspaces/delayed-concepts/libcxx/utils/libcxx/test/newconfig.py:19: note: (llvm-libc++-shared.cfg.in) Using %{link_flags} substitution: '-lc++experimental -nostdlib++ -L %{lib} -Wl,-rpath,%{lib} -lc++ -pthread'
llvm-lit: /iusers/ekeane1/workspaces/delayed-concepts/libcxx/utils/libcxx/test/newconfig.py:19: note: (llvm-libc++-shared.cfg.in) Using %{exec} substitution: '%{executor} --execdir %T -- '
llvm-lit: /iusers/ekeane1/workspaces/delayed-concepts/libcxx/utils/libcxx/test/newconfig.py:19: note: (llvm-libc++-shared.cfg.in) All available features: modules-build, verify-support, clang-16.0, locale.fr_CA.ISO8859-1, clang, stdlib=libc++, long_tests, clang-16.0.0, fcoroutines-ts, locale.zh_CN.UTF-8, locale.ja_JP.UTF-8, linux, objective-c++, has-fblocks, target=x86_64-unknown-linux-gnu, buildhost=linux, locale.fr_FR.UTF-8, c++experimental, locale.cs_CZ.ISO8859-2, libcpp
-abi-version=1, fdelayed-template-parsing, diagnose-if-support, locale.en_US.UTF-8, stdlib=llvm-libc++, has-fconstexpr-steps, -fsized-deallocation, clang-16, c++2b, thread-safety, -faligned-allocation, locale.ru_RU.UTF-8, has-unix-headers
FAIL: llvm-libc++-shared.cfg.in :: std/utilities/format/format.functions/escaped_output.ascii.pass.cpp (1 of 7790)
******************** TEST 'llvm-libc++-shared.cfg.in :: std/utilities/format/format.functions/escaped_output.ascii.pass.cpp' FAILED ********************
Script:
--
: 'COMPILED WITH';  /iusers/ekeane1/workspaces/delayed-concepts/build/./bin/clang++ /localdisk2/ekeane1/workspaces/delayed-concepts/libcxx/test/std/utilities/format/format.functions/escaped_output.ascii.pass.cpp  --target=x86_64-unknown-linux-gnu -nostdinc++ -I /iusers/ekeane1/workspaces/delayed-concepts/build/include/c++/v1 -I /iusers/ekeane1/workspaces/delayed-concepts/build/include/x86_64-unknown-linux-gnu/c++/v1 -I /iusers/ekeane1/workspaces/delayed-concepts/libcxx/tes
t/support -std=c++2b -fmodules -fcxx-modules -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-noexcept-type -Wno-atomic-alignment -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_DISAB
LE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -D_LIBCPP_HAS_NO_UNICODE -lc++experimental -nostdlib++ -L /iusers/ekeane1/workspaces/delayed-concepts/build/./lib/x86_64-unknown-linux-gnu -Wl,-rpath,/iusers/ekeane1/workspaces/delayed-concepts/build/./lib/x86_64-unknown-linux-gnu -lc++ -pthread -o /localdisk2/ekeane1/workspaces/delayed-concepts/build/runtimes/runtimes-bins/test/std/utilities/format/format.functions/Output/escaped_output.ascii.pa
ss.cpp.dir/t.tmp.exe
: 'EXECUTED AS';  "/usr/bin/python3.6" /iusers/ekeane1/workspaces/delayed-concepts/libcxx/test/../utils/run.py --execdir /localdisk2/ekeane1/workspaces/delayed-concepts/build/runtimes/runtimes-bins/test/std/utilities/format/format.functions/Output/escaped_output.ascii.pass.cpp.dir --  /localdisk2/ekeane1/workspaces/delayed-concepts/build/runtimes/runtimes-bins/test/std/utilities/format/format.functions/Output/escaped_output.ascii.pass.cpp.dir/t.tmp.exe
--
Exit Code: 1

Command Output (stdout):
--
$ ":" "COMPILED WITH"
$ "/iusers/ekeane1/workspaces/delayed-concepts/build/./bin/clang++" "/localdisk2/ekeane1/workspaces/delayed-concepts/libcxx/test/std/utilities/format/format.functions/escaped_output.ascii.pass.cpp" "--target=x86_64-unknown-linux-gnu" "-nostdinc++" "-I" "/iusers/ekeane1/workspaces/delayed-concepts/build/include/c++/v1" "-I" "/iusers/ekeane1/workspaces/delayed-concepts/build/include/x86_64-unknown-linux-gnu/c++/v1" "-I" "/iusers/ekeane1/workspaces/delayed-concepts/libcxx/test/support" "-std=c++2b" "-fmodules" "-fcxx-modules" "-Werror" "-Wall" "-Wctad-maybe-unsupported" "-Wextra" "-Wshadow" "-Wundef" "-Wno-unused-command-line-argument" "-Wno-attributes" "-Wno-pessimizing-move" "-Wno-c++11-extensions" "-Wno-noexcept-type" "-Wno-atomic-alignment" "-Wno-user-defined-literals" "-Wno-tautological-compare" "-Wsign-compare" "-Wunused-variable" "-Wunused-parameter" "-Wunreachable-code" "-Wno-unused-local-typedef" "-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER" "-D_LIBCPP_ENABLE_EXPERIMENTAL" "-D_LIBCPP_DISABLE_AVAILABILITY" "-fcoroutines-ts" "-Werror=thread-safety" "-Wuser-defined-warnings" "-D_LIBCPP_HAS_NO_UNICODE" "-lc++experimental" "-nostdlib++" "-L" "/iusers/ekeane1/workspaces/delayed-concepts/build/./lib/x86_64-unknown-linux-gnu" "-Wl,-rpath,/iusers/ekeane1/workspaces/delayed-concepts/build/./lib/x86_64-unknown-linux-gnu" "-lc++" "-pthread" "-o" "/localdisk2/ekeane1/workspaces/delayed-concepts/build/runtimes/runtimes-bins/test/std/utilities/format/format.functions/Output/escaped_output.ascii.pass.cpp.dir/t.tmp.exe"
# command stderr:
clang-16: tools/clang/include/clang/AST/AbstractBasicReader.inc:736: clang::APValue clang::serialization::BasicReaderBase<T>::readAPValue() [with Impl = clang::ASTRecordReader]: Assertion `lvaluePath->getType() == elemTy && "Unexpected type reference!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -main-file-name escaped_output.ascii.pass.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=gdb -fcoverage-compilation-dir=/localdisk2/ekeane1/workspaces/delayed-concepts/build/runtimes/runtimes-bins/test/std/utilities/format/format.functions -nostdinc++ -resource-dir /localdisk2/ekeane1/workspaces/delayed-concepts/build/lib/clang/16.0.0 -I /iusers/ekeane1/workspaces/delayed-concepts/build/include/c++/v1 -I /iusers/ekeane1/workspaces/delayed-concepts/build/include/x86_64-unknown-linux-gnu/c++/v1 -I /iusers/ekeane1/workspaces/delayed-concepts/libcxx/test/support -D _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D _LIBCPP_ENABLE_EXPERIMENTAL -D _LIBCPP_DISABLE_AVAILABILITY -D _LIBCPP_HAS_NO_UNICODE -internal-isystem /localdisk2/ekeane1/workspaces/delayed-concepts/build/lib/clang/16.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-redhat-linux/8/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-noexcept-type -Wno-atomic-alignment -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Werror=thread-safety -Wuser-defined-warnings -std=c++2b -fdeprecated-macro -fdebug-compilation-dir=/localdisk2/ekeane1/workspaces/delayed-concepts/build/runtimes/runtimes-bins/test/std/utilities/format/format.functions -ferror-limit 19 -pthread -fcoroutines-ts -fgnuc-version=4.2.1 -fmodules -fimplicit-module-maps -fmodules-cache-path=/nfs/site/home/ekeane1/.cache/clang/ModuleCache -fmodules-validate-system-headers -fcxx-exceptions -fexceptions -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/lit-tmp-ddqg5hwq/escaped_output-3e7200.o -x c++ /localdisk2/ekeane1/workspaces/delayed-concepts/libcxx/test/std/utilities/format/format.functions/escaped_output.ascii.pass.cpp
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      /iusers/ekeane1/workspaces/delayed-concepts/build/include/c++/v1/__format/formatter_output.h:443:1: Generating code for declaration 'std::__formatter::__is_escaped_sequence_written'
 #0 0x0000000007ff1cff PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x0000000007fef44c SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f4a9fb0bdd0 __restore_rt sigaction.c:0:0
 #3 0x00007f4a9e34e70f raise (/lib64/libc.so.6+0x3770f)
 #4 0x00007f4a9e338b25 abort (/lib64/libc.so.6+0x21b25)
 #5 0x00007f4a9e3389f9 _nl_load_domain.cold.0 loadmsgcat.c:0:0
 #6 0x00007f4a9e346cc6 .annobin___GI___assert_fail.end assert.c:0:0
 #7 0x0000000008ddfda8 clang::serialization::BasicReaderBase<clang::ASTRecordReader>::readAPValue() ASTReaderDecl.cpp:0:0
 #8 0x0000000008df0c99 clang::ASTStmtReader::VisitConstantExpr(clang::ConstantExpr*) (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x8df0c99)
 #9 0x0000000008df1eda clang::ASTReader::ReadStmtFromStream(clang::serialization::ModuleFile&) (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x8df1eda)
#10 0x0000000008d5a3e4 clang::ASTReader::GetExternalDeclStmt(unsigned long) (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x8d5a3e4)
#11 0x000000000ac32830 clang::FunctionDecl::getBody(clang::FunctionDecl const*&) const (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0xac32830)
#12 0x00000000084c6f71 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x84c6f71)
#13 0x0000000008418cf6 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x8418cf6)
#14 0x0000000008414db5 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x8414db5)
#15 0x000000000841d339 clang::CodeGen::CodeGenModule::EmitDeferred() (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x841d339)
#16 0x000000000841d288 clang::CodeGen::CodeGenModule::EmitDeferred() (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x841d288)
#17 0x000000000841d288 clang::CodeGen::CodeGenModule::EmitDeferred() (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x841d288)
#18 0x000000000841d288 clang::CodeGen::CodeGenModule::EmitDeferred() (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x841d288)
#19 0x000000000841d288 clang::CodeGen::CodeGenModule::EmitDeferred() (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x841d288)
#20 0x000000000841d288 clang::CodeGen::CodeGenModule::EmitDeferred() (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x841d288)
#21 0x000000000841d288 clang::CodeGen::CodeGenModule::EmitDeferred() (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x841d288)
#22 0x000000000841d288 clang::CodeGen::CodeGenModule::EmitDeferred() (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x841d288)
#23 0x000000000841d288 clang::CodeGen::CodeGenModule::EmitDeferred() (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x841d288)
#24 0x000000000841d288 clang::CodeGen::CodeGenModule::EmitDeferred() (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x841d288)
#25 0x000000000841d288 clang::CodeGen::CodeGenModule::EmitDeferred() (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x841d288)
#26 0x000000000841d288 clang::CodeGen::CodeGenModule::EmitDeferred() (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x841d288)
#27 0x000000000841d288 clang::CodeGen::CodeGenModule::EmitDeferred() (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x841d288)
#28 0x000000000841d288 clang::CodeGen::CodeGenModule::EmitDeferred() (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x841d288)
#29 0x000000000841d288 clang::CodeGen::CodeGenModule::EmitDeferred() (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x841d288)
#30 0x000000000841d288 clang::CodeGen::CodeGenModule::EmitDeferred() (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x841d288)
#31 0x000000000841d288 clang::CodeGen::CodeGenModule::EmitDeferred() (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x841d288)
#32 0x00000000084200bd clang::CodeGen::CodeGenModule::Release() (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x84200bd)
#33 0x0000000008d0fb1a (anonymous namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&) ModuleBuilder.cpp:0:0
#34 0x0000000008d0f29d clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) CodeGenAction.cpp:0:0
#35 0x0000000009f41bbd clang::ParseAST(clang::Sema&, bool, bool) (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x9f41bbd)
#36 0x0000000008d0e398 clang::CodeGenAction::ExecuteAction() (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x8d0e398)
#37 0x0000000008c2cf09 clang::FrontendAction::Execute() (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x8c2cf09)
#38 0x0000000008bc1fe1 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x8bc1fe1)
#39 0x0000000008d05b3b clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x8d05b3b)
#40 0x00000000056a2474 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x56a2474)
#41 0x000000000569b057 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#42 0x000000000569f98b clang_main(int, char**) (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x569f98b)
#43 0x00007f4a9e33a6a3 __libc_start_main (/lib64/libc.so.6+0x236a3)
#44 0x000000000569a92e _start (/localdisk2/ekeane1/workspaces/delayed-concepts/build/bin/clang-16+0x569a92e)
clang-16: error: unable to execute command: Aborted (core dumped)
clang-16: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 16.0.0 (https://github.com/llvm/llvm-project.git a48007355a03851f0f9bfcafd7a7865ca7467416)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /iusers/ekeane1/workspaces/delayed-concepts/build/./bin
clang-16: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-16: note: diagnostic msg: /tmp/lit-tmp-ddqg5hwq/escaped_output-b4d1d3.cpp
clang-16: note: diagnostic msg: /tmp/lit-tmp-ddqg5hwq/escaped_output-b4d1d3.cache
clang-16: note: diagnostic msg: /tmp/lit-tmp-ddqg5hwq/escaped_output-b4d1d3.sh
clang-16: note: diagnostic msg:

********************

This happens consistently for me (across a number of files), in all compile modes, but with libcxx modules enabled

cmake -G Ninja ../llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_PROJECTS="clang;lldb" -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" -DLLVM_USE_LINKER=lld -DLIBCXX_TEST_PARAMS="enable_modules=True"

I just don't really have a good idea how to debug it however, nor what ended up causing this. So any help you could provide would be grately appreciated. The result as it sits is that I have no ability to test libcxx. Also, perhaps @ChuanqiXu or @urnathan have some idea, as this DOES seem modules related.

@erichkeane I reproduced it but I don't have enough time to look at it actually today.

@erichkeane I reproduced it but I don't have enough time to look at it actually today.

Whew, at least I'm not the only one having this problem :D The build-bots for libcxx never caught it, so I was afraid it was a problem with my setup. I Tried to debug it for a while, and kept getting caught up in the module serialization/deserialization parts, and got lost :/

@erichkeane I reproduced it but I don't have enough time to look at it actually today.

Whew, at least I'm not the only one having this problem :D The build-bots for libcxx never caught it, so I was afraid it was a problem with my setup. I Tried to debug it for a while, and kept getting caught up in the module serialization/deserialization parts, and got lost :/

I'm not sure if we can fix it quickly (I have too many TODOs). It looks like we need require the build-bots for libcxx to get some new setups.

@erichkeane I reproduced it but I don't have enough time to look at it actually today.

Whew, at least I'm not the only one having this problem :D The build-bots for libcxx never caught it, so I was afraid it was a problem with my setup. I Tried to debug it for a while, and kept getting caught up in the module serialization/deserialization parts, and got lost :/

I'm not sure if we can fix it quickly (I have too many TODOs). It looks like we need require the build-bots for libcxx to get some new setups.

I filed an issue for it to make it easier to track: https://github.com/llvm/llvm-project/issues/58716

@erichkeane I reproduced it but I don't have enough time to look at it actually today.

Whew, at least I'm not the only one having this problem :D The build-bots for libcxx never caught it, so I was afraid it was a problem with my setup. I Tried to debug it for a while, and kept getting caught up in the module serialization/deserialization parts, and got lost :/

I'm not sure if we can fix it quickly (I have too many TODOs). It looks like we need require the build-bots for libcxx to get some new setups.

I filed an issue for it to make it easier to track: https://github.com/llvm/llvm-project/issues/58716

Thank you!

libcxx/utils/ci/run-buildbot