You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
libc++ doesn't like [[EMPTY]] but otherwise both libc++ and libstdc++ will raise an exception (thus crash Hyprland) with something unambigously invalid.
$ Hyprland -c /tmp/hyprland.conf
[...]
terminate called after throwing an instance of 'std::regex_error'what(): Mismatched '(' and ')' in regular expression
Abort trap
(gdb) bt
#00x000000080125633a in thr_kill () at /lib/libc.so.7
#10x00000008011cec74 in raise () at /lib/libc.so.7
#20x0000000801280109 in abort () at /lib/libc.so.7
#30x000000000068b1f8 in __gnu_cxx::__verbose_terminate_handler() [clone .cold] ()
#40x0000000000900c56 in __cxxabiv1::__terminate(void (*)()) ()
#50x0000000000900cb1in ()
#60x0000000000900e1cin ()
#70x000000000068cab0 in std::__throw_regex_error(std::regex_constants::error_type) ()
#80x00000000007422fc in std::__detail::_Compiler<std::__cxx11::regex_traits<char> >::_Compiler(charconst*, charconst*, std::locale const&, std::regex_constants::syntax_option_type) ()
#90x00000000007415c7 in std::__cxx11::basic_regex<char, std::__cxx11::regex_traits<char> >::_M_compile(charconst*, charconst*, std::regex_constants::syntax_option_type) ()
#100x0000000000740c95 in std::__cxx11::basic_regex<char, std::__cxx11::regex_traits<char> >::basic_regex<std::char_traits<char>, std::allocator<char> >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::regex_constants::syntax_option_type) ()
#110x0000000000739d06 in Events::listener_mapWindow(void*, void*) ()
#120x00000000006ef2f1 in void std::__invoke_impl<void, void (*&)(void*, void*), void*, void*>(std::__invoke_other, void (*&)(void*, void*), void*&&, void*&&) ()
#130x00000000006ee037 in std::enable_if<is_invocable_r_v<void, void (*&)(void*, void*), void*, void*>, void>::type std::__invoke_r<void, void (*&)(void*, void*), void*, void*>(void (*&)(void*, void*), void*&&, void*&&) ()
#140x00000000006eceb5 in std::_Function_handler<void (void*, void*), void (*)(void*, void*)>::_M_invoke(std::_Any_data const&, void*&&, void*&&) ()
#150x000000000084b57f in std::function<void (void*, void*)>::operator()(void*, void*) const ()
#160x000000000084b385 in CHyprWLListener::emit(void*) ()
#170x000000000084afac in handleWrapped(wl_listener*, void*) ()
#180x0000000800bce4e4 in wl_signal_emit_mutable (signal=0x8026af7e0, data=0x0) at ../src/wayland-server.c:2241
#190x00000000008ac8f5 in xdg_surface_role_commit ()
#200x00000000008b0f90 in surface_commit_state ()
#210x00000000008b1060 in surface_handle_commit ()
#220x000000080154507a in ffi_call_unix64 () at ../src/x86/unix64.S:104
#230x000000080154486c in ffi_call_int
(cif=0x7fffffffe2b0, fn=0x8b0fcf <surface_handle_commit>, rvalue=0x0, avalue=0x7fffffffe380, closure=0x0) at ../src/x86/ffi64.c:673
#240x0000000801544a0c in ffi_call (cif=0x7fffffffe2b0, fn=0x8b0fcf <surface_handle_commit>, rvalue=0x0, avalue=0x7fffffffe380)
at ../src/x86/ffi64.c:710
#250x0000000800bd38f3 in wl_closure_invoke (closure=0x81071f7a0, flags=2, target=0x80dc74800, opcode=6, data=0x81071f420)
at ../src/connection.c:1025
#260x0000000800bcbd43 in wl_client_connection_data (fd=33, mask=1, data=0x81071f420) at ../src/wayland-server.c:438
#270x0000000800bcf9ef in wl_event_source_fd_dispatch (source=0x80dc67a00, ep=0x7fffffffe530) at ../src/event-loop.c:112
#280x0000000800bd110a in wl_event_loop_dispatch (loop=0x8026393c0, timeout=-1) at ../src/event-loop.c:1027
#290x0000000800bcd515 in wl_display_run (display=0x80269f0e0) at ../src/wayland-server.c:1493
#300x00000000007b191c in CCompositor::startCompositor() ()
#310x0000000000712e3c in main ()
$ cat /tmp/hyprland.conf
exec-once = kitty
misc {
enable_swallow = true
swallow_regex = ?
swallow_exception_regex = ?
}
Simplified example:
$ clang++ -o test-libc++ -stdlib=libc++ a.cc
$ g++ -o test-libstdc++ a.cc
$ ./test-libc++ "[[EMPTY]]"
regex_error: The parser did not consume the entire regular expression.
$ ./test-libc++ "?"
regex_error: One of *?+{ was not preceded by a valid regular expression.
$ ./test-libstdc++ "[[EMPTY]]"
$ ./test-libstdc++ "?"
regex_error: Mismatched '('and')' in regular expression
$ cat a.cc
#include<iostream>
#include<regex>intmain(int argc, char **argv)
{
if (argc < 2) {
std::cerr << "usage: " << argv[0] << " regex" << std::endl;
return1;
}
try {
std::regex rgx(argv[1]);
}
catch (const std::regex_error& e) {
std::cout << "regex_error: " << e.what() << std::endl;
}
return0;
}
The text was updated successfully, but these errors were encountered:
libc++ doesn't like
[[EMPTY]]
but otherwise both libc++ and libstdc++ will raise an exception (thus crash Hyprland) with something unambigously invalid.Simplified example:
The text was updated successfully, but these errors were encountered: