For unknown reason, I'm unable to emerge dev-lang/erlang-22.1.4. Previous stable verison, dev-lang/erlang-21.1.1, emerges fine. Here's the failing command: erl -pa ../ebin -noshell -noinput \ -run prepare_templates gen_asn1ct_eval asn1ct_eval_ext.funcs {"init terminating in do_boot",{undef,[{asn1ct_func,start_link,[],[]},{prepare_templates,gen_asn1ct_eval,1,[{file,"prepare_templates.erl"},{line,58}]}, {init,start_em,1,[]},{init,do_boot,3,[]}]}} /tmp/portage/dev-lang/erlang-22.1.4/work/otp-OTP-22.1.4/lib/erl_interface/obj.st/x86_64-p init terminating in do_boot ({undef,[{asn1ct_func,start_link,[],[]},{prepare_templates,gen_asn1ct_eval,1,[{_},{_}]},{init,start_em,1,[]},{init,do_boot, 3,[]}]}) ce/obj.st/x86_64-pc-linux-gnu/reg_getf.o /var/tmp/portage/dev-lang/erlang-22.1.4/work/otp -OTP-22.1.4/lib/erl_interface/obj.st/x86_64-pc-linux-gnu/reg_geti.o /var/tmp/portage/dev-lang/erlang-22.1.4/work/otp-OTP-22.1.4/lib/erl_interface/obj.s Crash dump is being written to: erl_crash.dump...done make[2]: *** [Makefile:138: asn1ct_eval_ext.erl] Error 1 make[2]: Leaving directory '/var/tmp/portage/dev-lang/erlang-22.1.4/work/otp-OTP-22.1.4/lib/asn1/src' make[1]: *** [/var/tmp/portage/dev-lang/erlang-22.1.4/work/otp-OTP-22.1.4/make/otp_subdir.mk:29: opt] Error 2 make[1]: Leaving directory '/var/tmp/portage/dev-lang/erlang-22.1.4/work/otp-OTP-22.1.4/lib' st/x86_64-pc-linux-gnu/reg_set.o /var/tmp/portage/dev-lang/erlang-22.1.4/work/otp-OTP-22. make: *** [Makefile:573: secondary_bootstrap_build] Error 2 Reproducible: Always Portage 2.3.79 (python 3.6.9-final-0, default/linux/amd64/17.0, gcc-9.2.0, glibc-2.29-r7, 4.19.85-gentoo x86_64) ================================================================= System Settings ================================================================= System uname: Linux-4.19.85-gentoo-x86_64-Intel-R-_Core-TM-_i3-4010U_CPU_@_1.70GHz-with-gentoo-2.6 KiB Mem: 8056824 total, 987296 free KiB Swap: 16777212 total, 14915660 free Timestamp of repository gentoo: Wed, 15 Jan 2020 14:45:01 +0000 Head commit of repository gentoo: 9905c0ed335faabe0f75fd9d3d7f7e23db89b921 sh bash 4.4_p23-r1 ld GNU ld (Gentoo 2.32 p2) 2.32.0 distcc 3.3.3 x86_64-pc-linux-gnu [enabled] ccache version 3.7.6 [disabled] app-shells/bash: 4.4_p23-r1::gentoo dev-java/java-config: 2.2.0-r4::gentoo dev-lang/perl: 5.30.1::gentoo dev-lang/python: 2.7.17::gentoo, 3.6.9::gentoo, 3.7.5-r1::gentoo dev-util/ccache: 3.7.6::gentoo dev-util/cmake: 3.14.6::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.6-r1::gentoo sys-apps/sandbox: 2.13::gentoo sys-devel/autoconf: 2.13-r1::gentoo, 2.69-r4::gentoo sys-devel/automake: 1.11.6-r3::gentoo, 1.13.4-r2::gentoo, 1.15.1-r2::gentoo, 1.16.1-r1::gentoo sys-devel/binutils: 2.32-r1::gentoo sys-devel/gcc: 9.2.0-r2::gentoo sys-devel/gcc-config: 2.1::gentoo sys-devel/libtool: 2.4.6-r6::gentoo sys-devel/make: 4.2.1-r4::gentoo sys-kernel/linux-headers: 4.20::gentoo (virtual/os-headers) sys-libs/glibc: 2.29-r7::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://mirror.yandex.ru/gentoo-portage priority: -1000 sync-rsync-extra-opts: sync-rsync-verify-max-age: 24 sync-rsync-verify-metamanifest: yes sync-rsync-verify-jobs: 1 LocalOverlay location: /usr/local/portage masters: gentoo crossdev location: /usr/local/portage-crossdev masters: gentoo brother-overlay location: /var/lib/layman/brother-overlay sync-type: laymansync sync-uri: git://github.com/stefan-langenmaier/brother-overlay.git masters: gentoo priority: 50 johu location: /var/lib/layman/johu sync-type: laymansync sync-uri: https://anongit.gentoo.org/git/dev/johu.git masters: gentoo priority: 50 mrueg location: /var/lib/layman/mrueg sync-type: laymansync sync-uri: https://github.com/mrueg/mrueg-overlay.git masters: gentoo priority: 50 pentoo location: /var/lib/layman/pentoo sync-type: laymansync sync-uri: https://github.com/pentoo/pentoo-overlay.git masters: gentoo priority: 50 qt location: /var/lib/layman/qt sync-type: laymansync sync-uri: https://anongit.gentoo.org/git/proj/qt.git masters: gentoo priority: 50 sage-on-gentoo location: /var/lib/layman/sage-on-gentoo sync-type: laymansync sync-uri: git://github.com/cschwan/sage-on-gentoo.git masters: gentoo priority: 50 science location: /var/lib/layman/science sync-type: laymansync sync-uri: https://anongit.gentoo.org/git/proj/sci.git masters: gentoo priority: 50 steam-overlay location: /var/lib/layman/steam-overlay sync-type: laymansync sync-uri: git://github.com/anyc/steam-overlay.git masters: gentoo priority: 50 stuff location: /var/lib/layman/stuff sync-type: laymansync sync-uri: https://github.com/istitov/stuff.git masters: gentoo priority: 50 wjn-overlay location: /var/lib/layman/wjn-overlay sync-type: laymansync sync-uri: https://bitbucket.org/wjn/wjn-overlay.git masters: gentoo priority: 50 ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="@FREE" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=core-avx2 -O2 -pipe -msahf -mmovbe --param=l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=3072 -mtune=core-avx2 -fstack-protector" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.6/conf" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.3/ext-active/ /etc/php/cgi-php7.3/ext-active/ /etc/php/cli-php7.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-march=core-avx2 -O2 -pipe -msahf -mmovbe --param=l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=3072 -mtune=core-avx2 -fstack-protector" DISTDIR="/usr/portage/distfiles" ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distcc distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync metadata-transfer multilib-strict news parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS=" http://mirror.yandex.ru/gentoo-distfiles/" LANG="en_US.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j21 -l4" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" USE="acl amd64 berkdb bindist bzip2 cli crypt cxx dri fortran gdbm glamor iconv ipv6 libtirpc multilib ncurses nls nptl openmp pam pcre pulseaudio readline seccomp split-usr ssl systemd tcpd unicode vaapi xattr zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard synaptics evdev mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="intel i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Created attachment 603402 [details] build.log
Created attachment 603404 [details] ./work/otp-OTP-22.1.4/lib/asn1/src/erl_crash.dump
(In reply to WGH from comment #0) > KiB Mem: 8056824 total, 987296 free You have slightly less than 8GB RAM. > MAKEOPTS="-j21 -l4" 8GB / 21 ~ 350 megabytes per make job. erlc is rather undemanding in terms of CPU/RAM resources, but it would still be useful to check if you can reproduce the problem with either more RAM installed or with fewer make jobs. > System uname: Linux-4.19.85-gentoo-x86_64-Intel-R-_Core-TM-_i3-4010U_CPU_@_1.70GHz-with-gentoo-2.6 According to [0] that CPU has two cores (or four threads). How did you end up with -j21? :-) [0] https://ark.intel.com/content/www/us/en/ark/products/75107/intel-core-i3-4010u-processor-3m-cache-1-70-ghz.html
> According to [0] that CPU has two cores (or four threads). How did you end up with -j21? :-) I'm using distcc. erlc doesn't benefit from it, though. > 8GB / 21 ~ 350 megabytes per make job. erlc is rather undemanding in terms of CPU/RAM resources, but it would still be useful to check if you can reproduce the problem with either more RAM installed or with fewer make jobs. I still have 16G of swap, and I think it would thrash for a while if there was lack of RAM insted of crashing rapidly (not to mention that 16G should be enough not to crash). I rerun it while closely monitoring htop, and there were no memory consumption anomalies (and no OOM killer either). Anyway, just in case, I disabled distcc, set -j4, and run it again. And wow, it didn't crash this time. I tested some other combinations: * -j4 - OK * distcc -j4 - OK * distcc -j4 -l4 - OK * distcc -j21 -l4 - fail * j21 -l4 - fail So it's somehow caused by large job number, but not by distcc. It's still looks odd as 1) the error message is cryptic 2) there're no typical signs of memory shortage.
Does 'dmesg' report any problems?
Reproduced locally with time MAKEOPTS='-j21 -l4' emerge -v1 dev-lang/erlang --quiet-build=n as well.
> Does 'dmesg' report any problems? Nope. Does yours?
Mine doesn't either. I hoped for a simple OOM background process crash. But looks like it's a make dependency problem.
NixOS also saw it: https://github.com/NixOS/nixpkgs/pull/51644
Created attachment 603552 [details, diff] otp-OTP-22.2.2-asn1-dep.patch > erl -pa ../ebin -noshell -noinput \ -run prepare_templates gen_asn1ct_eval asn1ct_eval_ext.funcs > {"init terminating in do_boot",{undef,[{asn1ct_func,start_link,[],[]},{prepare_templates,gen_asn1ct_eval,1,[{file,"prepare_templates.erl"},{line,58}]},{init,start_em,1,[]},{init,do_boot,3,[]}]}} If I read that correctly it just says that bytecode .beam file of prepare_templates.erl attempted to load bytecode file of asn1ct_func.erl module and failed. Can you try to torture attached file to see if it still produces errors? You can drop patch to /etc/portage/patches/dev-lang/erlang/ to get it applied by the ebuild. The patch seems to have helped me but it might need more depends.
Filed pull request upstream as https://github.com/erlang/otp/pull/2508.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=47b988b3b8b66dbaec48a57d17a7769b4b8425bf commit 47b988b3b8b66dbaec48a57d17a7769b4b8425bf Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-01-17 08:04:11 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2020-01-17 08:04:38 +0000 dev-lang/erlang: fix lib/asn1 depend, bug #705500 The build failure is reproducible on a 4-core CPU when using massive parallelism: ``` $ make -j21 -l4 ... GEN asn1ct_eval_ext.erl {"init terminating in do_boot", {undef,[{asn1ct_func,start_link,[],[]}, {prepare_templates,gen_asn1ct_eval,1, [{file,"prepare_templates.erl"},{line,58}]}, {init,start_it,1,[]},{init,start_em,1,[]}]}} init terminating in do_boot () Crash dump is being written to: erl_crash.dump...done make[2]: *** [Makefile:139: asn1ct_eval_ext.erl] Error 1 ``` Here `asn1ct_eval_ext.erl` attempts to load `asn1ct_func.beam` via `prepare_templates.erl` before it's compiled into `.beam` file. The change pulls in a dependency on `asn1ct_func.beam`. Reported-by: WGH Closes: https://bugs.gentoo.org/705500 Package-Manager: Portage-2.3.84, Repoman-2.3.20 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> dev-lang/erlang/erlang-22.1.4.ebuild | 3 ++- dev-lang/erlang/erlang-22.1.8-r1.ebuild | 3 ++- dev-lang/erlang/erlang-22.2.1-r1.ebuild | 3 ++- dev-lang/erlang/erlang-22.2.2.ebuild | 1 + dev-lang/erlang/erlang-22.2.ebuild | 3 ++- dev-lang/erlang/files/erlang-22.1.4-asn1-dep.patch | 15 +++++++++++++++ 6 files changed, 24 insertions(+), 4 deletions(-)
> Can you try to torture attached file to see if it still produces errors? Not sure about torture, but I compiled several times with this patch and never got any errors. Without this patch compilation consistently ends with that error.