Crash in Gitlab CI when making a Server Build on Linux 64 with Unity 2022.2.3f1

Hi,

We have a gitlab CI setup for our project and everytime we try to build, we get the following callstack at the end of the log:

mono_class_from_mono_type_internal: implement me 0x00
4121* Assertion: should not be reached at class.c:2214
4122Caught fatal signal - signo:6 code:-6 errno:0 addr:0x72
4123Obtained 42 stack frames.
4124#0 0x007f3b5cc35980 in funlockfile
4125#1 0x007f3b5c870e87 in gsignal
4126#2 0x007f3b5c8727f1 in abort
4127#3 0x007f3a2ba8f7ed in monoeg_assert_abort
4128#4 0x007f3a2ba78d2e in mono_dl_fallback_unregister
4129#5 0x007f3a2ba8fb05 in monoeg_g_logv
4130#6 0x007f3a2ba8fc3e in monoeg_assertion_message
4131#7 0x007f3a2ba8fc84 in mono_assertion_message_unreachable
4132#8 0x007f3a2b9a8e41 in mono_class_from_mono_type_internal
4133#9 0x007f3a2ba3d8c5 in mono_type_get_object
4134#10 0x007f3a2ba3d873 in mono_type_get_object
4135#11 0x0055c6046b92b6 in scripting_class_get_object(ScriptingClassPtr)
4136#12 0x0055c605be1c41 in AssetDatabase::CollectManagedImportDependencyGetters(AssetDatabase::AssetImporterSelection&, ArtifactKey const&)
4137#13 0x0055c605c877b7 in AssetImportManager::Import(core::hash_map<AssetDatabase::ImporterID, ImporterInfo, core::hashAssetDatabase::ImporterID, std::equal_toAssetDatabase::ImporterID > const&, dynamic_array<PostprocessorInfo, 0ul> const&, AssetResolver&, CategorizedAssets&, IImportProgress*, core::hash_set<UnityGUID, core::hash, std::equal_to > const&, ImportedAssetsReloadList*, core::hash_set<core::basic_string<char, core::StringStorageDefault >, core::hash<core::basic_string<char, core::StringStorageDefault > >, std::equal_to<core::basic_string<char, core::StringStorageDefault > > >&, CrashedAssetImportsDatabase&, OnDemandScheduler&, bool)
4138#14 0x0055c605cafd14 in RefreshInternalV2(AssetDatabase::UpdateAssetOptions, ScanFilter const&, InternalRefreshFlagsV2)
4139#15 0x0055c605c8b1d5 in StopAssetImportingV2Internal(AssetDatabase::UpdateAssetOptions, InternalRefreshFlagsV2, ScanFilter const*, char const*)
4140#16 0x0055c605c8d6de in RefreshV2(AssetDatabase::UpdateAssetOptions)
4141#17 0x0055c605c96407 in VerifyAssetsForBuildTargetV2(AssetDatabase::CancelBehaviour, bool, bool)
4142#18 0x0055c605c01ca7 in AssetDatabase::VerifyAssetsForBuildTarget(AssetDatabase::CancelBehaviour, AssetDatabase::SkipProcessingBehaviour, bool, bool)
4143#19 0x0055c606465d0c in ApplyBuildTargetSwitchInternal(BuildTargetPlatformGroup, BuildTargetPlatform, int)
4144#20 0x0055c606465e89 in SwitchActiveBuildTargetForBundles(BuildTargetPlatformGroup, BuildTargetPlatform, int)
4145#21 0x0055c606476a1c in DoBuildPlayer_Build(BuildPlayerSetup const&, dynamic_array<EditorSceneBackup, 0ul>&, BuildPlayerOptions, BuildTargetPlatformGroup, BuildTargetPlatform, dynamic_array<core::basic_string<char, core::StringStorageDefault >, 0ul> const&, bool, ScriptingObjectPtr&, BuildReporting::BuildReport&, BuildReporting::BuiltAssetBundleInfo*, core::basic_string<char, core::StringStorageDefault > const&)
4146#22 0x0055c606475238 in DoBuildPlayer(BuildPlayerSetup const&, dynamic_array<EditorSceneBackup, 0ul>&, core::basic_string<char, core::StringStorageDefault >, dynamic_array<core::basic_string<char, core::StringStorageDefault >, 0ul> const&, bool, BuildReporting::BuildReport&, BuildReporting::BuiltAssetBundleInfo*, core::basic_string<char, core::StringStorageDefault > const&)
4147#23 0x0055c60647bd1b in BuildPlayer(BuildPlayerSetup const&, BuildReporting::BuildReport&)
4148#24 0x0055c603d1754c in BuildPipeline_CUSTOM_BuildPlayerInternalNoCheck(ScriptingBackendNativeArrayPtrOpaque*, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeStringPtrOpaque*, BuildTargetPlatformGroup, BuildTargetPlatform, int, BuildPlayerOptions, ScriptingBackendNativeArrayPtrOpaque*, unsigned char)
4149#25 0x0000004149f09b in (wrapper managed-to-native) UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck (string[ ],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,int,UnityEditor.BuildOptions,string[ ],bool)
4150#26 0x0000004149e828 in UnityEditor.BuildPipeline:BuildPlayerInternal (string[ ],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,int,UnityEditor.BuildOptions,string[ ])
4151#27 0x0000004149e1d0 in UnityEditor.BuildPipeline:BuildPlayer (string[ ],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,int,UnityEditor.BuildOptions,string[ ])
4152#28 0x0000004149df68 in UnityEditor.BuildPipeline:BuildPlayer (UnityEditor.BuildPlayerOptions)
4153#29 0x0000004149df0c in UnityEditor.BuildPipeline:BuildPlayer (string[ ],string,UnityEditor.BuildTarget,UnityEditor.BuildOptions)
4154#30 0x0000004126cdfc in Aurory.BuildUtilities.Editor.BuildCommand:performBuild ()
4155#31 0x007f3a2b8742d8 in mono_get_runtime_build_info
4156#32 0x007f3a2ba13c0a in mono_runtime_invoke
4157#33 0x007f3a2ba13b54 in mono_runtime_invoke
4158#34 0x0055c6046b9213 in scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool)
4159#35 0x0055c604698f37 in ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool)
4160#36 0x0055c605351ab6 in Application::parseARGVCommands()
4161#37 0x0055c6053507f4 in Application::FinishLoadingProject()
4162#38 0x0055c6058ea45a in InitializeUnity(void*)
4163#39 0x0055c6058e9ac9 in main
4164#40 0x007f3b5c853c87 in __libc_start_main
4165#41 0x0055c6039cf029 in _start
4166Aborted (core dumped)
4167Uploading artifacts for failed job00:02
4168Uploading artifacts…
4169Adventure/Library/com.unity.addressables/AddressablesBuildTEP.json: found 1 matching artifact files and directories
4170WARNING: Adventure/Library/com.unity.addressables/buildlayout.txt: no matching files. Ensure that the artifact path is relative to the working directory (/builds/aurory/unity/projects/adventure)
4171WARNING: Adventure/Library/LastBuild.buildreport: no matching files. Ensure that the artifact path is relative to the working directory (/builds/aurory/unity/projects/adventure)
4172Uploading artifacts as “archive” to coordinator… 201 Created id=3668299557 responseStatus=201 Created token=64_XyuQn
4174Cleaning up project directory and file based variables00:01
4176ERROR: Job failed: exit code 1

I am definitely not a build pipeline expert so apologies for pasting the log like this.
I really have to find a solution for this.
The rest of the log seems fine, we have no script compilation error or anything.
Also we have almost no Art asset in the project.

Does anyone know what could be happening or have any clue to where we should be looking at?

I have same crash with CI.

Does not find any info about it yet :frowning: Will try to get log from mono.

Im trying to make Android build with this config

static void BuildAndroidDev() {

PlayerSettings.SetScriptingBackend(BuildTargetGroup.Android, ScriptingImplementation.IL2CPP);
PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Android, "DEV");
PlayerSettings.Android.targetArchitectures = AndroidArchitecture.ARM64 | AndroidArchitecture.ARMv7;

EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.Android, BuildTarget.Android);

EditorUserBuildSettings.development = true;

BuildReport report = BuildPipeline.BuildPlayer(GetScenes(), Android_FOLDER + GAME_NAME + ".apk",
BuildTarget.Android, BuildOptions.Development);
int code = (report.summary.result == BuildResult.Succeeded) ? 0 : 1;
EditorApplication.Exit(code);
}

And this console command

/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity -quit -batchmode -projectPath . -executeMethod HiddenCastle.BuildActions.$BUILD_TYPE -nographics -stackTraceLogType ScriptOnly

Im building on Mac with Last version of Jenkins.

Btw on the same machine I can build apk file with the same settings if I trying to make it from unity UI and not from console

We use Gitlab CI with a custom setup too. In our case all problems related to funlockfile in the stack trace are gone after changing Git strategy to clone instead of fetch. Unfortunately the pipeline drastically slowed down, because all the sources are cloning to the empty local repository, but I don’t know any other way to solve this.