From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: emacs reproducible builds part1 of 2 : eln Date: Fri, 12 Jan 2024 11:19:58 -0500 Message-ID: References: <8d01d73e-7ce1-4b3a-a25c-03b518a7e584@lsmod.de> <83jzofj70t.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23336"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: "Bernhard M. Wiedemann" , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jan 12 17:20:52 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rOKH5-0005qb-TV for ged-emacs-devel@m.gmane-mx.org; Fri, 12 Jan 2024 17:20:51 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rOKGU-0003Xb-5c; Fri, 12 Jan 2024 11:20:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOKGI-0003TP-4J for emacs-devel@gnu.org; Fri, 12 Jan 2024 11:20:02 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOKGG-0005bj-Ho; Fri, 12 Jan 2024 11:20:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=Tbjazcy8BBFZttoCdG/PX3shlPrTWdGFI0TXf8RIS3I=; b=q/g4JA0f3WnORC81Cg4J jIob7NLKKSMbhb9j0ta8FlGb4C6yPhsonGwFaXDIXl5y+i33fZi5B4mysekIvuIiyHStkCPtOdZlm hyFuPl88Kls2C59X6RchEWPO+eHPf4X7wc/8uOonkuaaz4koRb+DcH0EX+vbl+F1wVlaJr85yhv6F SKfF5GPv/Q8Xb73bFO8dgmb/zhNTX15vMn7IwpJcJMkBnHNZvSsmrtpY5omu09p+Zorp0ikP+VxRD BBQP+jSOwNXrH43SF7tfebT8xsZEeCqaYtfrX0X9++ExBYc06Qnpt9HgdG43gKSNXhP7uUD4DHnnT IKMgLx/zVBwzpg==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1rOKGE-0004N0-Jd; Fri, 12 Jan 2024 11:19:59 -0500 In-Reply-To: <83jzofj70t.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 12 Jan 2024 10:22:10 +0200") X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:314911 Archived-At: Eli Zaretskii writes: >> Date: Thu, 11 Jan 2024 22:17:24 +0100 >> From: "Bernhard M. Wiedemann" >> >> I'm working on reproducible builds for openSUSE >> and in that process found that our emacs-29.1 >> package varies across builds from 2 different issues >> >> The diff is visible at >> https://rb.zq1.de/compare.factory-20231231/diffs/emacs-compare.out >> >> Here is a simple reproducer that works in our build env: >> >> cd ~/rpmbuild/BUILD/emacs-29.1/native-lisp && >> for i in $(seq 10) ; do >> ../src/emacs -batch \ >> --eval "(batch-native-compile t)" ../lisp/term/x-win.el && >> md5sum 29.1-70b784e9/x-win-3c49581f-6ddb7e08.eln >> done | sort | uniq -c >> >> >> That prints variations of >> 6 0c749bdbef8d9fa7b1afc2f042caf45b >> 29.1-70b784e9/x-win-3c49581f-6ddb7e08.eln >> 2 3022ea8c675b69ac79005281fd824179 >> 29.1-70b784e9/x-win-3c49581f-6ddb7e08.eln >> 2 57bc581456c38395e9ac6409bbcb0d6e >> 29.1-70b784e9/x-win-3c49581f-6ddb7e08.eln >> >> >> while the same with setarch -R ../src/emacs >> produces deterministic >> 10 0c749bdbef8d9fa7b1afc2f042caf45b >> 29.1-70b784e9/x-win-3c49581f-6ddb7e08.eln >> >> So somewhere in the batch-native-compile code is a place that adds >> ASLR-related non-determinism into the .eln file. From the diff, it >> probably is some ordering issue. >> >> I'd appreciate pointers to where that non-determinism gets added and how >> to patch it out. > > Andrea, can you perhaps help Bernhard understand where the differences > come from? Mmmh, from what I can see from the diff looks like to me in x-win we have some circular object. For some reason when we serialize (print) it in order to store it into the eln the result is not reproducible with ASLR (!?). That's bizarre. Andrea