Bug 1988911

Summary: Compiling opam-publish-2.1.0 gives # lto1: internal compiler error: Segmentation fault
Product: [Fedora] Fedora Reporter: Anton Kochkov <anton.kochkov>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 34CC: aoliva, dmalcolm, fweimer, jakub, jwakely, law, mpolacek, msebor, nickc, sipoyare
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-10 09:34:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Anton Kochkov 2021-08-02 05:23:53 UTC
Was updating local opam switch:

[i] ℤ ocamlc --version                                                                                                                                                                                                            13:13:43 
4.11.1
~/data/ocaml 
[i] ℤ opam --version                                                                                                                                                                                                              13:16:44 
2.0.8

Got the following error during the opam-publish-2.1.0 compilation:

[i] ℤ opam install --restore                                                                                                                                                                                                      13:12:40 
Packages to be restored: { opam-publish }
The following actions will be performed:
  ∗ install opam-publish 2.1.0

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[opam-publish.2.1.0] found in cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of opam-publish failed at "/home/akochkov/.opam/opam-init/hooks/sandbox.sh build dune build -p opam-publish -j 7".

#=== ERROR while compiling opam-publish.2.1.0 =================================#
# context     2.0.8 | linux/x86_64 | ocaml-system.4.11.1 | https://opam.ocaml.org#bfc07c20
# path        ~/.opam/default/.opam-switch/build/opam-publish.2.1.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p opam-publish -j 7
# exit-code   1
# env-file    ~/.opam/log/opam-publish-162949-e7966f.env
# output-file ~/.opam/log/opam-publish-162949-e7966f.out
### output ###
# [...]
# PLUGIN_ALL_PASSES_START          | annobin: Generate per-function annotations
# PLUGIN_ALL_PASSES_END            | annobin: Register per-function end symbols
# lto1: internal compiler error: Segmentation fault
# Please submit a full bug report,
# with preprocessed source if appropriate.
# See <http://bugzilla.redhat.com/bugzilla> for instructions.
# lto-wrapper: fatal error: gcc returned 1 exit status
# compilation terminated.
# /usr/bin/ld: error: lto-wrapper failed
# collect2: error: ld returned 1 exit status
# File "caml_startup", line 1:
# Error: Error during linking (exit code 1)

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build opam-publish 2.1.0
└─ 
╶─ No changes have been performed
~/data/ocaml took 3s 

The Linux distribution is Fedora 34 x86_64

[i] ℤ gcc --version                                                                                                                                                                                                               13:12:58 
gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

~/data/ocaml 
[i] ℤ ld --version                                                                                                                                                                                                                13:13:15 
GNU ld version 2.35.1-41.fc34
Copyright (C) 2020 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
~/data/ocaml 


[i] ℤ cat ~/.opam/log/opam-publish-162949-e7966f.out                                                                                                                                                                              13:18:48 
    ocamlopt src/publishMain.exe (exit 2)
