Skip to content

Instantly share code, notes, and snippets.

@b0o
Created December 10, 2023 00:46
Show Gist options
  • Save b0o/5c427e946864e1338e78f01690dbc956 to your computer and use it in GitHub Desktop.
Save b0o/5c427e946864e1338e78f01690dbc956 to your computer and use it in GitHub Desktop.
Outer
execve("/usr/bin/entr", ["entr", "bash", "./self-entr.sh", "--inner"], 0x7fff5e5a1088 /* 179 vars */) = 0
brk(NULL) = 0x563684b3a000
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffc98182a70) = -1 EINVAL (Invalid argument)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=322755, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 322755, PROT_READ, MAP_PRIVATE, 3, 0) = 0x14884d01e000
close(3) = 0
openat(AT_FDCWD, "/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220~\2\0\0\0\0\0"..., 832) = 832
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=1948832, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x14884d01c000
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
mmap(NULL, 1973104, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x14884ce3a000
mmap(0x14884ce60000, 1417216, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x26000) = 0x14884ce60000
mmap(0x14884cfba000, 344064, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x180000) = 0x14884cfba000
mmap(0x14884d00e000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1d3000) = 0x14884d00e000
mmap(0x14884d014000, 31600, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x14884d014000
close(3) = 0
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x14884ce37000
arch_prctl(ARCH_SET_FS, 0x14884ce37740) = 0
set_tid_address(0x14884ce37a10) = 1282380
set_robust_list(0x14884ce37a20, 24) = 0
rseq(0x14884ce38060, 0x20, 0, 0x53053053) = 0
mprotect(0x14884d00e000, 16384, PROT_READ) = 0
mprotect(0x563682e87000, 4096, PROT_READ) = 0
mprotect(0x14884d09e000, 8192, PROT_READ) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=RLIM64_INFINITY, rlim_max=RLIM64_INFINITY}) = 0
munmap(0x14884d01e000, 322755) = 0
rt_sigaction(SIGINT, {sa_handler=0x563682e84740, sa_mask=[], sa_flags=SA_RESTORER|SA_RESETHAND|0xffffffff00000000, sa_restorer=0x14884ce78710}, NULL, 8) = 0
rt_sigaction(SIGTERM, {sa_handler=0x563682e84740, sa_mask=[], sa_flags=SA_RESTORER|SA_RESETHAND|0xffffffff00000000, sa_restorer=0x14884ce78710}, NULL, 8) = 0
rt_sigaction(SIGHUP, {sa_handler=0x563682e84740, sa_mask=[], sa_flags=SA_RESTORER|SA_RESETHAND|0xffffffff00000000, sa_restorer=0x14884ce78710}, NULL, 8) = 0
rt_sigaction(SIGCHLD, {sa_handler=0x563682e848e0, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x14884ce78710}, NULL, 8) = 0
getrandom("\xb5\x17\xbb\xbd\xdf\x98\xcb\x6f", 8, GRND_NONBLOCK) = 8
brk(NULL) = 0x563684b3a000
brk(0x563684b5b000) = 0x563684b5b000
openat(AT_FDCWD, "/proc/sys/fs/inotify/max_user_watches", O_RDONLY) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=0, ...}, AT_EMPTY_PATH) = 0
read(3, "524288\n", 1024) = 7
close(3) = 0
mmap(NULL, 4198400, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x14884ca36000
inotify_init1(IN_CLOEXEC) = 3
ioctl(0, TCGETS, 0x7ffc981824c0) = -1 ENOTTY (Inappropriate ioctl for device)
newfstatat(0, "", {st_mode=S_IFIFO|0600, st_size=0, ...}, AT_EMPTY_PATH) = 0
read(0, "./self-entr.sh\n", 4096) = 15
newfstatat(AT_FDCWD, "./self-entr.sh", {st_mode=S_IFREG|0755, st_size=275, ...}, 0) = 0
read(0, "", 4096) = 0
openat(AT_FDCWD, "./self-entr.sh", O_RDONLY|O_CLOEXEC) = 4
inotify_add_watch(3, "./self-entr.sh", IN_ATTRIB|IN_CLOSE_WRITE|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF) = 1
close(4) = 0
openat(AT_FDCWD, "/dev/tty", O_RDONLY) = 4
dup2(4, 0) = 0
close(4) = 0
ioctl(0, TCGETS, {c_iflag=ICRNL|IXON|IUTF8, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPOST|ONLCR, c_cflag=B38400|CS8|CREAD, c_lflag=ISIG|ICANON|ECHO|ECHOE|ECHOK|IEXTEN|ECHOCTL|ECHOKE, ...}) = 0
mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x14884d02c000
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x14884ce37a10) = 1282381
wait4(-1, Inner
[{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 1282381
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=1282381, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
wait4(-1, 0x7ffc98181f14, 0, NULL) = -1 ECHILD (No child processes)
rt_sigreturn({mask=[]}) = 1282381
munmap(0x14884d02c000, 266240) = 0
ioctl(0, TCSETSW, {c_iflag=ICRNL|IXON|IUTF8, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPOST|ONLCR, c_cflag=B38400|CS8|CREAD, c_lflag=ISIG|ECHOE|ECHOK|IEXTEN|ECHOCTL|ECHOKE, ...}) = 0
poll([{fd=3, events=POLLIN}, {fd=0, events=POLLIN}], 2, 1) = 0 (Timeout)
poll([{fd=3, events=POLLIN}, {fd=0, events=POLLIN}], 2, 50) = 0 (Timeout)
ioctl(0, TCSETSW, {c_iflag=ICRNL|IXON|IUTF8, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPOST|ONLCR, c_cflag=B38400|CS8|CREAD, c_lflag=ISIG|ICANON|ECHO|ECHOE|ECHOK|IEXTEN|ECHOCTL|ECHOKE, ...}) = 0
ioctl(0, TCSETSW, {c_iflag=ICRNL|IXON|IUTF8, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPOST|ONLCR, c_cflag=B38400|CS8|CREAD, c_lflag=ISIG|ECHOE|ECHOK|IEXTEN|ECHOCTL|ECHOKE, ...}) = 0
poll([{fd=3, events=POLLIN}, {fd=0, events=POLLIN}], 2, -1) = 1 ([{fd=3, revents=POLLIN}])
read(3, "\1\0\0\0\4\0\0\0\0\0\0\0\0\0\0\0", 1024) = 16
poll([{fd=3, events=POLLIN}, {fd=0, events=POLLIN}], 2, 50) = 0 (Timeout)
ioctl(0, TCSETSW, {c_iflag=ICRNL|IXON|IUTF8, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPOST|ONLCR, c_cflag=B38400|CS8|CREAD, c_lflag=ISIG|ICANON|ECHO|ECHOE|ECHOK|IEXTEN|ECHOCTL|ECHOKE, ...}) = 0
newfstatat(AT_FDCWD, "./self-entr.sh", {st_mode=S_IFREG|0755, st_size=275, ...}, 0) = 0
brk(0x563684b9d000) = 0x563684b9d000
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x14884ce37a10) = 1282754
wait4(-1, Inner
[{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 1282754
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=1282754, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
ioctl(0, TCSETSW, {c_iflag=ICRNL|IXON|IUTF8, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPOST|ONLCR, c_cflag=B38400|CS8|CREAD, c_lflag=ISIG|ICANON|ECHO|ECHOE|ECHOK|IEXTEN|ECHOCTL|ECHOKE, ...}) = 0
wait4(-1, 0x7ffc98181f14, 0, NULL) = -1 ECHILD (No child processes)
rt_sigreturn({mask=[]}) = 1282754
ioctl(0, TCSETSW, {c_iflag=ICRNL|IXON|IUTF8, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPOST|ONLCR, c_cflag=B38400|CS8|CREAD, c_lflag=ISIG|ECHOE|ECHOK|IEXTEN|ECHOCTL|ECHOKE, ...}) = 0
poll([{fd=3, events=POLLIN}, {fd=0, events=POLLIN}], 2, 1) = 0 (Timeout)
poll([{fd=3, events=POLLIN}, {fd=0, events=POLLIN}], 2, 50) = 0 (Timeout)
ioctl(0, TCSETSW, {c_iflag=ICRNL|IXON|IUTF8, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPOST|ONLCR, c_cflag=B38400|CS8|CREAD, c_lflag=ISIG|ICANON|ECHO|ECHOE|ECHOK|IEXTEN|ECHOCTL|ECHOKE, ...}) = 0
ioctl(0, TCSETSW, {c_iflag=ICRNL|IXON|IUTF8, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPOST|ONLCR, c_cflag=B38400|CS8|CREAD, c_lflag=ISIG|ECHOE|ECHOK|IEXTEN|ECHOCTL|ECHOKE, ...}) = 0
poll([{fd=3, events=POLLIN}, {fd=0, events=POLLIN}], 2, -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment