Cataclysm-dda: Arithmetical error after consuming a lonely aspirin

Created on 30 May 2020  路  8Comments  路  Source: CleverRaven/Cataclysm-DDA

the bug:

I have some pain, I decide to consume an aspirin, I see a lonely aspirin in my inventory, I think is the leftover of a stash in one of my pockets, I consume it and.... BOOM

This is the crashlog

The program has crashed.
See the log file for a stack trace.
CRASH LOG FILE: ./config/crash.log
VERSION: 0.E-2684-g2bb4c7f
TYPE: Signal
MESSAGE: SIGFPE: Arithmetical error
STACK TRACE:

#0
(dbghelp: @0x6527e6[cataclysm-tiles.exe+0x2527e6]),
(libbacktrace: Z21debug_write_backtraceRSo+0x56@0x6527e6),
(libbacktrace: 0x6527e6 [unknown src]:0 [unknown func]),
#1
(dbghelp: @0x633e7f[cataclysm-tiles.exe+0x233e7f]),
(libbacktrace: log_crash+0x4af@0x633e7f),
(libbacktrace: 0x633e7f [unknown src]:0 [unknown func]),
#2
(dbghelp: @0x634b52[cataclysm-tiles.exe+0x234b52]),
(libbacktrace: signal_handler+0x32@0x634b52),
(libbacktrace: 0x634b52 [unknown src]:0 [unknown func]),
#3
(dbghelp: SMPEG_error+0x4b0b1@0x10c52fd[cataclysm-tiles.exe+0xcc52fd]),
(libbacktrace: gnu_exception_handler+0xed@0x10c52fd),
(libbacktrace: 0x10c52fd /home/narc/src/mxe/tmp-gcc-x86_64-w64-mingw32.static/gcc-5.4.0.build_/mingw-w64-v5.0.2/mingw-w64-crt/crt/crt_handler.c:269 _gnu_exception_handler),
#4
(dbghelp: _C_specific_handler+0x98@0x7ffb620b8048[msvcrt.dll+0x28048]),
(backtrace_syminfo failed: errno = -1, msg = no symbol table in PE/COFF executable),
(backtrace_pcinfo failed: errno = -1, msg = no debug info in PE/COFF executable),
#5
(dbghelp: _chkstk+0x11f@0x7ffb635811cf[ntdll.dll+0xa11cf]),
(backtrace_syminfo failed: errno = -1, msg = no symbol table in PE/COFF executable),
(backtrace_pcinfo failed: errno = -1, msg = no debug info in PE/COFF executable),
#6
(dbghelp: RtlRaiseException+0x399@0x7ffb6354a209[ntdll.dll+0x6a209]),
(backtrace_syminfo failed: errno = -1, msg = no symbol table in PE/COFF executable),
(backtrace_pcinfo failed: errno = -1, msg = no debug info in PE/COFF executable),
#7
(dbghelp: KiUserExceptionDispatcher+0x2e@0x7ffb6357fe3e[ntdll.dll+0x9fe3e]),
(backtrace_syminfo failed: errno = -1, msg = no symbol table in PE/COFF executable),
(backtrace_pcinfo failed: errno = -1, msg = no debug info in PE/COFF executable),
#8
(dbghelp: @0x604977[cataclysm-tiles.exe+0x204977]),
(libbacktrace: ZN9Character15consume_effectsER4item+0x347@0x604977),
(libbacktrace: 0x604977 [unknown src]:0 [unknown func]),
#9
(dbghelp: @0x60755b[cataclysm-tiles.exe+0x20755b]),
(libbacktrace: ZN6player7consumeER4itemb+0x7bb@0x60755b),
(libbacktrace: 0x60755b [unknown src]:0 [unknown func]),
#10
(dbghelp: @0x608bdf[cataclysm-tiles.exe+0x208bdf]),
(libbacktrace: ZN6player7consumeE13item_locationb+0x12f@0x608bdf),
(libbacktrace: 0x608bdf [unknown src]:0 [unknown func]),
#11
(dbghelp: @0x41ed85[cataclysm-tiles.exe+0x1ed85]),
(libbacktrace: ZN22consume_activity_actor6finishER15player_activityR9Character+0x1b5@0x41ed85),
(libbacktrace: 0x41ed85 [unknown src]:0 [unknown func]),
#12
(dbghelp: @0xd9aa7b[cataclysm-tiles.exe+0x99aa7b]),
(libbacktrace: ZN15player_activity7do_turnER6player+0x74b@0xd9aa7b),
(libbacktrace: 0xd9aa7b [unknown src]:0 [unknown func]),
#13
(dbghelp: @0x71eb65[cataclysm-tiles.exe+0x31eb65]),
(libbacktrace: ZN4game16process_activityEv+0x75@0x71eb65),
(libbacktrace: 0x71eb65 [unknown src]:0 [unknown func]),
#14
(dbghelp: @0x773dbc[cataclysm-tiles.exe+0x373dbc]),
(libbacktrace: ZN4game7do_turnEv+0x2fc@0x773dbc),
(libbacktrace: 0x773dbc [unknown src]:0 [unknown func]),
#15
(dbghelp: IMG_LoadWEBP_RW+0x6d7828@0x188e918[cataclysm-tiles.exe+0x148e918]),
(libbacktrace: main+0x11a8@0x188e918),
(libbacktrace: 0x188e918 [unknown src]:0 [unknown func]),
#16
(dbghelp: @0x4013ed[cataclysm-tiles.exe+0x13ed]),
(libbacktrace: _tmainCRTStartup+0x23d@0x4013ed),
(libbacktrace: 0x4013ed /home/narc/src/mxe/tmp-gcc-x86_64-w64-mingw32.static/gcc-5.4.0.build_/mingw-w64-v5.0.2/mingw-w64-crt/crt/crtexe.c:336 __tmainCRTStartup),
#17
(dbghelp: @0x4014fb[cataclysm-tiles.exe+0x14fb]),
(libbacktrace: WinMainCRTStartup+0x1b@0x4014fb),
(libbacktrace: 0x4014fb /home/narc/src/mxe/tmp-gcc-x86_64-w64-mingw32.static/gcc-5.4.0.build_/mingw-w64-v5.0.2/mingw-w64-crt/crt/crtexe.c:186 WinMainCRTStartup),
#18
(dbghelp: BaseThreadInitThunk+0x14@0x7ffb615a7bd4[KERNEL32.DLL+0x17bd4]),
(backtrace_syminfo failed: errno = -1, msg = no symbol table in PE/COFF executable),
(backtrace_pcinfo failed: errno = -1, msg = no debug info in PE/COFF executable),
#19
(dbghelp: RtlUserThreadStart+0x21@0x7ffb6354ce51[ntdll.dll+0x6ce51]),
(backtrace_syminfo failed: errno = -1, msg = no symbol table in PE/COFF executable),
(backtrace_pcinfo failed: errno = -1, msg = no debug info in PE/COFF executable),

