Created attachment 894886 [details] build.log Test lcms-cri-cam02-ucs condition: (ert-test-failed ((should (eql 0.0 (lcms-cam02-ucs ... ...))) :form (eql 0.0 3.4662020221023775e-16) :value nil)) FAILED 2/6 lcms-cri-cam02-ucs (0.000099 sec) at src/lcms-tests.el:66 passed 3/6 lcms-dE-cam02-ucs-silver (0.000328 sec) passed 4/6 lcms-jmh->cam02-ucs-silver (0.000079 sec) passed 5/6 lcms-roundtrip (0.000110 sec) passed 6/6 lcms-whitepoint (0.000136 sec) Ran 6 tests, 5 results as expected, 1 unexpected (2024-06-01 19:51:10+0000, 0.042991 sec) 1 unexpected results: FAILED lcms-cri-cam02-ucs ((should (eql 0.0 (lcms-cam02-ucs '(0.5 0.5 0.5) '(0.5 0.5 0.5)))) :form (eql 0.0 3.4662020221023775e-16) :value nil)
Created attachment 894887 [details] environment // profile default/linux/amd64/17.1/desktop/plasma gcc O3 pipe march=native(verbose) lto graphite ggdb3
Could you try narrow down if it stops / starts happening if you alter your *FLAGS?
iteration 1: not happens when -O0 and no LTO ``` MARCH_NATIVE_GCC="-march=alderlake -mabm -mno-cldemote -mno-kl -mno-pconfig -mno-sgx -mno-widekl -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=30720" LTO_WARNINGS_GCC="-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing" LTO_FLAGS_GCC="-flto ${LTO_WARNINGS_GCC}" GCC_POLLY="-fgraphite-identity -floop-interchange -floop-strip-mine -floop-nest-optimize" DEBUG_FLAGS_GCC="-ggdb3" BECAUSE_PACKAGE_TESTING_WIKI_CF="-frecord-gcc-switches" BECAUSE_PACKAGE_TESTING_WIKI_LDF="-Wl,--defsym=__gentoo_check_ldflags__=0" COMMON_FLAGS="-O0 -pipe ${MARCH_NATIVE_GCC} ${GCC_POLLY} ${DEBUG_FLAGS_GCC} ${BECAUSE_PACKAGE_TESTING_WIKI_CF}" CFLAGS="${COMMON_FLAGS}" CXXFLAGS="${COMMON_FLAGS}" FCFLAGS="${COMMON_FLAGS}" FFLAGS="${COMMON_FLAGS}" LDFLAGS="${LDFLAGS} ${BECAUSE_PACKAGE_TESTING_WIKI_LDF}" ```
iteration 2: not happens when O0 and LTO . ``` MARCH_NATIVE_GCC="-march=alderlake -mabm -mno-cldemote -mno-kl -mno-pconfig -mno-sgx -mno-widekl -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=30720" LTO_WARNINGS_GCC="-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing" LTO_FLAGS_GCC="-flto ${LTO_WARNINGS_GCC}" GCC_POLLY="-fgraphite-identity -floop-interchange -floop-strip-mine -floop-nest-optimize" DEBUG_FLAGS_GCC="-ggdb3" BECAUSE_PACKAGE_TESTING_WIKI_CF="-frecord-gcc-switches" BECAUSE_PACKAGE_TESTING_WIKI_LDF="-Wl,--defsym=__gentoo_check_ldflags__=0" COMMON_FLAGS="-O0 -pipe ${MARCH_NATIVE_GCC} ${GCC_POLLY} ${LTO_FLAGS_GCC} ${DEBUG_FLAGS_GCC} ${BECAUSE_PACKAGE_TESTING_WIKI_CF}" CFLAGS="${COMMON_FLAGS}" CXXFLAGS="${COMMON_FLAGS}" FCFLAGS="${COMMON_FLAGS}" FFLAGS="${COMMON_FLAGS}" LDFLAGS="${LDFLAGS} ${BECAUSE_PACKAGE_TESTING_WIKI_LDF}" ```
iteration 3: not happens when O2 and LTO ``` What compiler should emacs be built with? x86_64-pc-linux-gnu-gcc -O2 -pipe -march=alderlake -mabm -mno-cldemote -mno-kl -mno-pconfig -mno-sgx -mno-widekl -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=30720 -fgraphite-identity -floop-interchange -floop-strip-mine -floop-nest-optimize -flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -ggdb3 -frecord-gcc-switches ```
iteration 4: IT HAPPENS when O3 and no lto
iteration 5: IT HAPPENS when O3 , no lto and no graphite
iteration 6: not happens when O2 and some flags from O3 ( according to https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html ) , and graphite and no LTO. ``` MARCH_NATIVE_GCC="-march=alderlake -mabm -mno-cldemote -mno-kl -mno-pconfig -mno-sgx -mno-widekl -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=30720" LTO_WARNINGS_GCC="-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing" LTO_FLAGS_GCC="-flto ${LTO_WARNINGS_GCC}" GCC_POLLY="-fgraphite-identity -floop-interchange -floop-strip-mine -floop-nest-optimize" DEBUG_FLAGS_GCC="-ggdb3" BECAUSE_PACKAGE_TESTING_WIKI_CF="-frecord-gcc-switches" BECAUSE_PACKAGE_TESTING_WIKI_LDF="-Wl,--defsym=__gentoo_check_ldflags__=0" SOME_O3_FLAGS="-fgcse-after-reload -fipa-cp-clone -floop-interchange -floop-unroll-and-jam -fpeel-loops -fpredictive-commoning -fsplit-loops" COMMON_FLAGS="-O2 -pipe ${SOME_O3_FLAGS} ${MARCH_NATIVE_GCC} ${GCC_POLLY} ${DEBUG_FLAGS_GCC} ${BECAUSE_PACKAGE_TESTING_WIKI_CF}" CFLAGS="${COMMON_FLAGS}" CXXFLAGS="${COMMON_FLAGS}" FCFLAGS="${COMMON_FLAGS}" FFLAGS="${COMMON_FLAGS}" LDFLAGS="${LDFLAGS} ${BECAUSE_PACKAGE_TESTING_WIKI_LDF}" ```
iteration 7: not happens when O2 and "second half" of O3 flags. second half of O3 flags : -fsplit-paths -ftree-loop-distribution -ftree-partial-pre -funswitch-loops -fvect-cost-model=dynamic -fversion-loops-for-strides
iteration 8: when O2 and all flags from O3, graphite, no lto, aka : ``` What compiler should emacs be built with? x86_64-pc-linux-gnu-gcc -O2 -pipe -fgcse-after-reload -fipa-cp-clone -floop-interchange -floop-unroll-and-jam -fpeel-loops -fpredictive-commoning -fsplit-loops -fsplit-paths -ftree-loop-distribution -ftree-partial-pre -funswitch-loops -fvect-cost-model=dynamic -fversion-loops-for-strides -march=alderlake -mabm -mno-cldemote -mno-kl -mno-pconfig -mno-sgx -mno-widekl -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=30720 -fgraphite-identity -floop-interchange -floop-strip-mine -floop-nest-optimize -ggdb3 -frecord-gcc-switches ``` I've got ANOTHER test fail: ``` Test mml-secure-en-decrypt-2 backtrace: signal(wrong-type-argument (stringp nil)) mml-secure-test-fixture(#f(compiled-function () #<bytecode -0x22b5be466686a1e>)) mml-secure-test-key-fixture(#f(compiled-function () #<bytecode -0x14ac1f018116df79>)) #f(compiled-function () #<bytecode -0xa2dd9dd4c45ec1>)() ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test :name mml-secure-en-decrypt-2 :documentation "Encrypt message; then decrypt an..." :body #f(compiled-function () #<bytecode -0xa2dd9dd4c45ec1>) :most-recent-result #s(ert-test-failed :messages "" :should-forms (... ... ... ... ... ... ... ...) :duration 0.58437717 :condition (wrong-type-argument stringp nil) :backtrace (... ... ... ... ... ... ... ... ... ... ... ... ...) :infos nil) :expected-result-type :passed :tags nil :file-name "/var/tmp/portage/app-editors/ema...") :result #s(ert-test-failed :messages "" :should-forms ((... :form ... :value ...) (... :form ... :value ...) (... :form ... :value t :explanation nil) (... :form ... :value "gpg2 --no-tty --status-fd 1 --ye...") (... :form ... :value 270) (... :form ... :value t :explanation nil) (... :form ... :value "gpg2 --no-tty --status-fd 1 --ye...") (... :form ... :value 270)) :duration 0.58437717 :condition (wrong-type-argument stringp nil) :backtrace (#s(backtrace-frame :evald t :fun signal :args ... :flags nil :locals ... :buffer nil :pos nil) #s(backtrace-frame :evald t :fun mml-secure-test-fixture :args ... :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun mml-secure-test-key-fixture :args ... :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun #f(compiled-function () #<bytecode -0xa2dd9dd4c45ec1>) :args nil :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert--run-test-internal :args #0 :flags nil :locals ... :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-test :args ... :flags nil :locals ... :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-or-rerun-test :args ... :flags nil :locals ... :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-tests :args ... :flags nil :locals ... :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-tests-batch :args ... :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-tests-batch-and-exit :args ... :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun command-line-1 :args ... :flags nil :locals ... :buffer nil :pos nil) #s(backtrace-frame :evald t :fun command-line :args nil :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun normal-top-level :args nil :flags nil :locals nil :buffer nil :pos nil)) :infos nil) :exit-continuation #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_22> :next-debugger debug :ert-debug-on-error nil)) ert-run-test(#s(ert-test :name mml-secure-en-decrypt-2 :documentation "Encrypt message; then decrypt and test for e..." :body #f(compiled-function () #<bytecode -0xa2dd9dd4c45ec1>) :most-recent-result #s(ert-test-failed :messages "" :should-forms (((skip-unless (test-conf)) :form (test-conf) :value ((program . "/usr/bin/gpg2") (curve . "cv25519;ed25519;cv25519;ed25519;cv448;ed448;...") (compressname . "Uncompressed;ZIP;ZLIB;BZIP2") (compress 0 1 2 3) (digestname . "SHA1;RIPEMD160;SHA256;SHA384;SHA512;SHA224") (digest 2 3 8 9 10 11) (ciphername . "IDEA;3DES;CAST5;BLOWFISH;AES;AES192;AES256;T...") (cipher 1 2 3 4 7 8 9 10 11 12 13) (pubkeyname . "RSA;ELG;DSA;ECDH;ECDSA;EDDSA") (pubkey 1 16 17 18 19 22) (version . "2.4.4"))) ((skip-unless (ignore-errors ...)) :form (condition-case nil (progn ...) (error nil)) :value ((program . "/usr/bin/gpgsm") (version . "2.4.4"))) ((should (equal plaintext decrypted)) :form (equal "The Magic Words are Squeamish Ossifrage" "The Magic Words are Squeamish Ossifrage") :value t :explanation nil) ((should (and end match)) :form (and end match) :value "gpg2 --no-tty --status-fd 1 --yes --homedir ...") ((should (string-match-p ... match)) :form (string-match-p "-r 2FAF8726121EB3C6" "gpg2 --no-tty --status-fd 1 --yes --homedir ...") :value 270) ((should (equal plaintext decrypted)) :form (equal "The Magic Words are Squeamish Ossifrage" "The Magic Words are Squeamish Ossifrage") :value t :explanation nil) ((should (and end match)) :form (and end match) :value "gpg2 --no-tty --status-fd 1 --yes --homedir ...") ((should (string-match-p ... match)) :form (string-match-p "-r 2FAF8726121EB3C6" "gpg2 --no-tty --status-fd 1 --yes --homedir ...") :value 270)) :duration 0.58437717 :condition (wrong-type-argument stringp nil) :backtrace (#s(backtrace-frame :evald t :fun signal :args (wrong-type-argument (stringp nil)) :flags nil :locals ((debugger-may-continue . t) (inhibit-redisplay) (inhibit-debugger . t) (inhibit-changing-match-data)) :buffer nil :pos nil) #s(backtrace-frame :evald t :fun mml-secure-test-fixture :args (#f(compiled-function () #<bytecode -0x22b5be466686a1e>)) :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun mml-secure-test-key-fixture :args (#f(compiled-function () #<bytecode -0x14ac1f018116df79>)) :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun #f(compiled-function () #<bytecode -0xa2dd9dd4c45ec1>) :args nil :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert--run-test-internal :args (#s(ert--test-execution-info :test #1 :result #2 :exit-continuation #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_22> :next-debugger debug :ert-debug-on-error nil)) :flags nil :locals ((ert--infos) (debug-ignored-errors) (debug-on-quit . t) (backtrace-on-error-noninteractive) (debug-on-error . t) (debugger . #f(compiled-function (&rest args) #<bytecode -0x1bd09e3c96fe7b7>)) (lexical-binding . t)) :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-test :args #0 :flags nil :locals ((ert--running-tests #1) (message-log-max . t) (ert--should-execution-observer . #f(compiled-function (form-description) #<bytecode 0x1ec6380c9f69cf26>))) :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-or-rerun-test :args (#s(ert--stats :selector ... :tests ... :test-map #<hash-table eql 16/16 0x155e0f6b2bcd> :test-results ... :test-start-times ... :test-end-times ... :passed-expected 1 :passed-unexpected 0 :failed-expected 0 :failed-unexpected 1 :skipped 0 :start-time ... :end-time nil :aborted-p nil :current-test #1 :next-redisplay 0.0) #1 #f(compiled-function (event-type &rest event-args) #<bytecode -0x10587fbed09a624f>)) :flags nil :locals ((ert--current-run-stats . ...)) :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-tests :args ((not ...) #f(compiled-function (event-type &rest event-args) #<bytecode -0x10587fbed09a624f>) nil) :flags nil :locals ((ert--current-run-stats . ...)) :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-tests-batch :args ((not ...)) :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-tests-batch-and-exit :args ((not ...)) :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun command-line-1 :args (("-L" ":." "-l" "ert" "--eval" "(setq ert-batch-backtrace-right-margin nil)" "-l" "lisp/gnus/mml-sec-tests" "--eval" "(ert-run-tests-batch-and-exit (quote (not (o...")) :flags nil :locals ((command-line-args-left) (argi . "-eval")) :buffer nil :pos nil) #s(backtrace-frame :evald t :fun command-line :args nil :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun normal-top-level :args nil :flags nil :locals nil :buffer nil :pos nil)) :infos nil) :expected-result-type :passed :tags nil :file-name "/var/tmp/portage/app-editors/emacs-29.3-r2/w...")) ert-run-or-rerun-test(#s(ert--stats :selector (not ...) :tests [... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...] :test-map #<hash-table eql 16/16 0x155e0f6b2bcd> :test-results [... ... nil nil nil nil nil nil nil nil nil nil nil nil nil nil] :test-start-times [... ... nil nil nil nil nil nil nil nil nil nil nil nil nil nil] :test-end-times [... ... nil nil nil nil nil nil nil nil nil nil nil nil nil nil] :passed-expected 1 :passed-unexpected 0 :failed-expected 0 :failed-unexpected 1 :skipped 0 :start-time (26204 27082 682462 650000) :end-time nil :aborted-p nil :current-test #s(ert-test :name mml-secure-en-decrypt-2 :documentation "Encrypt message; the..." :body #f(compiled-function () #<bytecode -0xa2dd9dd4c45ec1>) :most-recent-result ... :expected-result-type :passed :tags nil :file-name "/var/tmp/portage/app...") :next-redisplay 0.0) #s(ert-test :name mml-secure-en-decrypt-2 :documentation "Encrypt message; the..." :body #f(compiled-function () #<bytecode -0xa2dd9dd4c45ec1>) :most-recent-result #s(ert-test-failed :messages "" :should-forms ... :duration 0.58437717 :condition ... :backtrace ... :infos nil) :expected-result-type :passed :tags nil :file-name "/var/tmp/portage/app...") #f(compiled-function (event-type &rest event-args) #<bytecode -0x10587fbed09a624f>)) ert-run-tests((not (or (tag :expensive-test) (tag :unstable))) #f(compiled-function (event-type &rest event-args) #<bytecode -0x10587fbed09a624f>) nil) ert-run-tests-batch((not (or (tag :expensive-test) (tag :unstable)))) ert-run-tests-batch-and-exit((not (or (tag :expensive-test) (tag :unstable)))) command-line-1(("-L" ":." "-l" "ert" "--eval" "(setq ert-batch-backtrace-right-margin nil)" "-l" "lisp/gnus/mml-sec-tests" "--eval" "(ert-run-tests-batch-and-exit (quote (not (or (tag...")) command-line() normal-top-level() Test mml-secure-en-decrypt-2 condition: (wrong-type-argument stringp nil) FAILED 2/16 mml-secure-en-decrypt-2 (0.584377 sec) at lisp/gnus/mml-sec-tests.el:591 ```
Created attachment 894952 [details] build_it8.log.lz iteration 8 /// lzip -dc build_it8.log.lz | less
We used to have "strip-flags" and "replace-flags -O[3-9] -O2" but we removed them in bug 839405. Does the problem also occur with the live ebuild for Emacs 30?
I can reproduce the lcms one with -O3 -march=znver2, I'll look into it more later. I hit the crypto one too when trying combinations but not sure which it was yet.
I can reproduce the problem with -O3 on an AMD system with -march=znver3. On an Intel system, I see the following pattern: fail: -O3 -march=skylake # native arch fail: -O3 -march=haswell ok: -O3 -march=ivybridge Haswell (as compared to ivybridge) adds the AVX2, BMI, BMI2, LZCNT, FMA, MOVBE, and HLE extensions. It turns out that FMA is the culprit (not surprising, since the test failure involves floating point arithmetic): fail: -O3 -march=ivybridge -mfma ok: -O3 -march=skylake -mno-fma
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc66524b22b55a4f6ab64b21efbe226c7eb4e552 commit cc66524b22b55a4f6ab64b21efbe226c7eb4e552 Author: Ulrich Müller <ulm@gentoo.org> AuthorDate: 2024-06-03 21:06:01 +0000 Commit: Ulrich Müller <ulm@gentoo.org> CommitDate: 2024-06-03 21:53:34 +0000 app-editors/emacs: Use sane compiler flags for FP arithmetic Fixes a test failure with lcms-cam02-ucs. Closes: https://bugs.gentoo.org/933380 Signed-off-by: Ulrich Müller <ulm@gentoo.org> app-editors/emacs/emacs-26.3-r18.ebuild | 3 +++ app-editors/emacs/emacs-27.2-r16.ebuild | 4 ++++ app-editors/emacs/emacs-28.2-r12.ebuild | 4 ++++ app-editors/emacs/emacs-29.3-r2.ebuild | 4 ++++ app-editors/emacs/emacs-29.3.9999.ebuild | 4 ++++ app-editors/emacs/emacs-30.0.9999.ebuild | 4 ++++ 6 files changed, 23 insertions(+)