Skip to content

Instantly share code, notes, and snippets.

@sam-github
Created January 9, 2014 20:38
Show Gist options
  • Save sam-github/8341573 to your computer and use it in GitHub Desktop.
Save sam-github/8341573 to your computer and use it in GitHub Desktop.
::::::::::::::
trace.5674
::::::::::::::
set_robust_list(0x7f6b2f51aa20, 24) = 0
setsid() = 5674
open("/dev/null", O_RDONLY) = 14
dup2(14</dev/null>, 0</dev/pts/38>) = 0
close(14</dev/null>) = 0
ioctl(0</dev/null>, FIONBIO, [0]) = 0
close(-1) = -1 EBADF (Bad file descriptor)
dup2(10</home/sam/w/sn/strong-supervisor/test/express-app/out>, 1</dev/pts/38>) = 1
close(10</home/sam/w/sn/strong-supervisor/test/express-app/out>) = 0
ioctl(1</home/sam/w/sn/strong-supervisor/test/express-app/out>, FIONBIO, [0]) = 0
close(-1) = -1 EBADF (Bad file descriptor)
dup2(10, 2</dev/pts/38>) = -1 EBADF (Bad file descriptor)
close(10) = -1 EBADF (Bad file descriptor)
ioctl(2</dev/pts/38>, FIONBIO, [0]) = 0
@sam-github
Copy link
Author

As my daughter is fond of saying "that's not right"

@sam-github
Copy link
Author

It looks like fd 2 is marked close-on-exec, so in child 2 is closed, because first open in child is:

open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 2

I assume this just causes chaos, because node exits in fairly short order, with no output.

@marouano
Copy link

Hello,
Please im running bittorrent client to download torrents but it doesn't start. When i check using 'strace -c ls' i found this :

% time seconds usecs/call calls errors syscall


62.99 0.000999 999 1 execve
13.37 0.000212 9 24 write
12.80 0.000203 14 15 old_mmap
10.84 0.000172 57 3 read
0.00 0.000000 0 6 open
0.00 0.000000 0 6 close
0.00 0.000000 0 1 time
0.00 0.000000 0 1 getuid
0.00 0.000000 0 29 brk
0.00 0.000000 0 29 24 ioctl
0.00 0.000000 0 1 fcntl
0.00 0.000000 0 3 munmap
0.00 0.000000 0 2 1 stat
0.00 0.000000 0 6 fstat
0.00 0.000000 0 2 mprotect
0.00 0.000000 0 1 stat64
0.00 0.000000 0 48 lstat64
0.00 0.000000 0 2 getdents64


100.00 0.001586 180 25 total

and when i tape strace i found :

brk(0x43a000) = 0x43a000
clock_gettime(CLOCK_REALTIME, {1357018818, 928972451}) = 0
brk(0x43b000) = 0x43b000
ioctl(2147483647, TIOCNXCL, 0x7fce92d0) = -1 EBADF (Bad file descriptor)
brk(0x43c000) = 0x43c000
mkdir("/root/.btpd", 0777) = -1 EEXIST (File exists)
chdir("/root/.btpd") = 0
mkdir("torrents", 0777) = -1 EEXIST (File exists)
pipe([0, 0]) = 3
fork(Another instance of btpd is probably running in /root/.btpd.
) = 21686
--- SIGCHLD (Child exited) @ 0 (0) ---
read(3, "\1", 1) = 1
exit(1) = ?

I don't understand any thing , juste that there is a problem in the 'ioctl' .
What can i do please?
Thnak you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment