Bug 254983

Summary: emulators/virtualbox-ose: jemalloc error
Product: Ports & Packages Reporter: Fernando Apesteguía <fernape>
Component: Individual Port(s)Assignee: Virtualbox Team (Nobody) <vbox>
Status: New ---    
Severity: Affects Only Me CC: madpilot
Priority: --- Flags: bugzilla: maintainer-feedback? (vbox)
Version: Latest   
Hardware: Any   
OS: Any   

Description Fernando Apesteguía freebsd_committer 2021-04-11 17:16:04 UTC
I have a virtual machine running current. It has been updated for
several months now without problems.

Yesterday I updated to VB 6.1 and it seems it can not build anymore.
The errore I get is this:

--- Frontend/CompilerInstance.o ---
<jemalloc>: jemalloc_arena.c:747: Failed assertion:
"nstime_compare(&decay->epoch, &time) <= 0"
PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and
include the crash backtrace, preprocessed source, and associated run
Stack dump:
0.      Program arguments: c++ -target x86_64-unknown-freebsd14.0
-B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -O2 -pipe -fno-common
-I/usr/src/contrib/llvm-project/clang/include -DCLANG_ENABLE_ARCMT
-DCLANG_ENABLE_STATIC_ANALYZER -I/usr/src/lib/clang/include
-I/usr/src/contrib/llvm-project/llvm/include -D__STDC_CONSTANT_MACROS
-DLLVM_HOST_TRIPLE="x86_64-unknown-freebsd14.0" -DDEFAULT_SYSROOT=""
-DLLVM_NATIVE_TARGETMC=LLVMInitializeX86TargetMC -ffunction-sections
-fdata-sections -gline-tables-only -MD
-MF.depend.Frontend_CompilerInstance.o -MTFrontend/CompilerInstance.o
-Wno-format-zero-length -fstack-protector-strong -Wno-empty-body
-Wno-string-plus-int -Wno-unused-const-variable
-Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality
-Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef
-Wno-address-of-packed-member -Wno-switch -Wno-switch-enum
-Wno-knr-promoted-parameter -Wno-parentheses -Qunused-arguments
-fno-exceptions -fno-rtti -gline-tables-only -std=c++14 -stdlib=libc++
-Wno-c++11-extensions -c
-o Frontend/CompilerInstance.o
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'CallGraph Pass Manager' on module
4.      Releasing pass 'Memory SSA'
<jemalloc>: Should own 0 locks of rank >= 1: decay(12)
Abort trap (core dumped)
*** [Frontend/CompilerInstance.o] Error code 134

make[6]: stopped in /usr/src/lib/clang/libclang
1 error

After this, when I poweroff the machine, all six bufdaemons timeout after 60 seconds. I monitor de free memory and it does not go below 13 GB (it has 22 GB assigned). This is completely reproducible.
Comment 1 Guido Falsi freebsd_committer 2021-04-11 18:21:40 UTC
I don't have any syggestion or solution, but I have a few questions to try to make things clearer.

Is this the error happening inside the jail, while trying to build world?

Can you report the exact revision (git commit) you are running on the host and guest inside the jail? Also the revision you are trying to compile inside the jail.

This could be virtualbox but could also be a base problem.
Comment 2 Fernando Apesteguía freebsd_committer 2021-04-11 20:28:18 UTC
(In reply to Guido Falsi from comment #1)

Ummm what jail?

My setup is:

Host: FreeBSD beastie 12.2-RELEASE-p6
VirtualBox 6.1 running main-n244663-f6e8256a965d: Sun Feb  7.

I'm trying to update that main-n244663-f6e8256a965d to latest commit. Between yesterday and today a few commits where picked up but none of them fix the issue.

Additionally, I also have a poudriere jail in that virtualized machine. That poudriere jail is in 13-current 14.0-CURRENT 1400003 e44a78ce6. That one also fails to update with the same jemalloc error.

This virtual box VM has the following settings:

* Enable I/O APIC
* 4 cpus execution cap 100%
* 22 GB RAM
* 128 GB disc
* Enabled Nested VT-x/AMD-V
* Enabled nested paging

I tried a make clean in /usr/src but the same error occurs when I try to make world.

Today I updated a laptop running current without any issues (not virtualized)

Comment 3 Fernando Apesteguía freebsd_committer 2021-04-11 20:29:19 UTC
One more thing:

The machine was completely shut down between the VirtualBox upgrade to 6.1. It was not running or suspended or in taken back from a snapshot.
Comment 4 Fernando Apesteguía freebsd_committer 2021-04-12 10:56:50 UTC
I just installed -legacy ports and was able to update the vm to FreeBSD vm-current 14.0-CURRENT FreeBSD 14.0-CURRENT #11 main-n245984-15221c552b3c