Skip to content

Instantly share code, notes, and snippets.

@therealkenc
Created November 12, 2016 09:51
Show Gist options
  • Save therealkenc/fbf1af4166fd7c88e15e90f775ea9147 to your computer and use it in GitHub Desktop.
Save therealkenc/fbf1af4166fd7c88e15e90f775ea9147 to your computer and use it in GitHub Desktop.
execve("./pid-proc", ["./pid-proc"], [/* 67 vars */]) = 0
brk(NULL) = 0x2487000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f40ee1ba000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/tls/x86_64/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/tls/x86_64", 0x7ffe26844710) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/tls/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/tls", 0x7ffe26844710) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/x86_64/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/x86_64", 0x7ffe26844710) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib", {st_mode=S_IFDIR|0755, st_size=12288, ...}) = 0
open("/usr/local/x86_64-linux-musl/lib/tls/x86_64/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/x86_64-linux-musl/lib/tls/x86_64", 0x7ffe26844710) = -1 ENOENT (No such file or directory)
open("/usr/local/x86_64-linux-musl/lib/tls/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/x86_64-linux-musl/lib/tls", 0x7ffe26844710) = -1 ENOENT (No such file or directory)
open("/usr/local/x86_64-linux-musl/lib/x86_64/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/x86_64-linux-musl/lib/x86_64", 0x7ffe26844710) = -1 ENOENT (No such file or directory)
open("/usr/local/x86_64-linux-musl/lib/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/x86_64-linux-musl/lib", 0x7ffe26844710) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=142854, ...}) = 0
mmap(NULL, 142854, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f40ee197000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/libstdc++.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@\271\10\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=1590744, ...}) = 0
mmap(NULL, 3699328, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f40edc0f000
mprotect(0x7f40edd87000, 2097152, PROT_NONE) = 0
mmap(0x7f40edf87000, 49152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x178000) = 0x7f40edf87000
mmap(0x7f40edf93000, 12928, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f40edf93000
close(3) = 0
open("/usr/local/lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260*\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=92552, ...}) = 0
mmap(NULL, 2188336, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f40ed9f8000
mprotect(0x7f40eda0e000, 2093056, PROT_NONE) = 0
mmap(0x7f40edc0d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7f40edc0d000
close(3) = 0
open("/usr/local/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/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\0P\t\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1864888, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f40ee196000
mmap(NULL, 3967392, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f40ed62f000
mprotect(0x7f40ed7ee000, 2097152, PROT_NONE) = 0
mmap(0x7f40ed9ee000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1bf000) = 0x7f40ed9ee000
mmap(0x7f40ed9f4000, 14752, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f40ed9f4000
close(3) = 0
open("/usr/local/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libm.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\0V\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=1088952, ...}) = 0
mmap(NULL, 3178744, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f40ed326000
mprotect(0x7f40ed42e000, 2093056, PROT_NONE) = 0
mmap(0x7f40ed62d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x107000) = 0x7f40ed62d000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f40ee195000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f40ee193000
arch_prctl(ARCH_SET_FS, 0x7f40ee193740) = 0
mprotect(0x7f40ed9ee000, 16384, PROT_READ) = 0
mprotect(0x7f40ed62d000, 4096, PROT_READ) = 0
mprotect(0x7f40edc0d000, 4096, PROT_READ) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f40ee192000
mprotect(0x7f40edf87000, 40960, PROT_READ) = 0
mprotect(0x601000, 4096, PROT_READ) = 0
mprotect(0x7f40ee1bc000, 4096, PROT_READ) = 0
munmap(0x7f40ee197000, 142854) = 0
brk(NULL) = 0x2487000
brk(0x24b9000) = 0x24b9000
pipe([3, 4]) = 0
clone(strace: Process 2774 attached
child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f40ee193a10) = 2774
[pid 2773] read(3, <unfinished ...>
[pid 2774] dup2(4, 1) = 1
[pid 2774] execve("/bin/echo", ["echo", "hello"], [/* 67 vars */]) = 0
[pid 2774] brk(NULL) = 0x23d9000
[pid 2774] access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
[pid 2774] mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0be25bf000
[pid 2774] access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
[pid 2774] open("/usr/local/lib/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid 2774] stat("/usr/local/lib/tls/x86_64", 0x7ffc13a1f0d0) = -1 ENOENT (No such file or directory)
[pid 2774] open("/usr/local/lib/tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid 2774] stat("/usr/local/lib/tls", 0x7ffc13a1f0d0) = -1 ENOENT (No such file or directory)
[pid 2774] open("/usr/local/lib/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid 2774] stat("/usr/local/lib/x86_64", 0x7ffc13a1f0d0) = -1 ENOENT (No such file or directory)
[pid 2774] open("/usr/local/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid 2774] stat("/usr/local/lib", {st_mode=S_IFDIR|0755, st_size=12288, ...}) = 0
[pid 2774] open("/usr/local/x86_64-linux-musl/lib/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid 2774] stat("/usr/local/x86_64-linux-musl/lib/tls/x86_64", 0x7ffc13a1f0d0) = -1 ENOENT (No such file or directory)
[pid 2774] open("/usr/local/x86_64-linux-musl/lib/tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid 2774] stat("/usr/local/x86_64-linux-musl/lib/tls", 0x7ffc13a1f0d0) = -1 ENOENT (No such file or directory)
[pid 2774] open("/usr/local/x86_64-linux-musl/lib/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid 2774] stat("/usr/local/x86_64-linux-musl/lib/x86_64", 0x7ffc13a1f0d0) = -1 ENOENT (No such file or directory)
[pid 2774] open("/usr/local/x86_64-linux-musl/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid 2774] stat("/usr/local/x86_64-linux-musl/lib", 0x7ffc13a1f0d0) = -1 ENOENT (No such file or directory)
[pid 2774] open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 5
[pid 2774] fstat(5, {st_mode=S_IFREG|0644, st_size=142854, ...}) = 0
[pid 2774] mmap(NULL, 142854, PROT_READ, MAP_PRIVATE, 5, 0) = 0x7f0be259c000
[pid 2774] close(5) = 0
[pid 2774] access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
[pid 2774] open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 5
[pid 2774] read(5, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\t\2\0\0\0\0\0"..., 832) = 832
[pid 2774] fstat(5, {st_mode=S_IFREG|0755, st_size=1864888, ...}) = 0
[pid 2774] mmap(NULL, 3967392, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 5, 0) = 0x7f0be1fd3000
[pid 2774] mprotect(0x7f0be2192000, 2097152, PROT_NONE) = 0
[pid 2774] mmap(0x7f0be2392000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 5, 0x1bf000) = 0x7f0be2392000
[pid 2774] mmap(0x7f0be2398000, 14752, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f0be2398000
[pid 2774] close(5) = 0
[pid 2774] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0be259b000
[pid 2774] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0be259a000
[pid 2774] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0be2599000
[pid 2774] arch_prctl(ARCH_SET_FS, 0x7f0be259a700) = 0
[pid 2774] mprotect(0x7f0be2392000, 16384, PROT_READ) = 0
[pid 2774] mprotect(0x606000, 4096, PROT_READ) = 0
[pid 2774] mprotect(0x7f0be25c1000, 4096, PROT_READ) = 0
[pid 2774] munmap(0x7f0be259c000, 142854) = 0
[pid 2774] brk(NULL) = 0x23d9000
[pid 2774] brk(0x23fa000) = 0x23fa000
[pid 2774] open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 5
[pid 2774] fstat(5, {st_mode=S_IFREG|0644, st_size=4898080, ...}) = 0
[pid 2774] mmap(NULL, 4898080, PROT_READ, MAP_PRIVATE, 5, 0) = 0x7f0be1b27000
[pid 2774] close(5) = 0
[pid 2774] fstat(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
[pid 2774] write(1, "hello\n", 6 <unfinished ...>
[pid 2773] <... read resumed> "hello\n", 4096) = 6
[pid 2774] <... write resumed> ) = 6
[pid 2773] fstat(1, <unfinished ...>
[pid 2774] close(1 <unfinished ...>
[pid 2773] <... fstat resumed> {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 17), ...}) = 0
[pid 2774] <... close resumed> ) = 0
[pid 2773] write(1, "got from child: hello\n", 22 <unfinished ...>
[pid 2774] close(2 <unfinished ...>
[pid 2773] <... write resumed> ) = 22
[pid 2774] <... close resumed> ) = 0
[pid 2773] open("/proc/2774/stat", O_RDONLY <unfinished ...>
[pid 2774] exit_group(0) = ?
[pid 2773] <... open resumed> ) = 5
[pid 2773] read(5, <unfinished ...>
[pid 2774] +++ exited with 0 +++
<... read resumed> "2774 (echo) Z 2773 2771 2037 348"..., 4096) = 160
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=2774, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
write(1, "stat for pid 2774:\n", 19) = 19
write(1, "2774 (echo) Z 2773 2771 2037 348"..., 160) = 160
exit_group(0) = ?
+++ exited with 0 +++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment