turanszkij / WickedEngine

3D engine with modern graphics
https://wickedengine.net
Other
5.85k stars 619 forks source link

"terminate called after throwing an instance of `std::bad_alloc`" #944

Closed metaleap closed 2 months ago

metaleap commented 2 months ago

On an Arch Linux with KDE on X11, running latest Wicked Editor release v0.71.563, when I attempt to Open from the master repo dir Content/terrain/grass.wiscene, it crashes: here's the full terminal print of that run.

config.ini loaded in 0.059575 milliseconds

Created GraphicsDevice_Vulkan (21 ms)
Adapter: AMD Radeon Graphics (RADV RENOIR)

[wi::initializer] Initializing Wicked Engine, please wait...
Version: 0.71.563

Embedded shaders found: 397

wi::jobsystem Initialized with 16 cores in 1.29 ms
        High priority threads: 15
        Low priority threads: 14
        Streaming threads: 1

wi::physics Initialized [Jolt Physics 5.1.0] (0 ms)
wi::input Initialized (0 ms)
wi::font Initialized (0 ms)
wi::TrailRenderer Initialized (1 ms)
wi::gpusortlib Initialized (1 ms)
wi::lua Initialized (1 ms)
wi::image Initialized (1 ms)
wi::GPUBVH Initialized (20 ms)
wi::texturehelper Initialized (41 ms)
wi::Ocean Initialized (45 ms)
wi::audio Initialized [FAudio] (63 ms)
wi::HairParticleSystem Initialized (121 ms)
wi::renderer Initialized (236 ms)
wi::EmittedParticleSystem Initialized (251 ms)

[wi::initializer] Wicked Engine Initialized (252 ms)
Created envprobe depth buffer for request
        Resolution = 64 * 64 * 6
        Sample Count = 1
        Mip Levels = 1
        Format = D16_UNORM
        Memory = 48.0 KB

Created envprobe render target for request
        Resolution = 64 * 64 * 6
        Sample Count = 1
        Mip Levels = 3
        Format = R11G11B10_FLOAT
        Memory = 126.0 KB

Created envprobe filtering target for request
        Resolution = 64 * 64 * 6
        Sample Count = 1
        Mip Levels = 3
        Format = R11G11B10_FLOAT
        Memory = 126.0 KB

BlockCompress created a new raw block texture to fit request: BC6H_UF16 (64, 64)
        Format = R32G32B32A32_UINT
        Resolution = 64 * 64
        Array Size = 6
        Memory = 384.0 KB

wi::gui Initialized (0 ms)
[Resource check] Started checking resource manager for changes...
[Resource check] All up to date
[Editor] started loading model: /home/_/g/WickedEngine/Content/terrain/grass.wiscene
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted (core dumped)

Version incompat of master content vs. release binary perhaps? (All the other .wiscenes load up fine though.) Even if so, guess it's a bug to crash instead of catch+report =)

turanszkij commented 2 months ago

You can't use the latest release with content from a later version. In the latest release this file did not exist: Content/terrain/grass.wiscene That's why I think you are trying to open a newer asset with an earlier exe. Though it would pop a message box for this on Windows, but maybe not on Linux, I don't know. Does it happen with the latest github version (non-release)? Version 0.71.570 is the latest today.

metaleap commented 2 months ago

Will switch to latest master later today and report back!

metaleap commented 2 months ago

So no more crash when the editor build is the same git version as the Content/terrain repo dir.

But opening the Content/terrain/grass.wiscene, while not crashing, won't show anything in the viewport either (only the blank background color), not sure if that's to be expected?

If so, feel free to close this ticket =)

turanszkij commented 2 months ago

This is normal, that model configures the parameters of grass, but it will be only visible when a mesh is specified for it to grow from. It is used by the terrain to set up its grass.