Re: ntpd errors after upgrade on current amd64

From: Jung-uk Kim <jkim_at_FreeBSD.org>
Date: Fri, 03 Apr 2015 03:27:46 -0400
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 04/02/2015 21:26, Cy Schubert wrote:
> In message <551DA257.6060100_at_FreeBSD.org>, Jung-uk Kim writes:
>> This is a multi-part message in MIME format. 
>> --------------090800070300040107060309 Content-Type: text/plain;
>> charset=utf-8 Content-Transfer-Encoding: 8bit
>> 
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
>> 
>> On 04/01/2015 11:32, Manfred Antar wrote:
>>> After build install world on current ntpd doesn't work. Here
>>> is error:
>>> 
>>> FreeBSD/amd64 (pozo.com) (ttyu0)
>>> 
>>> login: Apr  1 08:29:19 pozo ntpd[49825]: line 22 column 1
>>> syntax error
>> 
>> ntp_crypto.c was not properly merged.  Basically, the fix for 
>> SA-14:31.ntp was applied twice.  Please try the attached patch.
>> 
>>> Apr  1 08:29:19 pozo ntpd[49825]: setsockopt IPV6_MULTICAST_IF
>>> 0 for fe80::1%2 fails: Can't assign requested address
>> 
>> A separate issue, I think.
>> 
>> Jung-uk Kim
>> 
>> * Note: ntp_parser.y is redundant and it was the root cause of 
>> inconsistent builds and build failures, i.e., ntp_parser.c and 
>> ntp_parser.h may be regenerated on the *source* directory
>> depending on phase of the moon.  Although we can re-gen them
>> after r280915, upstream does not support BSD yacc.
> 
> Ntp_parser.y is not redundant.

It is redundant because ntp_parser.c and ntp_parser.h are generated
from ntp_parser.y.  Once it is done, it can be safely removed.  Remove
it and see for yourself.

> It is referenced by ntp_parser.c.

Nope.

# grep ntp_parser.y /usr/src/contrib/ntp/ntpd/ntp_parser.c
#line 14 "ntp_parser.y" /* yacc.c:339  */
#line 54 "ntp_parser.y" /* yacc.c:355  */
#line 371 "ntp_parser.y" /* yacc.c:1646  */
...
# grep ntp_parser.y /usr/src/contrib/ntp/ntpd/ntp_parser.h
#line 54 "ntp_parser.y" /* yacc.c:1909  */

These are inserted for debugging purpose only.  See yacc(1) for -l optio
n.

> I put that fix in two days ago.

Your "fix" is just to make ntp_parser.y compilable with our yacc(1).
Now ntp_parser.c and ntp_parser.h may be regenerated and *overwritten*
depending upon timestamps of these files.

# svn revert /usr/src/contrib/ntp/ntpd/ntp_parser.[chy]
# touch /usr/src/contrib/ntp/ntpd/ntp_parser.y
# cd /usr/src/usr.sbin/ntp/ntpd
# make depend
yacc -d /usr/src/usr.sbin/ntp/ntpd/../../../contrib/ntp/ntpd/ntp_parser.
y
mv y.tab.c
/usr/src/usr.sbin/ntp/ntpd/../../../contrib/ntp/ntpd/ntp_parser.c
...
# svn stat /usr/src/contrib/ntp/ntpd/ntp_parser.?
M       /usr/src/contrib/ntp/ntpd/ntp_parser.c

Unfortunately, bundled ntp_parser.c and ntp_parser.h were originally
generated with GNU Bison and the new ntp_parser.c is totally different.

# svn diff /usr/src/contrib/ntp/ntpd/ntp_parser.c | grep ^+ | wc -l
    1918
# svn diff /usr/src/contrib/ntp/ntpd/ntp_parser.c | grep ^- | wc -l
    3214.

If you really want to keep ntp_parser.y for some reason, ntp_parser.c
and ntp_parser.h must be removed from source tree instead.  Also, you
have to patch /usr/src/usr.sbin/ntp/ntpd/Makefile a little (hint:
replace ntp_parser.c with ntp_parser.y for SRCS and add "-I." to CFLAGS)
.

Basically, you have to remove either ntp_parser.y or ntp_parser.[ch].
 You just can't keep them all.

> I'll re-merge based on your second patch/the posted fix. I'll try
> it first in the port though.

Okay.

Jung-uk Kim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJVHkDoAAoJEHyflib82/FGTVQIAJ6wEudATveKaYSTok9Q5T5K
xwE3Ym6XdZqEXprKCSfeIea+EqeWNLmf7uDOsPqr2k0KwwN//sHhXAWR/9ze4+em
auypHxM3LTUEYZnoBvy17dOJ1gde/3jXZt9q8ZLnz3M91W439j5jWGGU6LXY97wy
Vlv97eqISEMPvI21pA3EI3xC3f56xM6fjruDMAq6VLarAfTaLmhn5fbMpP5XEBBF
hybSde+YVf36i/ojKPUYz2mSyJ1y7j+zR0n+S+ccLnGfoS/sXePdoDzjm0lNWVDa
bRpkZYbWrVQiGyw+equs6WORKBh0ZIICBaQa0IPGycrD0UKt37wx0YzN7xRDsQo=
=tkma
-----END PGP SIGNATURE-----
Received on Fri Apr 03 2015 - 05:27:47 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:56 UTC