1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-03 06:11:46 +02:00
nix/src
Jade Lovelace 045cff79b2 port crash-handler from lix to nix
It was first introduced in 19e0ce2c03

In Nix we only register the crash handler in main instead of initNix,
because library user may want to use their own crash handler.

Sample output:

Mar 12 08:38:06 eve nix[2303762]: Nix crashed. This is a bug. Please report this at https://github.com/NixOS/nix/issues with the following information included:
Mar 12 08:38:06 eve nix[2303762]: Exception: nix::SysError: error: writing to file: Resource temporarily unavailable
Mar 12 08:38:06 eve nix[2303762]: Stack trace:
Mar 12 08:38:06 eve nix[2303762]:  0# 0x000000000076876A in nix
                                   1# 0x00007FDA40E9F20A in /nix/store/2lhklm5aizx30qbw49acnrrzkj9lbmij-gcc-14-20241116-lib/lib/libstdc++.so.6
                                   2# std::unexpected() in /nix/store/2lhklm5aizx30qbw49acnrrzkj9lbmij-gcc-14-20241116-lib/lib/libstdc++.so.6
                                   3# 0x00007FDA40E9F487 in /nix/store/2lhklm5aizx30qbw49acnrrzkj9lbmij-gcc-14-20241116-lib/lib/libstdc++.so.6
                                   4# nix::writeFull(int, std::basic_string_view<char, std::char_traits<char> >, bool) in /home/joerg/git/nix/inst/lib/libnixutil.so
                                   5# nix::writeLine(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) in /home/joerg/git/nix/inst/lib/libnixutil.so
                                   6# nix::JSONLogger::write(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&) in /home/joerg/git/nix/inst/lib/libnixutil.so
                                   7# nix::JSONLogger::logEI(nix::ErrorInfo const&) in /home/joerg/git/nix/inst/lib/libnixutil.so
                                   8# nix::Logger::logEI(nix::Verbosity, nix::ErrorInfo) in nix
                                   9# nix::handleExceptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void ()>) in /home/joerg/git/nix/inst/lib/libnixmain.so
                                  10# 0x000000000087A563 in nix
                                  11# 0x00007FDA40BD41FE in /nix/store/6q2mknq81cyscjmkv72fpcsvan56qhmg-glibc-2.40-66/lib/libc.so.6
                                  12# __libc_start_main in /nix/store/6q2mknq81cyscjmkv72fpcsvan56qhmg-glibc-2.40-66/lib/libc.so.6
                                  13# 0x00000000006F4DF5 in nix

Co-authored-by: eldritch horrors <pennae@lix.systems>
(cherry picked from commit 163f94412a)
2025-03-21 15:30:03 +00:00
..
build-remote build-remote: only allocate storeUri once 2024-07-25 14:04:03 +02:00
external-api-docs Format .nix files 2025-01-24 20:40:21 +01:00
internal-api-docs Format .nix files 2025-01-24 20:40:21 +01:00
libcmd {libexpr,libcmd}: Make debugger significantly faster 2025-03-14 13:22:45 +00:00
libexpr stack overflow is EvalBaseError 2025-03-21 14:12:36 +00:00
libexpr-c Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libexpr-test-support Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libexpr-tests Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libfetchers libfetchers: fix double quote in path printed in logger 2025-03-19 22:24:28 +00:00
libfetchers-tests Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libflake Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libflake-c Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libflake-tests Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libmain Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libmain-c Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libstore Fix macos sandbox issue 2025-03-19 20:21:40 +00:00
libstore-c Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libstore-test-support Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libstore-tests Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libutil libutil: Fix Pos::getSourcePath 2025-03-14 13:22:44 +00:00
libutil-c Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libutil-test-support Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libutil-tests Write just ./.version on all components 2025-02-19 01:04:04 +01:00
nix port crash-handler from lix to nix 2025-03-21 15:30:03 +00:00
nix-build Move code related to NIX_MAN_DIR from libstore to nix-cli 2025-02-18 14:37:28 +00:00
nix-channel Move code related to NIX_MAN_DIR from libstore to nix-cli 2025-02-18 14:37:28 +00:00
nix-collect-garbage Move code related to NIX_MAN_DIR from libstore to nix-cli 2025-02-18 14:37:28 +00:00
nix-copy-closure Move code related to NIX_MAN_DIR from libstore to nix-cli 2025-02-18 14:37:28 +00:00
nix-env Move code related to NIX_MAN_DIR from libstore to nix-cli 2025-02-18 14:37:28 +00:00
nix-instantiate Move code related to NIX_MAN_DIR from libstore to nix-cli 2025-02-18 14:37:28 +00:00
nix-store Move code related to NIX_MAN_DIR from libstore to nix-cli 2025-02-18 14:37:28 +00:00
perl Fix perl store bindings 2025-02-21 14:47:37 +00:00
nix-functional-tests Build Functional tests with Meson 2024-08-14 15:35:40 -04:00
nix-manual Build the manual with Meson 2024-10-09 11:58:17 -04:00