Skip to content

Instantly share code, notes, and snippets.

WARNING: ThreadSanitizer: data race (pid=2749)
Write of size 4 at 0x00000187cae4 by main thread:
#0 reader_data_t::command_line_changed(editable_line_t const*) /home/wheel/zanchey/src/fish-shell/src/reader.cpp:516:27 (fish+0x00000072dd49)
#1 insert_string(editable_line_t*, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool) /home/wheel/zanchey/src/fish-shell/src/reader.cpp:961:9 (fish+0x0000007381af)
#2 insert_char(editable_line_t*, wchar_t, bool) /home/wheel/zanchey/src/fish-shell/src/reader.cpp:990:12 (fish+0x000000739e08)
#3 reader_readline(int) /home/wheel/zanchey/src/fish-shell/src/reader.cpp:3181:21 (fish+0x000000737856)
#4 read_i() /home/wheel/zanchey/src/fish-shell/src/reader.cpp:2250:30 (fish+0x00000073b0e0)
#5 reader_read(int, io_chain_t const&) /home/wheel/zanchey/src/fish-shell/src/reader.cpp:3344:36 (fish+0x00000073ad56)
#6 main /home/wheel/zanchey/src/fish-shell/src/fish.cpp:391:19 (fish+0x00000076d2da)
FISH_BUILD_VERSION = '2.5.0-224-g98f4e49'
DESTDIR = '/home/wheel/zanchey/src/fish-shell/test/root/'
LN_S = 'ln -s'
FISH_VERSION = ''
CXX = 'clang++-3.8 -std=c++11'
CXXFLAGS = '-g -O0 -fno-omit-frame-pointer -fsanitize=thread -fno-exceptions -Wextra -Wno-missing-field-initializers '
MKDIR_P = '/bin/mkdir -p'
SED = '/bin/sed'
AWK = 'gawk'
FGREP = '/bin/grep -F'
/* confdefs.h */
#include <errno.h>
#include <pthread.h>
#include <signal.h>
void *thread1_func(void *p_arg)
{
errno = 1;
}

[Please include a short description of the problem here]

function.h should add these lines:
#include <vector> // for vector
function.h should remove these lines:
- #include <wchar.h> // lines 13-13
- #include "util.h" // lines 16-16
- class env_vars_snapshot_t; // lines 22-22
The full include-list for function.h:
@zanchey
zanchey / testflock.c
Created July 1, 2015 01:51
test flock on NFS
#include <sys/file.h>
#include <stdio.h>
int main()
{
int fd = open("./_testlockfile", O_RDONLY | O_CREAT, 0644);
if (fd < 0)
{
perror("open");
return 1;

Keybase proof

I hereby claim:

  • I am zanchey on github.
  • I am zanchey (https://keybase.io/zanchey) on keybase.
  • I have a public key whose fingerprint is 0038 3798 6104 8788 35FA 516D 7A67 D962 D88A 709A

To claim this, I am signing this object:

@zanchey
zanchey / gist:6658390
Last active December 23, 2015 15:49
patch to configure.ac to use C++ only
diff --git a/configure.ac b/configure.ac
index 21e043a..ec745a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -100,16 +100,17 @@ fi
AC_PROG_CXX([g++ c++])
AC_PROG_CPP
AC_PROG_INSTALL
+AC_LANG(C++)
@zanchey
zanchey / man-cat1-cap_mkdb.1.gz
Created September 17, 2013 23:20
cap_mkdb.1.gz from FreeBSD 9.0: note that FreeBSD stopped using 'catpages' by default some time ago, so the cached version is out of date.
CAP_MKDB(1) FreeBSD General Commands Manual CAP_MKDB(1)
NAME
cap_mkdb -- create capability database
SYNOPSIS
cap_mkdb [-b | -l] [-v] [-f outfile] file ...
DESCRIPTION
The cap_mkdb utility builds a hashed database out of the getcap(3) logi-