Steps To Reproduce

Eh, wait until you have a lonely item of a stash in your inventory or IDK

Expected behavior

it shouldn't crash and give me headache

Versions and configuration

  • OS: win 10
  • Game Version: 10712
  • Graphics version: tiles
  • Ingame language: english
  • Mods loaded: no railroads, disable npc needs, cdda basic
    -->

Additional context

https://textsaver.flap.tv/lists/3exj

(S1 - Need confirmation) <Crash / Freeze>

Most helpful comment

I got that bug too yesterday. I don't know how to reproduce it, yet, but there is definitely a bug there.

All 8 comments

Cannot reproduce. Could you upload your save?

Cannot reproduce. Could you upload your save?

the accident happened way far from my last save, i picked up some aspirine and it automatically sorted them in a way that separated that single pill from the rest

I got that bug too yesterday. I don't know how to reproduce it, yet, but there is definitely a bug there.

It happens with many small items, not only aspirin. Sometimes - don't know how to reproduce it sadly - when you moving statcks of things like drugs, nuts or sweets betweed containers and inventory, one singular unit bugs out somehow. You can see it no longer stacks correctly with the rest and there is weirdness with moving it around - it does not turn a "-" to a "+" sign when you sellect it to drop and when dropped anyway, it does not go into world container (like vehicle trunk or braizer) but always on the ground.

Trying to consume such bugged item crashes the game as OP described.

It happens with many small items, not only aspirin. Sometimes - don't know how to reproduce it sadly - when you moving statcks of things like drugs, nuts or sweets betweed containers and inventory, one singular unit bugs out somehow. You can see it no longer stacks correctly with the rest and there is weirdness with moving it around - it does not turn a "-" to a "+" sign when you sellect it to drop and when dropped anyway, it does not go into world container (like vehicle trunk or braizer) but always on the ground.

Trying to consume such bugged item crashes the game as OP described.

what would happen if you move to the ground the whole stack + the lone item then pick it up again? it should disappear

it must have something to do with the nested hell system

I tried picking up a cake (12), the game prompted me to unequip an item to wield it. I declined, and the cake (12) fell on the floor I was standing, mentioning "you pick up 0 cakes (fresh)". I sat on a chair near the floor to (E)at the cake (12). The "- consuming..." dialog is shown.

I get the exact same error log as above, except the IL's (@0x...) are changed slightly due to running 0.E-2818-gbbc9163 instead of 0.E-2684-g2bb4c7f.

E.g:

  • Not restricted to single item, since cake (12) has multiple portions
  • Possibly related to cancelling out of attempting to pick up the item, resulting in "you pick up 0 ..."
  • Seems to allow starting "consuming", but crashes after the dialog spins its "-" a few times - e.g after time passes

More tests:

  • (E)ating the cake (12) on its own, when nearby, gives no issues
  • Repeating the "you pick up 0 cakes (fresh)":

When you attempt to pick up with a full inventory, then (Esc)ape out of the menu asking you what to do with a wielded item, an item "cake (fresh)" is still added to your inventory, while cake (12) remains on the floor below the player. Eating from the floor works fine, but attempting to eat the fake "cake (fresh)" listed under Food causes the Arithmetical Error!

  • Picking up the cake (12) from the floor again in the same way results in the cake (12) completely disappearing, leaving you with the fake cake in inventory
  • The 0 cake can be dropped, has 0 weight and 0 volume, can be picked up without requiring a prompt to be added to inventory, doesn't ask to remove weapon to wield it

I would guess that the problem is the way picking up those items is handled. I would normally expect a prompt in the vein of "You don't have space for that item, would you like to remove your wielded weapon?", but it immediately seems to go to removing the wielded weapon, which, when cancelled out of, adds "0" of the item to your inventory.

Then, the consuming code must be dividing by the count of the item at some point, resulting in a simple division by zero error.

Same here. I think it happened after I drank some soda from a can.
Hang on, will reload and try to reproduce. That seems to be the roadblock here.
Hmm, can't reproduce. Perhaps a divide-by-zero error that only happens sometimes.

Was this page helpful?
0 / 5 - 0 ratings