2015-07-08 5:30 GMT-03:00 Jonathan de Boyne Pollard: > > If there's no error output, crank up strace and see what the last few system > calls are. It's probably worthwhile doing that anyway, in fact.
Here are the last system calls shown by an strace of service-dt-scanner before the SIGABRT, with some relevant previous lines. The specific test was using ls on the service's bundle directory, which was a direct subdirectory of the scan directory, and had daemontools-compatible layout. At one point, this happens: epoll_create(1) = 4 openat(AT_FDCWD, "scandir", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 6 gettid() = 1328 fstat64(6, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 Then there is a readlink() call on "/proc/1328/fd/6" ("scandir" happened to be a symbolic link) and then: inotify_init() = 7 inotify_add_watch(7, "/path-to/test/scandir", IN_MODIFY|IN_ATTRIB|IN_CLOSE) = 1 epoll_ctl(4, EPOLL_CTL_ADD, 7, {EPOLLIN, {u32=159460944, u64=159460944}}) = 0 "/path-to/test/scandir" represents here what was the complete path to the scan directory. And now the complete final lines: fstatat64(11, "down", 0xbfe6af30, 0) = -1 ENOENT (No such file or directory) rt_sigaction(SIGALRM, {0x806e971, [], 0}, {SIG_DFL, [], 0}, 8) = 0 alarm(5) = 0 openat(12, "ok", O_WRONLY|O_NOCTTY|O_CLOEXEC) = 13 close(13) = 0 alarm(0) = 5 rt_sigaction(SIGALRM, {SIG_DFL, [], 0}, NULL, 8) = 0 openat(12, "control", O_WRONLY|O_NOCTTY|O_NONBLOCK|O_CLOEXEC) = 13 write(13, "u", 1) = 1 close(13) = 0 close(12) = 0 close(11) = 0 close(10) = 0 getdents(9, /* 0 entries */, 32768) = 0 close(9) = 0 (File descriptors were 9 = the scan directory, after a dup(6), 10 = bundle directory of the service, 11 was the result of a dup(10), 12 = supervise/ subdirectory of the service's bundle directory) epoll_wait(4, {{EPOLLIN, {u32=159460944, u64=159460944}}}, 1, -1) = 1 gettid() = 1328 read(7, "\1\0\0\0\20\0\0@\0\0\0\0\0\0\0\0", 16) = 16 write(2, "service-dt-scanner: DEBUG: event"..., 59) = 59 (That was an ls command on the scan directory, that produced this output: "service-dt-scanner: DEBUG: event filter 0 ident 6 fflags 6") epoll_wait(4, {{EPOLLIN, {u32=159460944, u64=159460944}}}, 1, -1) = 1 gettid() = 1328 read(7, 0xbfe6b0cc, 16) = -1 EINVAL (Invalid argument) rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0 tgkill(1328, 1328, SIGABRT) = 0 --- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=1328, si_uid=1000} --- +++ killed by SIGABRT +++ I did the strace a couple of different times, and all outputs ended like this, a read() call on the file descriptor returned by the inotify_init() that produces an EINVAL error, followed rt_sigprocmask() with a SIG_UNBLOCK argument, and the tgkill() that sends the SIGABRT. Thanks, G.