Re: [chrony-users] Fatal error : adjtimex() failed

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-users Archives ]


On 23/08/2012 11:54, Tomalak Geret'kal wrote:
When I remove this bit, the adjtimex() issue progresses to the shmget() issue (which seems impervious to setuidness).
When I add it back, the adjtimex() issue returns.

There is a red herring in my strace output - my output of "errno" in shm_initialise.c was faulty.

Having fixed that, I can now see that the *actual* error from shmget() (as implied by the SYS_307 line, I guess) is errno 22 EINVAL (Invalid argument), and *not* 2 (No file or directory).

Tom
execve("/root/chronyd", ["/root/chronyd", "-d"], [/* 16 vars */]) = 0
brk(0)                                  = 0x3d000
uname({sys="Linux", node="sw200319", ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001d000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=1846, ...}) = 0
mmap2(NULL, 1846, PROT_READ, MAP_PRIVATE, 3, 0) = 0x4001e000
close(3)                                = 0
open("/lib/libm.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\2501\0\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=743679, ...}) = 0
mmap2(NULL, 704672, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x40026000
mprotect(0x400ca000, 28672, PROT_NONE)  = 0
mmap2(0x400d1000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xa3) = 0x400d1000
close(3)                                = 0
open("/lib/libgcc_s.so.1", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0x\'\0\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=69850, ...}) = 0
mmap2(NULL, 79676, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x400d3000
mprotect(0x400df000, 28672, PROT_NONE)  = 0
mmap2(0x400e6000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb) = 0x400e6000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\300Q\1\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1553002, ...}) = 0
mmap2(NULL, 1212984, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x400e7000
mprotect(0x40202000, 32768, PROT_NONE)  = 0
mmap2(0x4020a000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x11b) = 0x4020a000
mmap2(0x4020d000, 8760, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4020d000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001f000
syscall_983045(0x4001f790, 0x4001fe60, 0x4002567c, 0x4001fe68, 0x40025050, 0x40025000, 0, 0xf0005, 0x50, 0x1, 0xffff5118, 0xbead1ab4, 0, 0xbead1930, 0x400114ec, 0x40001f78, 0x20000010, 0x4001f790, 0, 0, 0, 0xd5b8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) = 0
mprotect(0x4020a000, 8192, PROT_READ)   = 0
mprotect(0x400d1000, 4096, PROT_READ)   = 0
mprotect(0x40024000, 4096, PROT_READ)   = 0
munmap(0x4001e000, 1846)                = 0
brk(0)                                  = 0x3d000
brk(0x5e000)                            = 0x5e000
open("/etc/chrony.conf", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=210, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001e000
read(3, "#config-sw4.2\nallow\nrefclock PPS"..., 4096) = 210
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x4001e000, 4096)                = 0
getuid32()                              = 0
gettimeofday({1345720735, 886680}, NULL) = 0
open("/etc/localtime", O_RDONLY)        = -1 ENOENT (No such file or directory)
open("/etc/localtime", O_RDONLY)        = -1 ENOENT (No such file or directory)
write(2, "main.c:324:(main)[23-11:18:55] ", 31main.c:324:(main)[23-11:18:55] ) = 31
write(2, "chronyd version 1.26 starting\n", 30chronyd version 1.26 starting
) = 30
open("/var/run/chronyd.pid", O_RDONLY)  = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001e000
read(3, "6583\n", 1024)                 = 5
close(3)                                = 0
munmap(0x4001e000, 4096)                = 0
getsid(6583)                            = -1 ESRCH (No such process)
open("/var/run/chronyd.pid", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
getpid()                                = 6601
fstat64(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001e000
write(3, "6601\n", 5)                   = 5
close(3)                                = 0
munmap(0x4001e000, 4096)                = 0
gettimeofday({1345720735, 942629}, NULL) = 0
gettimeofday({1345720735, 944873}, NULL) = 0
gettimeofday({1345720735, 947202}, NULL) = 0
gettimeofday({1345720735, 949294}, NULL) = 0
gettimeofday({1345720735, 951382}, NULL) = 0
gettimeofday({1345720735, 953632}, NULL) = 0
gettimeofday({1345720735, 955952}, NULL) = 0
gettimeofday({1345720735, 958027}, NULL) = 0
gettimeofday({1345720735, 960116}, NULL) = 0
gettimeofday({1345720735, 962363}, NULL) = 0
gettimeofday({1345720735, 964624}, NULL) = 0
gettimeofday({1345720735, 967430}, NULL) = 0
gettimeofday({1345720735, 969524}, NULL) = 0
gettimeofday({1345720735, 971771}, NULL) = 0
gettimeofday({1345720735, 974033}, NULL) = 0
gettimeofday({1345720735, 976144}, NULL) = 0
gettimeofday({1345720735, 978196}, NULL) = 0
gettimeofday({1345720735, 980403}, NULL) = 0
gettimeofday({1345720735, 982624}, NULL) = 0
gettimeofday({1345720735, 984667}, NULL) = 0
gettimeofday({1345720735, 986783}, NULL) = 0
gettimeofday({1345720735, 988994}, NULL) = 0
gettimeofday({1345720735, 991860}, NULL) = 0
gettimeofday({1345720735, 993908}, NULL) = 0
gettimeofday({1345720735, 996005}, NULL) = 0
gettimeofday({1345720735, 998214}, NULL) = 0
gettimeofday({1345720736, 435}, NULL)   = 0
gettimeofday({1345720736, 2644}, NULL)  = 0
gettimeofday({1345720736, 4854}, NULL)  = 0
gettimeofday({1345720736, 7127}, NULL)  = 0
gettimeofday({1345720736, 9338}, NULL)  = 0
gettimeofday({1345720736, 11557}, NULL) = 0
gettimeofday({1345720736, 13748}, NULL) = 0
gettimeofday({1345720736, 16634}, NULL) = 0
gettimeofday({1345720736, 18825}, NULL) = 0
gettimeofday({1345720736, 21040}, NULL) = 0
gettimeofday({1345720736, 23232}, NULL) = 0
gettimeofday({1345720736, 25786}, NULL) = 0
gettimeofday({1345720736, 27982}, NULL) = 0
gettimeofday({1345720736, 30188}, NULL) = 0
gettimeofday({1345720736, 32389}, NULL) = 0
gettimeofday({1345720736, 34591}, NULL) = 0
gettimeofday({1345720736, 37059}, NULL) = 0
gettimeofday({1345720736, 39250}, NULL) = 0
gettimeofday({1345720736, 41447}, NULL) = 0
gettimeofday({1345720736, 44286}, NULL) = 0
gettimeofday({1345720736, 46543}, NULL) = 0
gettimeofday({1345720736, 48736}, NULL) = 0
gettimeofday({1345720736, 50952}, NULL) = 0
gettimeofday({1345720736, 53149}, NULL) = 0
gettimeofday({1345720736, 55345}, NULL) = 0
gettimeofday({1345720736, 57766}, NULL) = 0
gettimeofday({1345720736, 59991}, NULL) = 0
gettimeofday({1345720736, 62190}, NULL) = 0
gettimeofday({1345720736, 64388}, NULL) = 0
gettimeofday({1345720736, 66649}, NULL) = 0
gettimeofday({1345720736, 69497}, NULL) = 0
gettimeofday({1345720736, 71714}, NULL) = 0
gettimeofday({1345720736, 73909}, NULL) = 0
gettimeofday({1345720736, 76161}, NULL) = 0
gettimeofday({1345720736, 78358}, NULL) = 0
gettimeofday({1345720736, 80560}, NULL) = 0
gettimeofday({1345720736, 82760}, NULL) = 0
gettimeofday({1345720736, 84958}, NULL) = 0
gettimeofday({1345720736, 99639}, NULL) = 0
gettimeofday({1345720736, 101857}, NULL) = 0
gettimeofday({1345720736, 103901}, NULL) = 0
gettimeofday({1345720736, 106664}, NULL) = 0
gettimeofday({1345720736, 108870}, NULL) = 0
gettimeofday({1345720736, 111093}, NULL) = 0
gettimeofday({1345720736, 113137}, NULL) = 0
gettimeofday({1345720736, 115192}, NULL) = 0
gettimeofday({1345720736, 117457}, NULL) = 0
gettimeofday({1345720736, 119687}, NULL) = 0
gettimeofday({1345720736, 121739}, NULL) = 0
gettimeofday({1345720736, 123798}, NULL) = 0
gettimeofday({1345720736, 126067}, NULL) = 0
gettimeofday({1345720736, 128289}, NULL) = 0
gettimeofday({1345720736, 131037}, NULL) = 0
gettimeofday({1345720736, 133096}, NULL) = 0
gettimeofday({1345720736, 135308}, NULL) = 0
gettimeofday({1345720736, 137579}, NULL) = 0
gettimeofday({1345720736, 139622}, NULL) = 0
gettimeofday({1345720736, 141680}, NULL) = 0
gettimeofday({1345720736, 143889}, NULL) = 0
gettimeofday({1345720736, 146183}, NULL) = 0
gettimeofday({1345720736, 148232}, NULL) = 0
gettimeofday({1345720736, 150301}, NULL) = 0
gettimeofday({1345720736, 152509}, NULL) = 0
gettimeofday({1345720736, 159638}, NULL) = 0
gettimeofday({1345720736, 161683}, NULL) = 0
gettimeofday({1345720736, 163725}, NULL) = 0
gettimeofday({1345720736, 165977}, NULL) = 0
gettimeofday({1345720736, 168199}, NULL) = 0
gettimeofday({1345720736, 170267}, NULL) = 0
gettimeofday({1345720736, 172311}, NULL) = 0
gettimeofday({1345720736, 175211}, NULL) = 0
gettimeofday({1345720736, 177597}, NULL) = 0
gettimeofday({1345720736, 179734}, NULL) = 0
gettimeofday({1345720736, 181786}, NULL) = 0
gettimeofday({1345720736, 183990}, NULL) = 0
gettimeofday({1345720736, 186353}, NULL) = 0
uname({sys="Linux", node="sw200319", ...}) = 0
gettimeofday({1345720736, 195807}, NULL) = 0
open("/etc/localtime", O_RDONLY)        = -1 ENOENT (No such file or directory)
write(2, "sys_linux.c:976:(get_version_spe"..., 60sys_linux.c:976:(get_version_specific_details)[23-11:18:56] ) = 60
write(2, "Linux kernel major=2 minor=6 pat"..., 38Linux kernel major=2 minor=6 patch=21
) = 38
gettimeofday({1345720736, 207631}, NULL) = 0
open("/etc/localtime", O_RDONLY)        = -1 ENOENT (No such file or directory)
write(2, "sys_linux.c:1019:(get_version_sp"..., 61sys_linux.c:1019:(get_version_specific_details)[23-11:18:56] ) = 61
write(2, "hz=100 shift_hz=7 freq_scale=0.9"..., 98hz=100 shift_hz=7 freq_scale=0.99902439 nominal_tick=10000 slew_delta_tick=833 max_tick_bias=1000
) = 98
adjtimex({modes=ADJ_OFFSET|0x8000, offset=0, freq=0, maxerror=16384000, esterror=16384000, status=STA_UNSYNC, constant=2, precision=1, tolerance=33554432, time={1345720736, 219254}, tick=10000, ppsfreq=0, jitter=0, shift=0, stabil=0, jitcnt=0, calcnt=0, errcnt=0, stbcnt=0}) = 5 (TIME_ERROR)
adjtimex({modes=ADJ_STATUS, offset=0, freq=0, maxerror=16384000, esterror=16384000, status=STA_UNSYNC, constant=2, precision=1, tolerance=33554432, time={1345720736, 223578}, tick=10000, ppsfreq=0, jitter=0, shift=0, stabil=0, jitcnt=0, calcnt=0, errcnt=0, stbcnt=0}) = 5 (TIME_ERROR)
adjtimex({modes=0, offset=0, freq=0, maxerror=16384000, esterror=16384000, status=STA_UNSYNC, constant=2, precision=1, tolerance=33554432, time={1345720736, 228558}, tick=10000, ppsfreq=0, jitter=0, shift=0, stabil=0, jitcnt=0, calcnt=0, errcnt=0, stbcnt=0}) = 5 (TIME_ERROR)
adjtimex({modes=0, offset=0, freq=0, maxerror=16384000, esterror=16384000, status=STA_UNSYNC, constant=2, precision=1, tolerance=33554432, time={1345720736, 232832}, tick=10000, ppsfreq=0, jitter=0, shift=0, stabil=0, jitcnt=0, calcnt=0, errcnt=0, stbcnt=0}) = 5 (TIME_ERROR)
SYS_281(0x2, 0x2, 0, 0x352b8, 0x37910)  = 3
fcntl64(3, F_GETFD)                     = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
SYS_294(0x3, 0x1, 0x2, 0xbead1be4, 0x4) = 0
SYS_294(0x3, 0x1, 0x6, 0xbead1be4, 0x4) = 0
SYS_294(0x3, 0x1, 0x1d, 0xbead1be4, 0x4) = 0
SYS_294(0x3, 0, 0x8, 0xbead1be4, 0x4)   = 0
SYS_282(0x3, 0xbead1bb4, 0x10, 0, 0x10) = 0
SYS_281(0xa, 0x2, 0, 0x352b8, 0x37910)  = -1 EAFNOSUPPORT (Address family not supported by protocol)
gettimeofday({1345720736, 269645}, NULL) = 0
open("/etc/localtime", O_RDONLY)        = -1 ENOENT (No such file or directory)
write(2, "ntp_io.c:117:(prepare_socket)[23"..., 43ntp_io.c:117:(prepare_socket)[23-11:18:56] ) = 43
write(2, "Could not open IPv6 NTP socket :"..., 59Could not open IPv6 NTP socket : No such file or directory
) = 59
gettimeofday({1345720736, 281347}, NULL) = 0
SYS_281(0x2, 0x2, 0, 0x143, 0x1)        = 4
fcntl64(4, F_GETFD)                     = 0
fcntl64(4, F_SETFD, FD_CLOEXEC)         = 0
SYS_294(0x4, 0x1, 0x2, 0xbead1be4, 0x4) = 0
SYS_282(0x4, 0xbead1bb4, 0x10, 0, 0x10) = 0
SYS_281(0xa, 0x2, 0, 0x143, 0x1)        = -1 EAFNOSUPPORT (Address family not supported by protocol)
gettimeofday({1345720736, 310609}, NULL) = 0
open("/etc/localtime", O_RDONLY)        = -1 ENOENT (No such file or directory)
write(2, "cmdmon.c:196:(prepare_socket)[23"..., 43cmdmon.c:196:(prepare_socket)[23-11:18:56] ) = 43
write(2, "Could not open IPv6 command sock"..., 63Could not open IPv6 command socket : No such file or directory
) = 63
open("/dev/pps0", O_RDWR)               = 5
fcntl64(5, F_GETFD)                     = 0
fcntl64(5, F_SETFD, FD_CLOEXEC)         = 0
ioctl(5, IOCTL_TISER_TIMEOUT, 0xbead1b50) = 0
ioctl(5, 0x800470a3, 0xbead1b9c)        = 0
ioctl(5, IOCTL_TISER_TIMEOUT, 0xbead1b50) = 0
ioctl(5, 0x400470a2, 0xbead1b50)        = 0
SYS_307(0x4e545030, 0x50, 0x380, 0x2, 0x4e545030) = -1 EINVAL (Invalid argument)
gettimeofday({1345720736, 347167}, NULL) = 0
open("/etc/localtime", O_RDONLY)        = -1 ENOENT (No such file or directory)
write(2, "refclock_shm.c:72:(shm_initialis"..., 48refclock_shm.c:72:(shm_initialise)[23-11:18:56] ) = 48
write(2, "Fatal error : shmget(1314148400,"..., 77Fatal error : shmget(1314148400,80,896) failed, errno: 22 (Invalid argument)
) = 77
exit_group(0)                           = ?
Process 6601 detached


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/