Skip to content

Instantly share code, notes, and snippets.

#include <charconv>
#include <string_view>
#include <asm/ioctls.h>
#include <asm/termbits.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
@Marc-Aldorasi-Imprivata
Marc-Aldorasi-Imprivata / make.strace
Created May 2, 2019 17:03
strace of make -j -O
8154 execve("/usr/bin/make", ["make", "-j", "-O"], 0x7fffcc690b60 /* 25 vars */) = 0
8154 brk(NULL) = 0x7fffc2e86000
8154 arch_prctl(0x3001 /* ARCH_??? */, 0x7fffcb53e020) = -1 EINVAL (Invalid argument)
8154 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
8154 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3</etc/ld.so.cache>
8154 fstat(3</etc/ld.so.cache>, {st_mode=S_IFREG|0644, st_size=177831, ...}) = 0
8154 mmap(NULL, 177831, PROT_READ, MAP_PRIVATE, 3</etc/ld.so.cache>, 0) = 0x7fd9a0b34000
8154 close(3</etc/ld.so.cache>) = 0
8154 openat(AT_FDCWD, "/usr/lib/libguile-2.2.so.1", O_RDONLY|O_CLOEXEC) = 3</usr/lib/libguile-2.2.so.1.3.1>
8154 read(3</usr/lib/libguile-2.2.so.1.3.1>, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \0\3\0\0\0\0\0"..., 832) = 832
175 execve("/usr/bin/unshare", ["unshare", "--pid", "--fork", "sh", "-c", "/mnt/c/Windows/System32/notepad.exe && true"], 0x7fffe97ccc30 /* 14 vars */) = 0
175 brk(NULL) = 0x7ffff6db7000
175 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
175 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
175 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
175 fstat(3, {st_mode=S_IFREG|0644, st_size=22386, ...}) = 0
175 mmap(NULL, 22386, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f438f26b000
175 close(3) = 0
175 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
175 openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
@Marc-Aldorasi-Imprivata
Marc-Aldorasi-Imprivata / crash.cpp
Last active June 15, 2017 20:34
Crashing C++ code
int main()
{
volatile int *i=0;
*i=0;
}