[Donion] [2.0.72] crash in playSoundWithDistanceLimits with modded sound trigger

Bugs which we just recently fixed in our development version and will reach you in the next release.
OhSnap
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat Sep 06, 2025 6:47 pm
Contact:

[Donion] [2.0.72] crash in playSoundWithDistanceLimits with modded sound trigger

Post by OhSnap »

1. What did you do?
- Create an entity with a dying_trigger_effect of create-entity and play-sound
- Copy of nuclear bomb effects but slightly modified

2. What happened?
- Game crashed when effect is triggered, according to log in playSoundWithDistanceLimits

3. What did you expect to happen instead? It might be obvious to you, but do it anyway!
- No crash

4. Does it happen always, once, or sometimes?
- Always. Although minimal changes can make it not crash anymore
- In my full mod, only crashes with max_distance > 1000, but in the boiled down version, still crashes with max_distance = 1000
- Also did not crash with the create-entity trigger commented out, so this smells like some form of memory corruption

Can be reproduced with a minimal mod only containing this as data.lua.
Tested with this being the only mod active. Can be reproduced by starting new game and waiting 5 seconds, as one spawner will usually be created on nauvis. If not, spawn entity manually and let it die.

Code: Select all

local sounds = require("__base__.prototypes.entity.sounds")

local vault_core = util.merge{ 
  table.deepcopy(data.raw["unit-spawner"]["spitter-spawner"]), 
{
  name = "rabbasca-vault-meltdown",
  icon = data.raw["virtual-signal"]["signal-explosion"].icon,
  max_health = 300,
  healing_per_tick = -100 / second,
}}
vault_core.dying_trigger_effect = {
{
    type = "create-entity",
    check_buildability = true,
    entity_name = "rabbasca-meltdown-effect"
},
{
    type = "play-sound",
    sound = sounds.nuclear_explosion(0.9),
    play_on_target_position = false,
    max_distance = 1000,
},
}

data:extend {
   vault_core,
  {
    type = "explosion",
    name = "rabbasca-meltdown-effect",
    flags = {"not-on-map"},
    hidden = true,
    icons =
    {
      {icon = "__base__/graphics/icons/explosion.png"},
      {icon = "__base__/graphics/icons/atomic-bomb.png"}
    },
    localised_name = {"entity-name.rabbasca-vault-meltdown"},
    order = "a-d-a-b",
    subgroup = "explosions",
    height = 0,
    animations = util.empty_sprite(),
    created_effect =
    {
      type = "direct",
      action_delivery =
      {
      {
        type = "instant",
        target_effects =
        {
          {
            type = "set-tile",
            tile_name = "lava",
            radius = 22,
            apply_projection = true,
            tile_collision_mask = { layers={out_of_map=true} }
          },
          {
            type = "set-tile",
            tile_name = "lava-hot",
            radius = 6,
            apply_projection = true,
            tile_collision_mask = { layers={out_of_map=true} }
          },
        }
      }
      }
    }
  }
}
Full factorio-current.log:

Code: Select all

 0.000 2025-11-17 18:48:47; Factorio 2.0.72 (build 84292, linux64, steam, space-age)
   0.000 Operating system: Linux
   0.000 Initializing Steam API.
   0.000 Program arguments: "/mnt/games/SteamLibrary/steamapps/common/Factorio/bin/x64/factorio" 
   0.000 Config path: /home/fhl/.factorio/config/config.ini
   0.000 Read data path: /mnt/games/SteamLibrary/steamapps/common/Factorio/data
   0.000 Write data path: /home/fhl/.factorio [24093/121803MB]
   0.000 Binaries path: /mnt/games/SteamLibrary/steamapps/common/Factorio/bin
   0.007 System info: [CPU: AMD Ryzen 9 5900HS with Radeon Graphics, 16 cores, RAM: 15391 MB]
   0.007 Environment: DISPLAY=:0 WAYLAND_DISPLAY=wayland-1 DESKTOP_SESSION=niri XDG_SESSION_DESKTOP=niri XDG_CURRENT_DESKTOP=niri SDL_VIDEODRIVER=<unset> __GL_FSAA_MODE=<unset> __GL_LOG_MAX_ANISO=<unset> __GL_SYNC_TO_VBLANK=<unset> __GL_SORT_FBCONFIGS=<unset> __GL_YIELD=<unset>
   0.111 Info ModManager.cpp:279: Found duplicate mod PlanetsLib, using highest version (1.14.4).
   0.111 Info ModManager.cpp:279: Found duplicate mod Ultracube, using highest version (0.6.9).
   0.111 Info ModManager.cpp:279: Found duplicate mod any-planet-start, using highest version (1.1.23).
   0.111 Info ModManager.cpp:279: Found duplicate mod pelagos, using folder version (0.25.1).
   0.111 Info ModManager.cpp:279: Found duplicate mod planet-muluna, using highest version (2.1.61).
   0.111 Info ModManager.cpp:279: Found duplicate mod planet-rabbasca, using highest version (0.6.1).
   0.111 Info ModManager.cpp:279: Found duplicate mod polygonal-quality-icons, using highest version (1.1.1).
   0.111 Info ModManager.cpp:279: Found duplicate mod skewer_shattered_planet, using highest version (1.0.39).
   0.111 Display options: [FullScreen: true] [VSync: true] [UIScale: automatic (100.0%)] [Native DPI: true] [Screen: 255] [Special: lmw] [Lang: en]
   0.132 Video driver: wayland
   0.132 Available displays: 1
   0.132  [0]: PNP(AOC) - 27G1G4 - DP-2 - {[0,0], 1920x1080, SDL_PIXELFORMAT_RGB888, 60Hz}
   0.174 Initialised OpenGL:[0] AMD Radeon Graphics (radeonsi, renoir, ACO, DRM 3.64, 6.17.5); driver: 4.6 (Core Profile) Mesa 25.0.7
   0.174   [Extensions] s3tc:yes; KHR_debug:yes; ARB_clear_texture:yes, ARB_copy_image:yes, ARB_pipeline_statistics_query:yes, ARB_gl_spirv:yes, ARB_ES2_compatibility:yes
   0.174   [Version] 4.6
   0.195 Graphics settings preset: integrated-gpuhigh
   0.195   Dedicated video memory size 5471 MB (detected from AMD Radeon Graphics (RADV RENOIR); VendorID: 0x1002; DeviceID: 0x1638)
   0.208 Graphics options: [Graphics quality: high] [Video memory usage: all] [DXT: low-quality]
   0.208                   [Max threads (load/render): 32/8] [Max texture size: 8192] [Tex.Stream.: false] [Rotation quality: low] [Other: sTDCwtl] [B:0,C:0,S:100]
   0.222 [Audio] Driver:pulseaudio, Device:Default device, Depth:16, Frequency:44100, Channels:2, Interpolation:linear
   0.386 Info ModManager.cpp:446: FeatureFlag expansion-shaders = true
   0.386 Info ModManager.cpp:446: FeatureFlag freezing = true
   0.386 Info ModManager.cpp:446: FeatureFlag quality = true
   0.386 Info ModManager.cpp:446: FeatureFlag rail-bridges = true
   0.386 Info ModManager.cpp:446: FeatureFlag segmented-units = true
   0.386 Info ModManager.cpp:446: FeatureFlag space-travel = true
   0.386 Info ModManager.cpp:446: FeatureFlag spoiling = true
   0.410 Loading mod core 0.0.0 (data.lua)
   0.424 Loading mod base 2.0.72 (data.lua)
   0.560 Loading mod elevated-rails 2.0.72 (data.lua)
   0.587 Loading mod quality 2.0.72 (data.lua)
   0.602 Loading mod space-age 2.0.72 (data.lua)
   0.896 Loading mod sound-effect-bug 0.6.1 (data.lua)
   0.919 Loading mod base 2.0.72 (data-updates.lua)
   0.936 Loading mod quality 2.0.72 (data-updates.lua)
   0.964 Loading mod space-age 2.0.72 (data-updates.lua)
   1.039 Checksum for core: 3316885848
   1.040 Checksum of base: 4219493467
   1.040 Checksum of elevated-rails: 70351106
   1.040 Checksum of quality: 2799402607
   1.040 Checksum of space-age: 1510664043
   1.040 Checksum of sound-effect-bug: 2346547820
   1.376 Prototype list checksum: 34188371
   1.428 Loading sounds...
   2.105 Info PlayerData.cpp:66: Local player-data.json unavailable
   2.105 Info PlayerData.cpp:69: Cloud player-data.json available, timestamp 1763405267
   2.107 Post-data load graphics options: [Light occlusion: no]
   2.302 Initial atlas bitmap size is 8192
   2.308 Created an atlas bitmap (size 8192x8184) [none]
   2.313 Created an atlas bitmap (size 8192x8192) [none]
   2.319 Created an atlas bitmap (size 8192x8164) [none]
   2.322 Created an atlas bitmap (size 8192x8164) [none]
   2.326 Created an atlas bitmap (size 8192x8192) [none]
   2.330 Created an atlas bitmap (size 8192x8180) [none]
   2.334 Created an atlas bitmap (size 8192x8188) [none]
   2.339 Created an atlas bitmap (size 8192x8180) [none]
   2.345 Created an atlas bitmap (size 8192x8188) [none]
   2.349 Created an atlas bitmap (size 8192x8188) [none]
   2.351 Created an atlas bitmap (size 8192x8148) [none]
   2.353 Created an atlas bitmap (size 8192x8188) [none]
   2.354 Created an atlas bitmap (size 8192x8188) [none]
   2.355 Created an atlas bitmap (size 8192x8172) [none]
   2.355 Created an atlas bitmap (size 8192x8192) [none]
   2.355 Created an atlas bitmap (size 4096x2560) [none]
   2.357 Created an atlas bitmap (size 8192x8160) [low-object]
   2.358 Created an atlas bitmap (size 8192x8160) [low-object]
   2.359 Created an atlas bitmap (size 8192x8192) [low-object]
   2.360 Created an atlas bitmap (size 8192x8192) [low-object]
   2.360 Created an atlas bitmap (size 8192x2400) [low-object]
   2.361 Created an atlas bitmap (size 8192x8156) [corpse-decay]
   2.361 Created an atlas bitmap (size 8192x8192) [corpse-decay]
   2.362 Created an atlas bitmap (size 8192x8188) [corpse-decay]
   2.362 Created an atlas bitmap (size 8192x8144) [corpse-decay]
   2.362 Created an atlas bitmap (size 8192x2256) [corpse-decay]
   2.363 Created an atlas bitmap (size 8192x8176) [decal]
   2.363 Created an atlas bitmap (size 8192x8144) [decal]
   2.363 Created an atlas bitmap (size 8192x2740) [decal]
   2.363 Created an atlas bitmap (size 8192x8180) [none]
   2.363 Created an atlas bitmap (size 8192x2992) [none]
   2.364 Created an atlas bitmap (size 1676x79) [not-compressed]
   2.364 Created an atlas bitmap (size 8192x8176) [mipmap, linear-minification, linear-magnification, linear-mip-level]
   2.364 Created an atlas bitmap (size 2400x448) [mipmap]
   2.364 Created an atlas bitmap (size 4096x3040) [smoke, mipmap, linear-minification, linear-magnification]
   2.367 Created an atlas bitmap (size 8192x8096) [terrain, mipmap, linear-minification, linear-mip-level]
   2.368 Created an atlas bitmap (size 8192x8192) [terrain, mipmap, linear-minification, linear-mip-level]
   2.369 Created an atlas bitmap (size 8192x8192) [terrain, mipmap, linear-minification, linear-mip-level]
   2.370 Created an atlas bitmap (size 8192x8128) [terrain, mipmap, linear-minification, linear-mip-level]
   2.370 Created an atlas bitmap (size 8192x8128) [terrain, mipmap, linear-minification, linear-mip-level]
   2.370 Created an atlas bitmap (size 8192x2352) [terrain, mipmap, linear-minification, linear-mip-level]
   2.371 Created an atlas bitmap (size 8192x5760) [terrain-effect-map, mipmap, linear-minification, linear-mip-level]
   2.371 Created an atlas bitmap (size 8192x2608) [mipmap]
   2.371 Created an atlas bitmap (size 3504x768) [mipmap]
   2.371 Created an atlas bitmap (size 4096x3152) [mipmap]
   2.371 Created an atlas bitmap (size 4096x3152) [mipmap]
   2.371 Created an atlas bitmap (size 4096x3152) [mipmap]
   2.372 Created an atlas bitmap (size 8192x3888) [icon, not-compressed, mipmap, linear-minification, linear-magnification, linear-mip-level]
   2.375 Created an atlas bitmap (size 8192x8168) [alpha-mask]
   2.375 Created an atlas bitmap (size 8192x4080) [alpha-mask]
   2.387 Created an atlas bitmap (size 8192x8192) [shadow, linear-magnification, alpha-mask]
   2.390 Created an atlas bitmap (size 8192x8192) [shadow, linear-magnification, alpha-mask]
   2.390 Created an atlas bitmap (size 8192x2332) [shadow, linear-magnification, alpha-mask]
   2.390 Created an atlas bitmap (size 8192x2400) [shadow, mipmap, linear-magnification, alpha-mask]
   2.390 Created an atlas bitmap (size 4096x336) [icon-background, not-compressed, mipmap, linear-minification, linear-magnification, linear-mip-level, ]
   2.390 Loading 3D bitmaps.
   2.398 Texture processor created (4096). GPU accelerated compression Supported: yes, Enabled: yes/yes. Test passed. YCoCgDXT PSNR: 35.83, BC3 PSNR: 33.82
   2.619 Parallel sprite loader initialized (threads: 12, bitmaps: 8398)
  21.751 Sprites loaded
  21.767 Generated mipmaps (4) for atlas [16] of size 8192x8160   
  21.778 Generated mipmaps (4) for atlas [17] of size 8192x8160   
  21.789 Generated mipmaps (4) for atlas [18] of size 8192x8192   
  21.801 Generated mipmaps (4) for atlas [19] of size 8192x8192   
  21.805 Generated mipmaps (4) for atlas [20] of size 8192x2400   
  21.816 Generated mipmaps (3) for atlas [32] of size 8192x8176   
  21.817 Generated mipmaps (3) for atlas [33] of size 2400x448   
  21.820 Generated mipmaps (3) for atlas [34] of size 4096x3040   
  21.829 Generated mipmaps (3) for atlas [35] of size 8192x8096   
  21.839 Generated mipmaps (3) for atlas [36] of size 8192x8192   
  21.849 Generated mipmaps (3) for atlas [37] of size 8192x8192   
  21.859 Generated mipmaps (3) for atlas [38] of size 8192x8128   
  21.869 Generated mipmaps (3) for atlas [39] of size 8192x8128   
  21.872 Generated mipmaps (3) for atlas [40] of size 8192x2352   
  21.879 Generated mipmaps (3) for atlas [41] of size 8192x5760   
  21.959 Generated mipmaps (3) for atlas [42] of size 8192x2608   
  21.961 Generated mipmaps (3) for atlas [43] of size 3504x768   
  21.964 Generated mipmaps (3) for atlas [44] of size 4096x3152   
  21.987 Generated mipmaps (3) for atlas [45] of size 4096x3152   
  21.990 Generated mipmaps (3) for atlas [46] of size 4096x3152   
  21.998 Generated mipmaps (5) for atlas [47] of size 8192x3888   
  22.000 Generated mipmaps (3) for atlas [53] of size 8192x2400   
  22.015 Custom mipmaps uploaded (3493)
  22.059 Video memory usage: 2699.04 MB (Atlases: 2568.74 MB, Textures: 130.30 MB)
  22.124 Factorio initialised
  22.128 Steam Storage Quota: 21900/23841
  24.811 Loading blueprint storage: Local timestamp 1763349554, Cloud timestamp 1763349553
  25.523 Loading level.dat: 1093211 bytes.
  25.523 Info Scenario.cpp:154: Map version 2.0.72-0
  25.536 Loading blueprint storage: Local timestamp 1763349554, Cloud timestamp 1763349553
  25.594 Checksum for script __level__/control.lua: 2722821277
Factorio crashed. Generating symbolized stacktrace, please wait ...
src/Util/StacktraceToStream.cpp (52): walkStackAndPrintToStream
src/Util/StacktraceToStream.cpp (60): printStacktraceToStream
src/Util/Logger.cpp (336): writeStacktrace
src/Util/Logger.cpp (381): logStacktrace
src/Util/Logging.cpp (59): logStackTrace
src/Util/Logging.cpp (107): logAndAbortOrThrow
src/Util/Logging.cpp (96): logAndAbortOrThrow
_Z19ReleaseAssertFailedPKcjS0_
src/Util/Container/Optional.hpp (70): operator*
src/Game.cpp (287): playSoundWithDistanceLimits
src/Trigger/PlaySoundTriggerEffectItem.cpp (34): applyInternal
src/Trigger/TriggerEffectItem.cpp (212): apply
src/Trigger/TriggerEffect.cpp (47): apply
src/Entity/EntityWithHealth.cpp (666): applyDyingTriggerEffect
src/Entity/EntityWithHealth.cpp (725): dieInternal
src/Entity/EntityWithHealth.cpp (660): die
src/Entity/EnemySpawner.cpp (362): die
src/Entity/EntityWithHealth.cpp (599): regenerateHealth
src/Entity/EntityWithHealth.cpp (831): autoHeal
src/Entity/EnemySpawner.cpp (169): update
src/Surface/ActiveEntitiesOrder.hpp (138): update<EnemySpawner>
src/Surface/ActiveEntitiesOrder.hpp (146): update
src/Surface/ActiveEntitiesList.hpp (13): update
src/Surface/Surface.cpp (2445): update
src/Map/Map.cpp (1322): updateEntities
src/Map/Map.cpp (1264): update
src/Game.cpp (191): update
src/Scenario/Scenario.cpp (1222): update
src/Scenario/Scenario.cpp (1134): updateStep
src/MainLoop.cpp (1435): gameUpdateStep
src/MainLoop.cpp (1228): gameUpdateLoop
/opt/gcc-13.2.0/lib/gcc/x86_64-pc-linux-gnu/13.2.0/../../../../include/c++/13.2.0/bits/std_function.h (591): operator()
src/Util/WorkerThread.cpp (70): loop
/tmp/tmp.dlP10F34z6/objdir/../gcc-13.2.0/libstdc++-v3/src/c++11/thread.cc (104): execute_native_thread_routine
start_thread
__GI___clone3
0xffffffffffffffff
Stack trace logging done
  30.675 Error Optional.hpp:70: *this was not true
  30.675 Error CrashHandler.cpp:643: Received 6
Logger::writeStacktrace skipped.
  30.675 Error CrashHandler.cpp:190: Map tick at moment of crash: 180
  30.675 Error Util.cpp:95: Unexpected error occurred. If you're running the latest version of the game you can help us solve the problem by posting the contents of the log file on the Factorio forums.
Please also include the save file(s), any mods you may be using, and any steps you know of to reproduce the crash.
  30.880 Error MessageDialog.cpp:53: Unable to show message dialog. SDL Error: [Couldn't load font -*-*-medium-r-normal--*-120-*-*-*-*-*-*]
  30.880 Uploading log file
  30.916 Info SystemUtil.cpp:842: Started /mnt/games/SteamLibrary/steamapps/common/Factorio/bin/x64/factorio; trampoline PID: 53121
Donion
Factorio Staff
Factorio Staff
Posts: 451
Joined: Sun Aug 22, 2021 9:18 am
Contact:

Re: [Donion] [2.0.72] crash in playSoundWithDistanceLimits with modded sound trigger

Post by Donion »

Thanks for the report, the issue is now fixed for the next release, 2.0.73.

What is happening here is that the create-entity trigger effect which consequently sets tiles which will destroy the vault entity which in turns causes the position of the sound to play in the play-sound event to be empty. And because you have max_distance limit set, having a position is required.
As a workaround until the release, you can put the play-sound trigger effect first, or remove the distance limit.
Post Reply

Return to “Resolved for the next release”