NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/58678: ntpd crashes on sparc64
The following reply was made to PR bin/58678; it has been noted by GNATS.
From: Martin Husemann <martin%duskware.de@localhost>
To: Christos Zoulas <christos%zoulas.com@localhost>
Cc: gnats-bugs%netbsd.org@localhost
Subject: Re: bin/58678: ntpd crashes on sparc64
Date: Thu, 19 Sep 2024 13:48:37 +0200
The problem is (manual) over-optimization:
(gdb) p sizeof(res_addr6)
$1 = 32
(gdb) p sizeof(res_addr4)
$2 = 8
(gdb) p sizeof(restrict_u)
$3 = 64
So shaving 24 bytes off for each IPv4-only use of restrict_u makes the
following entries mis-aligned.
An easy fix (suggested by mlelstv) is:
#define V6_SIZEOF_RESTRICT_U sizeof(stuct restrict_u_tag)
#define V4_SIZEOF_RESTRICT_U V6_SIZEOF_RESTRICT_U
that is: always use the full allocation. This could be restricted to
alignment-critical architectures. Plus the rearanging to avoid internal
padding as I suggested before to save 4 bytes per struct on those
architectures.
Martin
Home |
Main Index |
Thread Index |
Old Index