(cd _build/default && /usr/bin/ocamlopt.opt -w -40 -g -o src/publishMain.exe /home/akochkov/.opam/default/lib/result/result.cmxa /home/akochkov/.opam/default/lib/lwt/lwt.cmxa /home/akochkov/.opam/default/lib/re/re.cmxa /home/akochkov/.opam/default/lib/stdlib-shims/stdlib_shims.cmxa /home/akochkov/.opam/default/lib/ocamlgraph/graph.cmxa /usr/lib64/ocaml/unix.cmxa -I /usr/lib64/ocaml /usr/lib64/ocaml/bigarray.cmxa -I /usr/lib64/ocaml /home/akochkov/.opam/default/lib/opam-core/opam_core.cmxa /home/akochkov/.opam/default/lib/opam-file-format/opam_file_format.cmxa /home/akochkov/.opam/default/lib/opam-format/opam_format.cmxa /home/akochkov/.opam/default/lib/opam-repository/opam_repository.cmxa /home/akochkov/.opam/default/lib/opam-state/opam_state.cmxa /home/akochkov/.opam/default/lib/stringext/stringext.cmxa /home/akochkov/.opam/default/lib/bigarray-compat/bigarray_compat.cmxa /home/akochkov/.opam/default/lib/bigstringaf/bigstringaf.cmxa -I /home/akochkov/.opam/default/lib/bigstringaf /home/akochkov/.opam/default/lib/angstrom/angstrom.cmxa /home/akochkov/.opam/default/lib/uri/uri.cmxa /home/akochkov/.opam/default/lib/sexplib0/sexplib0.cmxa /home/akochkov/.opam/default/lib/ppx_sexp_conv/runtime-lib/ppx_sexp_conv_lib.cmxa /home/akochkov/.opam/default/lib/uri-sexp/uri_sexp.cmxa /home/akochkov/.opam/default/lib/base64/base64.cmxa /home/akochkov/.opam/default/lib/cohttp/cohttp.cmxa /home/akochkov/.opam/default/lib/mmap/mmap.cmxa /home/akochkov/.opam/default/lib/ocplib-endian/ocplib_endian.cmxa /home/akochkov/.opam/default/lib/ocplib-endian/bigstring/ocplib_endian_bigstring.cmxa /usr/lib64/ocaml/threads/threads.cmxa -I /usr/lib64/ocaml /home/akochkov/.opam/default/lib/lwt/unix/lwt_unix.cmxa -I /home/akochkov/.opam/default/lib/lwt/unix /home/akochkov/.opam/default/lib/fmt/fmt.cmxa /home/akochkov/.opam/default/lib/logs/logs.cmxa /home/akochkov/.opam/default/lib/logs/logs_lwt.cmxa /home/akochkov/.opam/default/lib/base/caml/caml.cmxa /home/akochkov/.opam/default/lib/parsexp/parsexp.cmxa /home/akochkov/.opam/default/lib/sexplib/sexplib.cmxa /home/akochkov/.opam/default/lib/macaddr/macaddr.cmxa /home/akochkov/.opam/default/lib/astring/astring.cmxa /home/akochkov/.opam/default/lib/domain-name/domain_name.cmxa /home/akochkov/.opam/default/lib/ipaddr/ipaddr.cmxa /home/akochkov/.opam/default/lib/ipaddr-sexp/ipaddr_sexp.cmxa /home/akochkov/.opam/default/lib/conduit/conduit.cmxa /home/akochkov/.opam/default/lib/conduit-lwt/conduit_lwt.cmxa /home/akochkov/.opam/default/lib/magic-mime/magic_mime_library.cmxa /home/akochkov/.opam/default/lib/uri/services/uri_services.cmxa /home/akochkov/.opam/default/lib/ipaddr/unix/ipaddr_unix.cmxa /home/akochkov/.opam/default/lib/ssl/ssl.cmxa -I /home/akochkov/.opam/default/lib/ssl /home/akochkov/.opam/default/lib/lwt_ssl/lwt_ssl.cmxa /home/akochkov/.opam/default/lib/cstruct/cstruct.cmxa -I /home/akochkov/.opam/default/lib/cstruct /home/akochkov/.opam/default/lib/cstruct-sexp/cstruct_sexp.cmxa /home/akochkov/.opam/default/lib/eqaf/eqaf.cmxa /home/akochkov/.opam/default/lib/eqaf/bigstring/eqaf_bigstring.cmxa /home/akochkov/.opam/default/lib/eqaf/cstruct/eqaf_cstruct.cmxa /home/akochkov/.opam/default/lib/mirage-crypto/mirage_crypto.cmxa -I /home/akochkov/.opam/default/lib/mirage-crypto /home/akochkov/.opam/default/lib/hkdf/hkdf.cmxa /home/akochkov/.opam/default/lib/mirage-crypto-rng/mirage_crypto_rng.cmxa /home/akochkov/.opam/default/lib/zarith/zarith.cmxa -I /home/akochkov/.opam/default/lib/zarith /home/akochkov/.opam/default/lib/rresult/rresult.cmxa /home/akochkov/.opam/default/lib/mirage-crypto-pk/mirage_crypto_pk.cmxa /home/akochkov/.opam/default/lib/ptime/ptime.cmxa /home/akochkov/.opam/default/lib/asn1-combinators/asn1_combinators.cmxa /home/akochkov/.opam/default/lib/gmap/gmap.cmxa /home/akochkov/.opam/default/lib/mirage-crypto-ec/mirage_crypto_ec.cmxa -I /home/akochkov/.opam/default/lib/mirage-crypto-ec /home/akochkov/.opam/default/lib/pbkdf/pbkdf.cmxa /home/akochkov/.opam/default/lib/x509/x509.cmxa /home/akochkov/.opam/default/lib/tls/tls.cmxa /home/akochkov/.opam/default/lib/ptime/os/ptime_clock.cmxa -I /home/akochkov/.opam/default/lib/ptime/os /home/akochkov/.opam/default/lib/mirage-crypto-rng/unix/mirage_crypto_rng_unix.cmxa -I /home/akochkov/.opam/default/lib/mirage-crypto-rng/unix /home/akochkov/.opam/default/lib/duration/duration.cmxa /home/akochkov/.opam/default/lib/mtime/mtime.cmxa /home/akochkov/.opam/default/lib/mtime/os/mtime_clock.cmxa -I /home/akochkov/.opam/default/lib/mtime/os /home/akochkov/.opam/default/lib/mirage-crypto-rng/lwt/mirage_crypto_rng_lwt.cmxa /home/akochkov/.opam/default/lib/tls/lwt/tls_lwt.cmxa /home/akochkov/.opam/default/lib/fpath/fpath.cmxa /home/akochkov/.opam/default/lib/bos/bos.cmxa /home/akochkov/.opam/default/lib/ca-certs/ca_certs.cmxa -I /home/akochkov/.opam/default/lib/ca-certs /home/akochkov/.opam/default/lib/conduit-lwt-unix/conduit_lwt_unix.cmxa /home/akochkov/.opam/default/lib/cohttp-lwt/cohttp_lwt.cmxa /home/akochkov/.opam/default/lib/logs/logs_fmt.cmxa /home/akochkov/.opam/default/lib/cohttp-lwt-unix/cohttp_lwt_unix.cmxa /home/akochkov/.opam/default/lib/easy-format/easy_format.cmxa /home/akochkov/.opam/default/lib/biniou/biniou.cmxa /home/akochkov/.opam/default/lib/yojson/yojson.cmxa /home/akochkov/.opam/default/lib/atdgen-runtime/atdgen_runtime.cmxa /home/akochkov/.opam/default/lib/atdgen/atdgen.cmxa /home/akochkov/.opam/default/lib/github-data/github_data.cmxa /home/akochkov/.opam/default/lib/github/github.cmxa /home/akochkov/.opam/default/lib/github-unix/github_unix.cmxa /home/akochkov/.opam/default/lib/cmdliner/cmdliner.cmxa src/.publishMain.eobjs/native/publishCommon.cmx src/.publishMain.eobjs/native/publishSubmit.cmx src/.publishMain.eobjs/native/version.cmx src/.publishMain.eobjs/native/publishMain.cmx)
*** WARNING *** there are active plugins, do not report this as a bug unless you can reproduce it without enabling any plugins.
Event                            | Plugins
PLUGIN_FINISH_UNIT               | annobin: Generate final annotations
PLUGIN_START_UNIT                | annobin: Generate global annotations
PLUGIN_ALL_PASSES_START          | annobin: Generate per-function annotations
PLUGIN_ALL_PASSES_END            | annobin: Register per-function end symbols
lto1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
lto-wrapper: fatal error: gcc returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking (exit code 1)

Comment 1 Anton Kochkov 2021-09-01 08:09:09 UTC
The bug was transferred to the main OCaml compiler repository: https://github.com/ocaml/ocaml/issues/10553

Comment 2 Anton Kochkov 2021-11-10 09:34:14 UTC
I cannot reproduce this bug anymore. Might have been some library mismatch or something. I retried on multiple computers after the update to Fedora 35 and the problem is gone.