Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CAUSE FOUND] Memory leak and crash when falling asleep with a radio on #32968

Closed
ampersand55 opened this issue Aug 6, 2019 · 8 comments · Fixed by #33297
Closed

[CAUSE FOUND] Memory leak and crash when falling asleep with a radio on #32968

ampersand55 opened this issue Aug 6, 2019 · 8 comments · Fixed by #33297
Labels
<Crash / Freeze> Fatal bug that results in hangs or crashes. Items / Item Actions / Item Qualities Items and how they work and interact (S1 - Need confirmation) Report waiting on confirmation of reproducibility

Comments

@ampersand55
Copy link
Contributor

ampersand55 commented Aug 6, 2019

Describe the bug

If you sleep with a radio in your inventory turned on, there is a memory leak and game crash.

Note that I'm referring to the tool with item id "radio" / "radio_on". Not a vehicle stereo or mp3 player.

Steps To Reproduce

  1. Make a new player
  2. Create a radio via the debug menu (and battery, ambien, rollmat, earplugs if needed)
  3. Turn on the radio
  4. Sleep

Before sleeping open task manager or other memory monitoring program to check memory usage.

Expected behavior

Screenshots

Versions and configuration

- OS: Windows
    - OS Version: 10.0 1607
- Game Version: 0.D-6237-g7682029 [64-bit]
- Graphics Version: Tiles
- Mods loaded: [
    Dark Days Ahead [dda]
]

Additional context

For other players:

If you are affected by this and autosave before sleeping you can turn off/remove the radio from the .sav file with a text-editor.

@perryprog
Copy link
Contributor

I can't reproduce this after a 9 hour sleep. Memory sticked around at 634MB or about 2 to 4% usage. Could be OS specific?

- OS: macOS
    - OS Version: Name: macOS; Version: 10.14.6; Build: 18G84; 
- Game Version: 0.D-6239-ga1ada1a67e [64-bit]
- Graphics Version: Tiles
- Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food]
]

@ampersand55
Copy link
Contributor Author

ampersand55 commented Aug 7, 2019

Maybe. I don't currently have access to another OS to check.

New info: The radio itself causes the memory leak.

Simply waiting in-game with with the radio on makes the memory spike.

https://i.imgur.com/CIYmDcu.png

CRASH LOG FILE: config/crash.log
VERSION: 0.D-6237-g7682029
TYPE: Signal
MESSAGE: SIGSEGV: Segmentation fault
STACK TRACE:
    @0x59D9A5[cataclysm-tiles.exe+0x19D9A5]
    @0x59E472[cataclysm-tiles.exe+0x19E472]
    SMPEG_error+0x4B034@0xF37480[cataclysm-tiles.exe+0xB37480]
    _C_specific_handler+0x96@0x7FFEC8256606[ntdll.dll+0x96606]
    _chkstk+0x11D@0x7FFEC826A58D[ntdll.dll+0xAA58D]
    RtlImageNtHeaderEx+0x483@0x7FFEC81FFD23[ntdll.dll+0x3FD23]
    KiUserExceptionDispatcher+0x3A@0x7FFEC82696FA[ntdll.dll+0xA96FA]
    @0xD44FFB[cataclysm-tiles.exe+0x944FFB]
    @0xD468E5[cataclysm-tiles.exe+0x9468E5]
    @0x826C13[cataclysm-tiles.exe+0x426C13]
    IMG_LoadWEBP_RW+0x2E0CC1@0x1309FB1[cataclysm-tiles.exe+0xF09FB1]
    @0x7EC965[cataclysm-tiles.exe+0x3EC965]
    @0x7B038D[cataclysm-tiles.exe+0x3B038D]
    @0x7B11C2[cataclysm-tiles.exe+0x3B11C2]
    @0xC31865[cataclysm-tiles.exe+0x831865]
    @0x6BB56A[cataclysm-tiles.exe+0x2BB56A]
    IMG_LoadWEBP_RW+0x575DD8@0x159F0C8[cataclysm-tiles.exe+0x119F0C8]
    @0x4013ED[cataclysm-tiles.exe+0x13ED]
    @0x4014FB[cataclysm-tiles.exe+0x14FB]
    BaseThreadInitThunk+0x14@0x7FFEC58C84D4[KERNEL32.DLL+0x84D4]
    RtlUserThreadStart+0x21@0x7FFEC822E851[ntdll.dll+0x6E851]

@Qrox
Copy link
Contributor

Qrox commented Aug 7, 2019

Cannot reproduce on windows 10. Can you attach a save that reproduces the problem? I do noticed that radios do not seem to be producing sound and draining battery any more, but that's probably a separate issue.

@ampersand55
Copy link
Contributor Author

Sure.

Test world.zip

@Qrox
Copy link
Contributor

Qrox commented Aug 7, 2019

Nope, still cannot reproduce on the exact version as shown in your crash log.

@ampersand55
Copy link
Contributor Author

Peculiar...

The problem persists for me after downloading a new version via the CDDA launcher.

Thanks for trying anyway.

@ZhilkinSerg ZhilkinSerg added (S1 - Need confirmation) Report waiting on confirmation of reproducibility <Crash / Freeze> Fatal bug that results in hangs or crashes. Items / Item Actions / Item Qualities Items and how they work and interact labels Aug 7, 2019
@ZhilkinSerg
Copy link
Contributor

Can you send us your config folder please?

@ampersand55
Copy link
Contributor Author

I noticed that the error disappeared when deleting and resetting the config folder, so I did a little testing and it turns out that @'s soundpack caused the error.

@'s soundpack has 3-7 mb, 18-43 seconds long .wav files playing inaudible_chatter as radio sound effects, which probably caused the memory spike when played in succession while sleeping/waiting.

From @'s soundpack effects.json

{
  "type": "sound_effect",
  "id": "radio",
  "variant": "inaudible_chatter",
  "volume": 90,
  "files": [
    "effects/misc/radio_inaudible_chatter_1.wav",
    "effects/misc/radio_inaudible_chatter_2.wav",
    "effects/misc/radio_inaudible_chatter_3.wav",
    "effects/misc/radio_inaudible_chatter_4.wav"
  ]
},

You could close this as it's not a fault within the main game, but I think limiting the game to only play 1-3 sound effects of a specific "variant" at a time would be good. I've also noticed that thunder gets extremely loud when sleeping and several thunder strikes are played at the same time.

@'s soundpack links:

@ampersand55 ampersand55 changed the title Memory leak and crash when falling asleep with a radio on [CAUSE FOUND] Memory leak and crash when falling asleep with a radio on Aug 10, 2019
kevingranade added a commit that referenced this issue Aug 21, 2019
Fixed "Memory leak and crash when falling asleep with a radio on #32968"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Crash / Freeze> Fatal bug that results in hangs or crashes. Items / Item Actions / Item Qualities Items and how they work and interact (S1 - Need confirmation) Report waiting on confirmation of reproducibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants