lix/src/libutil
Eelco Dolstra 724b7f4fb6 Don't log from inside the logger
This deadlocks ProgressBar, e.g.

  # nix run --impure --no-substitute --store '/tmp/nix2?store=/foo' --expr 'derivation { builder = /nix/store/zi90rxslsm4mlr46l2xws1rm94g7pk8p-busybox-1.31.1-x86_64-unknown-linux-musl/bin/busybox; }'

leads to

  Thread 1 (Thread 0x7ffff6126e80 (LWP 12250)):
  #0  0x00007ffff7215d62 in __lll_lock_wait () from /nix/store/9df65igwjmf2wbw0gbrrgair6piqjgmi-glibc-2.31/lib/libpthread.so.0
  #1  0x00007ffff720e721 in pthread_mutex_lock () from /nix/store/9df65igwjmf2wbw0gbrrgair6piqjgmi-glibc-2.31/lib/libpthread.so.0
  #2  0x00007ffff7ad17fa in __gthread_mutex_lock (__mutex=0x6c5448) at /nix/store/h31cy7jm6g7cfqbhc5pm4rf9c53i3qfb-gcc-9.3.0/include/c++/9.3.0/x86_64-unknown-linux-gnu/bits/gthr-default.h:749
  #3  std::mutex::lock (this=0x6c5448) at /nix/store/h31cy7jm6g7cfqbhc5pm4rf9c53i3qfb-gcc-9.3.0/include/c++/9.3.0/bits/std_mutex.h:100
  #4  std::unique_lock<std::mutex>::lock (this=0x7fffffff09a8, this=0x7fffffff09a8) at /nix/store/h31cy7jm6g7cfqbhc5pm4rf9c53i3qfb-gcc-9.3.0/include/c++/9.3.0/bits/unique_lock.h:141
  #5  std::unique_lock<std::mutex>::unique_lock (__m=..., this=0x7fffffff09a8) at /nix/store/h31cy7jm6g7cfqbhc5pm4rf9c53i3qfb-gcc-9.3.0/include/c++/9.3.0/bits/unique_lock.h:71
  #6  nix::Sync<nix::ProgressBar::State, std::mutex>::Lock::Lock (s=0x6c5448, this=0x7fffffff09a0) at src/libutil/sync.hh:45
  #7  nix::Sync<nix::ProgressBar::State, std::mutex>::lock (this=0x6c5448) at src/libutil/sync.hh:85
  #8  nix::ProgressBar::logEI (this=0x6c5440, ei=...) at src/libmain/progress-bar.cc:131
  #9  0x00007ffff7608cfd in nix::Logger::logEI (ei=..., lvl=nix::lvlError, this=0x6c5440) at src/libutil/logging.hh:88
  #10 nix::getCodeLines (errPos=...) at src/libutil/error.cc:66
  #11 0x00007ffff76073f2 in nix::showErrorInfo (out=..., einfo=..., showTrace=<optimized out>) at /nix/store/h31cy7jm6g7cfqbhc5pm4rf9c53i3qfb-gcc-9.3.0/include/c++/9.3.0/optional:897
  #12 0x00007ffff7ad19e7 in nix::ProgressBar::logEI (this=0x6c5440, ei=...) at src/libmain/progress-bar.cc:134
  #13 0x00007ffff7ab9d10 in nix::Logger::logEI (ei=..., lvl=nix::lvlError, this=0x6c5440) at src/libutil/logging.hh:88
  #14 nix::handleExceptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void ()>) (programName="/home/eelco/Dev/nix/outputs/out/bin/nix", fun=...) at src/libmain/shared.cc:328
  #15 0x000000000046226b in main (argc=<optimized out>, argv=<optimized out>) at /nix/store/h31cy7jm6g7cfqbhc5pm4rf9c53i3qfb-gcc-9.3.0/include/c++/9.3.0/ext/new_allocator.h:80
2020-12-22 11:15:29 +01:00
..
tests filterANSIEscapes(): Handle UTF-8 characters 2020-11-16 16:41:53 +01:00
abstract-setting-to-json.hh abstractsettingtojson.hh -> abstract-setting-to-json.hh 2020-09-21 18:49:43 +02:00
affinity.cc affinity operator<< 2020-05-04 14:44:00 -06:00
affinity.hh Run the daemon worker on the same CPU as the client 2013-08-07 14:02:04 +02:00
ansicolor.hh Fix ANSI color constants 2020-07-12 16:52:20 +02:00
archive.cc read(): Use char * instead of unsigned char * 2020-12-02 14:17:27 +01:00
archive.hh Add forgotten override annotation 2020-12-02 14:23:38 +01:00
args.cc Add deprecated aliases for renamed commands 2020-12-03 22:45:44 +01:00
args.hh Add deprecated aliases for renamed commands 2020-12-03 22:45:44 +01:00
callback.hh Move Callback into its own header 2020-09-21 18:42:21 +02:00
compression.cc Sink: Use std::string_view 2020-12-02 14:17:27 +01:00
compression.hh Fix Brotli decompression in 'nix log' 2018-08-06 15:40:29 +02:00
config.cc Fix appending to Setting<StringSet> 2020-11-09 15:04:34 +01:00
config.hh Generalize extra-* settings 2020-10-29 18:17:39 +01:00
error.cc Don't log from inside the logger 2020-12-22 11:15:29 +01:00
error.hh Add lvlNotice log level 2020-12-10 16:41:24 +01:00
finally.hh Add missing #include 2016-11-07 14:35:47 +01:00
fmt.hh Formatting 2020-10-07 16:33:19 +02:00
hash.cc Sink: Use std::string_view 2020-12-02 14:17:27 +01:00
hash.hh Sink: Use std::string_view 2020-12-02 14:17:27 +01:00
json.cc Fix build 2020-07-30 15:27:28 +02:00
json.hh Make std::uncaught_exception warning less noisy 2019-10-09 23:04:11 +02:00
local.mk StorePath: Rewrite in C++ 2020-06-16 14:28:41 +02:00
logging.cc Capitalize JSON for consistency 2020-10-28 17:54:28 -05:00
logging.hh Add lvlNotice log level 2020-12-10 16:41:24 +01:00
lru-cache.hh Missing #include <cassert> in lru-cache.hh (#3654) 2020-06-03 10:15:22 +00:00
monitor-fd.hh monitor-fds: Fix on macOS. 2018-02-14 18:26:37 -05:00
pool.hh RemoteStore: Close connection if an exception occurs 2018-10-16 23:36:15 +02:00
ref.hh Allow setting the state directory as a store parameter 2016-06-02 16:02:48 +02:00
rust-ffi.cc StorePath: Rewrite in C++ 2020-06-16 14:28:41 +02:00
rust-ffi.hh StorePath: Rewrite in C++ 2020-06-16 14:28:41 +02:00
serialise.cc read(): Use char * instead of unsigned char * 2020-12-02 14:17:27 +01:00
serialise.hh read(): Use char * instead of unsigned char * 2020-12-02 14:17:27 +01:00
split.hh Typo 2020-09-17 20:21:04 +02:00
sync.hh sync.hh: return cv_status instead of dropping it, in case useful. 2018-06-18 17:31:00 -05:00
tarfile.cc read(): Use char * instead of unsigned char * 2020-12-02 14:17:27 +01:00
tarfile.hh libarchive proof of concept 2019-12-07 22:35:14 +07:00
thread-pool.cc Fix a hang in ThreadPool 2017-10-09 15:41:09 +02:00
thread-pool.hh Fix extra ; warnings involving MakeError 2019-11-10 11:24:47 -05:00
topo-sort.hh Add missing #pragma once 2020-10-06 10:40:07 +02:00
types.hh Move Explicit 2020-10-26 17:01:20 +01:00
url-parts.hh libstore/openStore: fix stores with IPv6 addresses 2020-12-09 12:23:29 +01:00
url.cc Don't include <regex> in header files 2020-09-21 18:22:45 +02:00
url.hh Don't include <regex> in header files 2020-09-21 18:22:45 +02:00
util.cc read(): Use char * instead of unsigned char * 2020-12-02 14:17:27 +01:00
util.hh read(): Use char * instead of unsigned char * 2020-12-02 14:17:27 +01:00
xml-writer.cc Cleanup 2019-11-06 16:53:02 +01:00
xml-writer.hh Fix some random -Wconversion warnings 2018-05-02 13:56:34 +02:00