1290001SglebiusProblem with recent ANSI compilers 2290001Sglebius 3290001SglebiusOn some systems, including AIX, the compiler quits on the ntp_refclock.c 4290001Sglebiusfile when processing the refclock_report() routine. The problem, which 5290001Sglebiusis eithre a feature or a bug, has to do with an unwanted promotion of 6290001Sglebiusthe u_char argument to an int and a failure of the compiler to recognize 7290001Sglebiusthe preceding prototype. A workaround is to use ANSI syntax to delare 8290001Sglebiusthe arguments. Since ANSI compilers are not universally available, this 9290001Sglebiussyntax can't be used in the stock distribution. 10290001Sglebius 11290001Sglebius(Message # 60: 2884 bytes, New) 12290001SglebiusDate: Sat, 19 Aug 1995 13:20:50 -0400 13290001SglebiusFrom: "R. Bernstein" <rocky@panix.com> 14290001SglebiusNewsgroups: comp.protocols.time.ntp 15290001Sglebiusto: mills@udel.edu 16290001Sglebiusreturn-receipt-to: rocky@panix.com 17290001SglebiusSubject: time and AIX 3.2.5 raw tty bug 18290001Sglebius 19290001SglebiusThis posting isn't strictly about NTP, any program that may stop the 20290001Sglebiusclock or set the clock backwards is subject to the AIX 3.2.5 bug. 21290001Sglebius 22290001SglebiusOn AIX 3.2.5, there is a bug in the tty driver for a raw device which 23290001Sglebiusmay crash the box under certain conditions: basically a read() on a 24290001Sglebiusraw tty in effect, a character was read but not as many as specified 25290001Sglebiusby VMIN when a read timeout occurred. VTIME specifies the timeout. See 26290001Sglebiusthe AIX manual page on termios.h or that include file. for Information 27290001Sglebiuson VMIN (or MIN) VTIME (or TIME). 28290001Sglebius 29290001SglebiusA remedy other than to not use raw tty's is to apply patch U435110. 30290001Sglebius 31290001SglebiusDetails of the problem report follow. 32290001Sglebius 33290001Sglebius> ABSTRACT: 34290001Sglebius> IX43779: TRAP IN PSX_TIMEO 35290001Sglebius> 36290001Sglebius> ORIGINATING DETAILS: 37290001Sglebius> Stacktrace shows: 38290001Sglebius> IAR: 01460214 posixdd:psx_timeo + 8bf4: ti 4,r12,0x0 39290001Sglebius> *LR: 014601a0 posixdd:psx_timeo + 8b80 40290001Sglebius> 00212c60: 014604f4 posixdd:psx_timer + 8ed4 41290001Sglebius> 00212cc0: 0144b74c ttydd:tty_do_offlevel + 4284 42290001Sglebius> 00212d20: 000216fc .i_offlevel + 8c 43290001Sglebius> 00212d70: 00021d78 .i_softint + c8 44290001Sglebius> 00001004: 00008714 .finish_interrupt + 80 45290001Sglebius> 46290001Sglebius> RESPONDER SUMMARY: 47290001Sglebius> AIX asserted in psx_timeo(). Reason for the assert was that 48290001Sglebius> the current time was behind psx_ctime. Since this state 49290001Sglebius> can occur when the current time is changed after a character 50290001Sglebius> is received but before the VTIME interbyte timer pops, we 51290001Sglebius> should not assert on this. 52290001Sglebius> 53290001Sglebius> RESPONDER CONCLUSION: 54290001Sglebius> Removed the requirement that current time > psx_ctime by 55290001Sglebius> adding a new L_ntimersub macro that is used instead of the 56290001Sglebius> ntimersub macro in time.h. Also added a test for (current 57290001Sglebius> time - psx_ctime) being negative, in that case we do not 58290001Sglebius> adjust the new timeout. 59290001Sglebius> 60290001Sglebius> Reported to Correct a PTF in Error: NO 61290001Sglebius> Reported as a Highly pervasive problem: NO 62290001Sglebius> 63290001Sglebius> PE Apar?: NoPE 64290001Sglebius> Hiper Apar?: NoHiper 65290001Sglebius> Status: CLOSED PER 66290001Sglebius> Component Name: AIX V3 FOR RS/6 67290001Sglebius> Version: 320 68290001Sglebius> Component ID: 575603001 69290001Sglebius> Submitted: 94/05/03 70290001Sglebius> Closed: 94/05/05 71290001Sglebius> ChangeTeam: TX2527 72290001Sglebius> 73290001Sglebius> APAR FIXED BY: U431696 U432151 U432844 U432870 U432979 74290001Sglebius> U433049 U433081 U433459 U433876 U433906 U434598 U434453 75290001Sglebius> U434672 U434737 U435110 76290001Sglebius 77