From owner-freebsd-bugs@FreeBSD.ORG Sun Sep 15 22:50:02 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 49267A34 for ; Sun, 15 Sep 2013 22:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 334442A3C for ; Sun, 15 Sep 2013 22:50:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r8FMo1Q6017604 for ; Sun, 15 Sep 2013 22:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r8FMo1VD017602; Sun, 15 Sep 2013 22:50:01 GMT (envelope-from gnats) Date: Sun, 15 Sep 2013 22:50:01 GMT Message-Id: <201309152250.r8FMo1VD017602@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Jilles Tjoelker Subject: Re: bin/182098: [patch] Change kldxref fts_open ordering so it produces a consistent linker.hints between machines of the same architecture. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Jilles Tjoelker List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Sep 2013 22:50:02 -0000 The following reply was made to PR bin/182098; it has been noted by GNATS. From: Jilles Tjoelker To: bug-followup@FreeBSD.org, dereks@lifeofadishwasher.com Cc: Subject: Re: bin/182098: [patch] Change kldxref fts_open ordering so it produces a consistent linker.hints between machines of the same architecture. Date: Mon, 16 Sep 2013 00:39:58 +0200 In PR bin/182098, you wrote: > Currently there an issue with linker.hints being different between > machines that create binary update for freebsd-update. > 'kldxref /boot/kernel/' will produce different linker.hints due to the > way the fts_open() traverses the file system: In the interest of reproducible builds, your patch seems a good idea. It seems unattractive to run kldxref /boot/kernel on every machine. The implementation of compare() seems unnecessarily complex though. In find -s, the fts_names are simply passed to strcoll() (here, strcmp() would be better). The trickery with the length may cause inconsistent results if one filename is a prefix of another (rare). This change may also expose a latent bug with kldxref -R: it does not work properly if a directory contains both files that need a mention in a hints file and subdirectories, and at least one such file appears after a subdirectory. Because your change alters the traversal order, it might break a use of kldxref -R that previously happened to work. You can make it work reliably by sorting FTS_D entries after other entries. -- Jilles Tjoelker