[libcxx-commits] [PATCH] D150044: [libc++][print] Adds FILE functions.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 21 11:16:25 PDT 2023


Mordante added a comment.

In D150044#4519677 <https://reviews.llvm.org/D150044#4519677>, @hctim wrote:

>   $ lldb /home/mitchp/build/libcxx_build_msan/test/std/input.output/iostream.format/print.fun/Output/vprint_nonunicode.file.pass.cpp.dir/t.tmp.exe
>   (lldb) target create "/home/mitchp/build/libcxx_build_msan/test/std/input.output/iostream.format/print.fun/Output/vprint_nonunicode.file.pass.cpp.dir/t.tmp.exe"                                            Current executable set to '/home/mitchp/build/libcxx_build_msan/test/std/input.output/iostream.format/print.fun/Output/vprint_nonunicode.file.pass.cpp.dir/t.tmp.exe' (aarch64).                            (lldb) r
>   Process 737940 launched: '/home/mitchp/build/libcxx_build_msan/test/std/input.output/iostream.format/print.fun/Output/vprint_nonunicode.file.pass.cpp.dir/t.tmp.exe' (aarch64)
>   Process 737940 stopped and restarted: thread 1 received signal: SIGCHLD
>   libc++abi: terminating due to uncaught exception of type std::__1::format_error: Argument index out of bounds
>   Process 737940 stopped
>   * thread #1, name = 't.tmp.exe', stop reason = signal SIGABRT
>       frame #0: 0x0000fffff7ac7eac libc.so.6`__GI_raise(sig=6) at raise.c:51:1
>   (lldb) bt
>   * thread #1, name = 't.tmp.exe', stop reason = signal SIGABRT
>     * frame #0: 0x0000fffff7ac7eac libc.so.6`__GI_raise(sig=6) at raise.c:51:1
>       frame #1: 0x0000fffff7ab4aa0 libc.so.6`__GI_abort at abort.c:79:7
>       frame #2: 0x0000fffff7dd4948 libc++abi.so.1`abort_message at abort_message.cpp:78:5
>       frame #3: 0x0000fffff7d8a1f0 libc++abi.so.1`::demangling_terminate_handler() at cxa_default_handlers.cpp:72:9
>       frame #4: 0x0000fffff7dd3138 libc++abi.so.1`std::__terminate(void (*)()) at cxa_handlers.cpp:59:9
>       frame #5: 0x0000fffff7dda23c libc++abi.so.1`__cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) at cxa_exception.cpp:152:5
>       frame #6: 0x0000fffff7dda168 libc++abi.so.1`::__cxa_throw() at cxa_exception.cpp:283:5
>       frame #7: 0x0000aaaaaabdbfac t.tmp.exe`std::__1::__throw_format_error[abi:v170000](__s="Argument index out of bounds") at format_error.h:41:3

This looks suspicious.
The code throws an exception which I verified is intended.
Then the libc++abi calls `failed_throw` which causes termination.
Is there a way to get more information about what happens in frame #6? Here it seems the exception is not able to find the proper handler for the exception and thus calling terminate.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150044/new/

https://reviews.llvm.org/D150044



More information about the libcxx-commits mailing list