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

Arithmetical error after consuming a lonely aspirin #40968

Closed
bloodraven983 opened this issue May 30, 2020 · 9 comments
Closed

Arithmetical error after consuming a lonely aspirin #40968

bloodraven983 opened this issue May 30, 2020 · 9 comments
Labels
(S1 - Need confirmation) Report waiting on confirmation of reproducibility

Comments

@bloodraven983
Copy link

bloodraven983 commented May 30, 2020

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

@anothersimulacrum anothersimulacrum added <Crash / Freeze> Fatal bug that results in hangs or crashes. (S1 - Need confirmation) Report waiting on confirmation of reproducibility labels May 30, 2020
@anothersimulacrum
Copy link
Member

Cannot reproduce. Could you upload your save?

@bloodraven983
Copy link
Author

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

@TheStoneWolf
Copy link
Contributor

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

@LordKaaven
Copy link

LordKaaven commented Jun 1, 2020

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.

@bloodraven983
Copy link
Author

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

@Alicecomma
Copy link

Alicecomma commented Jun 3, 2020

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

@Alicecomma
Copy link

Alicecomma commented Jun 3, 2020

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.

@misterprimus
Copy link
Contributor

misterprimus commented Jul 17, 2020

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.

@int-ua int-ua added stale Closed for lack of activity, but still valid. and removed <Crash / Freeze> Fatal bug that results in hangs or crashes. labels Jan 16, 2021
@stale stale bot removed the stale Closed for lack of activity, but still valid. label Jan 16, 2021
@int-ua
Copy link
Contributor

int-ua commented Jun 24, 2021

Please comment if you see this again and we'll reopen this issue.

@int-ua int-ua closed this as completed Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(S1 - Need confirmation) Report waiting on confirmation of reproducibility
Projects
None yet
Development

No branches or pull requests

7 participants