cesium-unity icon indicating copy to clipboard operation
cesium-unity copied to clipboard

Unity crashes in Unity 6.0

Open felipeengel-rouvy opened this issue 2 months ago • 2 comments

What happened?

The cesium package doesn't seems to work on Unity 6.0. I've even tested the provided examples and it crashes Unity. Sometimes just after clicking play, and sometimes after navigating a little bit ant then quitting playing.

I'm using latest cesium version v1.18.1 and Unity

Steps to reproduce:

  1. Download Unity samples for v1.18.1
  2. Open the project with latest Unity 6.0 version, for example 6.0.58f2
  3. Open the sample scene 02_CesiumMelbourne.unity
  4. Click Play
  5. Crash

The trace I see when Unity crashes is (attached is the complete crash report): cesium_example_crash_unity6.txt

8   libCesiumForUnityNative-Runtime.dylib	       0x37f2f6348 CesiumRasterOverlays::RasterOverlayTile::~RasterOverlayTile() + 40
9   libCesiumForUnityNative-Runtime.dylib	       0x37f2ca788 CesiumRasterOverlays::TileProviderAndTile::~TileProviderAndTile() + 48
10  libCesiumForUnityNative-Runtime.dylib	       0x37f2cb2ec async::detail::task_func<async::detail::inline_scheduler_impl, async::detail::continuation_exec_func<async::detail::inline_scheduler_impl, async::task<CesiumRasterOverlays::TileProviderAndTile>, CesiumRasterOverlays::TileProviderAndTile, CesiumAsync::CesiumImpl::CatchFunction<CesiumRasterOverlays::ActivatedRasterOverlay::doLoad(CesiumRasterOverlays::RasterOverlayTile&, bool)::$_2, CesiumRasterOverlays::TileProviderAndTile, CesiumAsync::CesiumImpl::ImmediateScheduler<CesiumAsync::CesiumImpl::QueuedScheduler>, async::task<CesiumRasterOverlays::TileProviderAndTile>&&>, std::__1::integral_constant<bool, false>, true>, CesiumRasterOverlays::TileProviderAndTile>::destroy(async::detail::task_base*) + 76
11  libCesiumForUnityNative-Runtime.dylib	       0x37ecb86e4 void async::detail::continuation_vector::flush_and_lock<async::detail::task_base::run_continuations()::'lambda'(async::detail::ref_count_ptr<async::detail::task_base>)>(async::detail::task_base::run_continuations()::'lambda'(async::detail::ref_count_ptr<async::detail::task_base>)&&) + 140
12  libCesiumForUnityNative-Runtime.dylib	       0x37f2cb0e0 async::detail::task_func<CesiumAsync::CesiumImpl::ImmediateScheduler<CesiumAsync::CesiumImpl::QueuedScheduler>, async::detail::continuation_exec_func<CesiumAsync::CesiumImpl::ImmediateScheduler<CesiumAsync::CesiumImpl::QueuedScheduler>, async::task<CesiumRasterOverlays::(anonymous namespace)::LoadResult>, CesiumRasterOverlays::TileProviderAndTile, CesiumRasterOverlays::ActivatedRasterOverlay::doLoad(CesiumRasterOverlays::RasterOverlayTile&, bool)::$_1, std::__1::integral_constant<bool, true>, false>, CesiumRasterOverlays::TileProviderAndTile>::run(async::detail::task_base*) + 588
13  libCesiumForUnityNative-Runtime.dylib	       0x37f1d9f38 CesiumAsync::CesiumImpl::QueuedScheduler::dispatchInternal(bool) + 196
14  libCesiumForUnityNative-Runtime.dylib	       0x37f1d9e5c CesiumAsync::CesiumImpl::QueuedScheduler::dispatchQueuedContinuations() + 28
15  libCesiumForUnityNative-Runtime.dylib	       0x37f1a1350 Cesium3DTilesSelection::Tileset::updateViewGroup(Cesium3DTilesSelection::TilesetViewGroup&, std::__1::vector<Cesium3DTilesSelection::ViewState, std::__1::allocator<Cesium3DTilesSelection::ViewState>> const&, float) + 228
16  libCesiumForUnityNative-Runtime.dylib	       0x37ed3e15c CesiumForUnityNative::Cesium3DTilesetImpl::Update(DotNet::CesiumForUnity::Cesium3DTileset const&) + 204

Environment

Cesium for Unity version: 1.18.1 Unity Editor Version: 6000.0.58f2 Operating System: macOS 26.0.1

Reproduction steps

  1. Download Unity samples for v1.18.1
  2. Open the project with latest Unity 6.0 version, for example 6.0.58f2
  3. Open the sample scene 02_CesiumMelbourne.unity
  4. Click Play
  5. Crash ...

Supporting evidence

cesium_example_crash_unity6.txt

felipeengel-rouvy avatar Oct 27 '25 09:10 felipeengel-rouvy

@felipeengel-rouvy At the moment, I am unable to reproduce this under Unity 6000.0.58f2 or any other 6.* version of Unity, with the Cesium 1.18.1 package.

Image

Based on your stack trace, I suspect this is related to a bug that was recently discovered and fixed in main. I suggest grabbing the latest package from CI to see if it fixes the crash on your end.

david-lively avatar Oct 28 '25 20:10 david-lively

Hi @david-lively With version 1.19.0 it doesn't crash that much, but every now and then after play it crashes the editor. We found out that this happen mostly on mac osx.

felipeengel-rouvy avatar Nov 12 '25 11:11 felipeengel-rouvy