# MPCook appError called: Assertion failed: InWorld != ReferencedWorld 

**URL:** <https://forums.unrealengine.com/t/mpcook-apperror-called-assertion-failed-inworld-referencedworld/2845591>\
**Category:** Pipeline & Plugins\
**Tags:** unreal-engine, Epic-Pro-Support, question\
**Created:** [September 23, 2026, 5:58am UTC](https://forums.unrealengine.com/t/mpcook-apperror-called-assertion-failed-inworld-referencedworld/2845591 "2026-09-23T05:58:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [September 23, 2026, 5:58am UTC](https://forums.unrealengine.com/t/mpcook-apperror-called-assertion-failed-inworld-referencedworld/2845591/1 "2026-09-23T05:58:46Z")

</div>

```auto
[Cook][UE][Log] LogInit: Display: -----------------------------------
 [Cook][UE][Log] LogInit: Display: LogWindows: Error: [CookWorker 1]: appError called: Assertion failed: InWorld != ReferencedWorld [File:D:\xx\Engine\Engine\Source\Runtime\Engine\Private\WorldPartition\WorldPartitionCookPackageSplitter.cpp] [Line: 58]
[Cook][UE][Log] LogWindows: Error: [CookWorker 1]: appError called: Assertion failed: InWorld != ReferencedWorld [File:D:\spAosWeekly_Game\Engine\Engine\Source\Runtime\Engine\Private\WorldPartition\WorldPartitionCookPackageSplitter.cpp] [Line: 58]
[Cook][UE][Log] LogCook: Display: [CookWorker 1]: [Cook] World xx is being cleaned up while still referenced by a package splitter.

Cook一个WC地图，这个地图里面有个世界分区地图的关卡实例，然后Cook关卡实例过程中，触发了这个崩溃，是偶现的，后续发现可以正常Cook结束，想问问既然有这个断言是否有相关排查手段

```

---

<div class="post-metadata">

**Author:** ![tuo.chen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tuo.chen](https://forums.unrealengine.com/u/tuo.chen)\
**Post date:** [September 28, 2026, 3:30am UTC](https://forums.unrealengine.com/t/mpcook-apperror-called-assertion-failed-inworld-referencedworld/2845591/2 "2026-09-28T03:30:35Z")

</div>

您好，内部jira上有类似的问题，但是还处于未解决的状态。

排查的话，可以先加上命令-LogCmds=“LogWorld Verbose, LogCookGenerationHelper Verbose, LogLevelInstance Verbose, LogWorldPartition Verbose” 获取更多log

然后添加一些额外信息

```auto
void FWorldCookPackageSplitter::OnWorldCleanup(UWorld* InWorld, bool bSessionEnded, bool bCleanupResources)
{
      if (InWorld == ReferencedWorld)
      {
              // Debug: identify who is cleaning up the world referenced by the splitter
              UWorld* OwningWorld = (InWorld && InWorld->PersistentLevel) ? InWorld->PersistentLevel->OwningWorld.Get(
              UE_LOGF(LogWorldPartition, Error, "[Cook][Debug] Splitter world %ls cleaned up. OwningWorld=%ls bSessionbCleanupResources=%d IsInitialized=%d",
                      *GetFullNameSafe(InWorld), *GetFullNameSafe(OwningWorld), bSessionEnded, bCleanupResources, InWorld->IsInitialized());
              FDebug::DumpStackTraceToLog(ELogVerbosity::Error);
      }
      ensureAlwaysMsgf(InWorld != ReferencedWorld, TEXT("[Cook] %s is being cleaned up while still referenced by a pacsplitter."), *GetFullNameSafe(InWorld));
}

```

再在 ReportGenerationManifest 和 Teardown 里各加一行日志，打印 ReferencedWorld 的名字和时间点。这样日志里就能拼出完整的"splitter 持有期间，被谁清理"的时间线。

如果能做一个复现工程发给我们那就最好了

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [September 28, 2026, 4:28am UTC](https://forums.unrealengine.com/t/mpcook-apperror-called-assertion-failed-inworld-referencedworld/2845591/3 "2026-09-28T04:28:25Z")

</div>

这个不是稳定复现的，我先看看加上日志方便排查
