1258945Sroberto Bug Id: 4095849 2258945Sroberto Category: kernel 3258945Sroberto Subcategory: syscall 4258945Sroberto State: evaluated 5258945Sroberto Synopsis: time_constant value >6 with PLL in use leads to integer divide 6258945Sroberto zero trap panic 7258945Sroberto Description: 8258945SrobertoIf the time_constant parameter is 7 or higher, and the phase-lock looping model 9258945Srobertois in use, the system will take a "integer divide zero trap" panic in 10258945Srobertothe clock routine as soon as the time_offset becomes non-zero. 11258945Sroberto 12258945Srobertotime_constant defaults to 0. The only place it is set is in the ntp_adjtime 13258945Srobertosystem call, from the 'constant' element of the timex structure argument. 14258945Sroberto 15258945Sroberto Work around: 16258945SrobertoNever set the constant element of the timex structure passed to ntp_adjtime to 17258945Srobertoa value larger than 6. 18258945Sroberto 19258945Srobertosatish.mynam@Eng 1998-04-30 20258945Sroberto1. Use Sun's version of NTP software instead of PD version. This problem 21258945Srobertois not seen with Sun's NTP version (which is mostly eqivalent to PD NTP 3.4 22258945Srobertoplus some Sun's local functionality futures). 23258945Sroberto 24258945Sroberto2. Workaround for the public domain NTP version ONLY: 25258945Sroberto ===================================================== 26258945SrobertoThe workaround for public domain NTP version is to disable the 27258945SrobertoKERNEL_PLL from the NTP code. This way ntp_Adjtime() system call is 28258945Srobertototally bypassed without sacrificing any of the functionality of the 29258945SrobertoNTP. The only hit you might see is the way kernel precision timminig 30258945Srobertois done without the PLL algorithm in the kernel. 31258945Sroberto 32258945Sroberto The easiest way to disable ntp_adjtime option is(without changing 33258945Sroberto any makefiles or other config files) to disable the KERNEL_PLL 34258945Sroberto value in the ./config.h file. 35258945Sroberto 36258945SrobertoAfter doing a ./configure for probing for all the necessary tools(compilers, 37258945Srobertoos version, libraries), please comment out KERNEL_PLL macro in 38258945Srobertothe ./config.h file. This will disable the KERNEL_PLL part of the source 39258945Srobertocode and the newly obtained xntpd is just similar to the old one but it 40258945Srobertodoes not use ntp_adjtime() system call. This prevents it from panic'ng 41258945Srobertothe kernel. 42258945Sroberto 43258945Sroberto/*#define KERNEL_PLL 1*/ 44258945Sroberto 45258945SrobertoI complied a new xntpd binary this way and it does nothave any ntp_adjtime() 46258945Srobertorelated stuff. 47258945Sroberto 48258945SrobertoDefault: 49258945Sroberto======= 50258945Sroberto/net/divya/export/home/mynam/public_domain/ntp/xntp3-5.92/xntpd>strings 51258945Srobertoxntpd | 52258945Srobertogrep ntp_adjtime 53258945Sroberto354:adj_frequency: ntp_adjtime failed: %m 54258945Sroberto357:loop_config: ntp_adjtime() failed: %m 55258945Sroberto435:get_kernel_info: ntp_adjtime() failed: %m 56258945Sroberto 57258945SrobertoWith KERNEL_PLL disabled in config.h file 58258945Sroberto-======================= 59258945Sroberto 60258945Sroberto/net/divya/export/home/mynam/public_domain/ntp/xntp3-5.92/xntpd>strings 61258945Srobertoxntpd.nopll | grep ntp_adjtime 62258945Sroberto 63258945Sroberto Integrated in releases: 64258945Sroberto Duplicate of: 65258945Sroberto Patch id: 66258945Sroberto See also: 4133517 67258945Sroberto Summary: 68258945SrobertoIf the time_constant parameter is 7 or higher, and the phase-lock looping model 69258945Srobertois in use, the system will take a "integer divide zero trap" panic in 70258945Srobertothe clock routine as soon as the time_offset becomes non-zero. 71258945Sroberto 72258945Srobertotime_constant defaults to 0. The only place it is set is in the ntp_adjtime 73258945Srobertosystem call, from the 'constant' element of the timex structure argument. 74258945Sroberto---------------------------------------------------------------------------- 75