Bug 1182604 - automake creates non-deterministic output
Summary: automake creates non-deterministic output
Status: VERIFIED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Development (show other bugs)
Version: Current
Hardware: Other All
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Josef Möllers
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-23 11:08 UTC by Bernhard Wiedemann
Modified: 2023-04-06 15:59 UTC (History)
1 user (show)

See Also:
Found By: Development
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
automake-reproducible.patch (1.59 KB, patch)
2021-02-23 20:56 UTC, Dirk Mueller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Wiedemann 2021-02-23 11:08:28 UTC
While working on reproducible builds for openSUSE, I found that
when building our pcre package, it varied /usr/libexec/pcre/testsuite/Makefile
created from varying Makefile.in created by automake

I did with osc build + osc chroot
cd ~/rpmbuild/BUILD/pcre-8.44
for i in $(seq 1 10 ) ; do 
  automake --add-missing --copy --force-missing 2>/dev/null
  md5sum Makefile.in
done |sort|uniq -c
      4 d18dc119aa88ac245d946fa4ea74e934  Makefile.in
      6 e05d9741e836163b6137d3c2cca6ac58  Makefile.in

My analysis tools tell me, that the output becomes deterministic when having deterministic readdir order and disabled ASLR.

e.g. in the above example, one can add setarch -R to get 10 times the same result, because the filesystem does not change during the test.

We want to be able to reproduce identical output later+elsewhere.
Comment 1 Bernhard Wiedemann 2021-02-23 13:06:19 UTC
Adding some diffs to help debugging:
+++ /usr/libexec/pcre/testsuite/Makefile
        -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-distclean-local:
 clean-local:
+distclean-local:


+++ /home/abuild/rpmbuild/BUILD/pcre-8.44/Makefile.in
@@ -3103,8 +3103,8 @@
        @echo "it deletes files that may require special tools to rebuild."
        -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
        -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-@WITH_GCOV_FALSE@distclean-local:
 @WITH_GCOV_FALSE@clean-local:
+@WITH_GCOV_FALSE@distclean-local:
Comment 2 Dirk Mueller 2021-02-23 19:40:19 UTC
yeah, so that basically indicates missing sort's in iterating over perl hashes in bin/automake.in

in many cases that I've seen, it does do a foreach on sorted keys, but maybe we're missing something here and there. 

IMHO this is an upsteram problem, care to report it there?
Comment 3 Dirk Mueller 2021-02-23 20:56:35 UTC
Created attachment 846418 [details]
automake-reproducible.patch
Comment 4 OBSbugzilla Bot 2021-02-23 23:10:06 UTC
This is an autogenerated message for OBS integration:
This bug (1182604) was mentioned in
https://build.opensuse.org/request/show/874730 Factory / automake
Comment 5 Josef Möllers 2021-02-24 07:58:29 UTC
Thanks Dirk! I just reported this bug upstream to bug-automake@gnu.org, attaching your patch (giving due credit!).
I'll close this bug now.
Comment 6 Bernhard Wiedemann 2021-02-25 13:39:37 UTC
Thanks Dirk and Josef.
Comment 10 Swamp Workflow Management 2021-06-28 16:18:46 UTC
SUSE-RU-2021:2173-1: An update that has 5 recommended fixes and contains one feature can now be installed.

Category: recommended (moderate)
Bug References: 1040589,1047218,1182604,1185540,1186049
CVE References: 
JIRA References: SLE-17848
Sources used:
SUSE MicroOS 5.0 (src):    pcre-8.41-6.4.2
SUSE Linux Enterprise Module for Development Tools 15-SP3 (src):    brp-check-suse-84.87+git20181106.224b37d-3.18.2
SUSE Linux Enterprise Module for Development Tools 15-SP2 (src):    brp-check-suse-84.87+git20181106.224b37d-3.18.2
SUSE Linux Enterprise Module for Basesystem 15-SP3 (src):    automake-1.15.1-4.10.2, pcre-8.41-6.4.2
SUSE Linux Enterprise Module for Basesystem 15-SP2 (src):    automake-1.15.1-4.10.2, pcre-8.41-6.4.2

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 11 Swamp Workflow Management 2021-07-03 01:16:27 UTC
openSUSE-RU-2021:0963-1: An update that has 5 recommended fixes and contains one feature can now be installed.

Category: recommended (moderate)
Bug References: 1040589,1047218,1182604,1185540,1186049
CVE References: 
JIRA References: SLE-17848
Sources used:
openSUSE Leap 15.2 (src):    automake-1.15.1-lp152.5.3.1, automake-testsuite-1.15.1-lp152.5.3.1, brp-check-suse-84.87+git20181106.224b37d-lp152.2.12.1, pcre-8.41-lp152.7.3.1
Comment 12 Swamp Workflow Management 2021-07-11 10:25:00 UTC
openSUSE-RU-2021:2173-1: An update that has 5 recommended fixes and contains one feature can now be installed.

Category: recommended (moderate)
Bug References: 1040589,1047218,1182604,1185540,1186049
CVE References: 
JIRA References: SLE-17848
Sources used:
openSUSE Leap 15.3 (src):    automake-1.15.1-4.10.2, brp-check-suse-84.87+git20181106.224b37d-3.18.2, pcre-8.41-6.4.2