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

Interrupted crafting crash #610

Open
red-kangaroo opened this issue Jun 23, 2020 · 5 comments
Open

Interrupted crafting crash #610

red-kangaroo opened this issue Jun 23, 2020 · 5 comments
Labels
Bug Crafting subsystem For issues related to the crafting system Crash (player triggered) Crash triggered by certain player action

Comments

@red-kangaroo
Copy link
Contributor

Reported here.

Trying to make ingots out of iron. The first attempt was interrupted (because I was starving and passed out) but I decided to continue processing my lumps for a bones file. I didn't "continue previous job" (if such an option exists) but went straight back to "melt ingot" (which, side note, is poorly phrased - makes it sound like we are taking ingots and melting them down, rather than melting lumps into ingots).

CTD with the following message:

this crafting was already suspended
'rc.IscanBeSuspended()=1; itToolID=0; itTool2ID=0, itSpawnCfg=2, itSpawnMatMainCfg=28674; itSpawnMatMainVol=250; itSpawnMatSecCfg=0; itSpawnMatSecVol=0; otSpawnCfg=0; otSpawnMatMainCfg=0; otSpawnMatMainVol=0; otSpawnMatSecCfg=0; otSpawnMatSecVol=0; fsItemSpawnSearchPrototype=; fsCraftInfo=melt an ingot (), started at Underwater Tunnel II; v2AnvilLocation=0,0; v2ForgeLocation=129,12; v2WorkbenchLocation=0,0; v2PlaceAt=0,0; v2PlayerCraftingAt=128,12;

Any ideas, @AquariusPower ?

@red-kangaroo red-kangaroo added Bug Crafting subsystem For issues related to the crafting system Crash (player triggered) Crash triggered by certain player action labels Jun 23, 2020
@AquariusPower
Copy link
Contributor

could be "melt (something) into an ingot"? hehe yep that needs fixing :>
on the code we would change the var value from "melt" to "melt into" I think?

I didn't "continue previous job" (if such an option exists)

I think it will be there, so you can continue it,

this crafting was already suspended

and would be a way to avoid the "crash" (it was actually an intentional ABORT() based on the message above).

but went straight back to "melt ingot"

Based on what you did, it should not crash in that way...
It should just create a new melt action, and later if you try to use the suspended one it would complain about missing ingredients and would fail but not ABORT().

Btw, what branch you used for this test? Despite I didn't change anything about it so I guess this test will ABORT() in all branches.

@red-kangaroo
Copy link
Contributor Author

Not me, that was Ischaldirh on the forums. :) I'd think they were playing the latest release, so it might have already been fixed in your feature branch.

@AquariusPower
Copy link
Contributor

AquariusPower commented Jun 26, 2020

the bug still happens on latest branch somefixes1234
follow exactly what he said
I used a lump of 1000cm3 and ingots of minimum volume (so we have time to suspend it by pressing any key)
if I try to start a new melt action with the same lump and ingot volum it will ABORT() with that message!

the problem is the craft action ID, it is not as unique as I thought...
this is the code

void craftcore::AddSuspended(const recipedata& rpd){
...
  for(int i=0;i<vSuspended.size();i++)
    if(vSuspended[i].id()==rpd.id()) //!!! BUG HERE IS THE NOT SO UNIQUE ID PROBLEM !!!
      ABORT("this crafting was already suspended '%s'",vSuspended[i].id().CStr());

this is the stacktrace:

#0  dbgmsg::breakPointSimulator() at FeLib/Source/dbgmsg.cpp:594
#1  globalerrorhandler::Abort(Format = 0x555555fddf40 "this crafting was already suspended %s") at FeLib/Source/error.cpp:144
#2  craftcore::AddSuspended(rpd = ) at Main/Source/cmdcraft.cpp:36
#3  craft::Terminate(this = 0x55555b87a7f0, Finished = false) at Main/Source/actions.cpp:400
#4  character::Be(this = 0x55555b0202d0) at Main/Source/char.cpp:1128
#5  pool::Be() at Main/Source/pool.cpp:31
#6  game::Run() at Main/Source/game.cpp:1139
#7  main(argc = 1, argv = 0x7ffffffc31f8) at Main/Source/main.cpp:235

so, to fix this bug that ID rpd.id() must be more unique.

I think to make it 100% unique, we just need to add the initial starting gameplay turn to the ID (actually the ID could be just that turn I guess...), it will have to be a recipedata field and will also have to be saved.

PS.: I added as many details as possible as I dont know when I will be able to implement it

@AquariusPower
Copy link
Contributor

implemented and tested: at #587 :>

@red-kangaroo
Copy link
Contributor Author

Maybe related: Linux crafting crash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Crafting subsystem For issues related to the crafting system Crash (player triggered) Crash triggered by certain player action
Projects
None yet
Development

No branches or pull requests

2 participants