Angband Forums

Angband Forums (http://angband.oook.cz/forum/index.php)
-   Development (http://angband.oook.cz/forum/forumdisplay.php?f=10)
-   -   crash in 4.1.3 nightly (http://angband.oook.cz/forum/showthread.php?t=9430)

bron May 21, 2019 06:20

crash in 4.1.3 nightly
 
I'm moving the discussion of this bug to here so I don't bore the people on the Vanilla thread. See: http://angband.oook.cz/forum/showthr...t=9051&page=44 for the original post.

So I looked at this a tiny bit. It's dying in obj-util.c in routine "distribute_charges" at line 802, because it's dividing by zero, i.e. source->number is zero. I don't offhand see how that's possible, particularly since the "Inventory" screen shows the correct number of wands. I note that if I pick up the (recharged) wand off the ground, I can then drop one wand, but even then if I try to drop a second wand, I still get the bug. I note however, that the process of dropping the second wand, hitting the bug, and restarting, causes one of the *charges* from the stack in my inventory to disappear (the number of actual *wands* remains correct).

Nick May 21, 2019 06:43

Thanks. I had got to a similar place as you. In fact, the correct number of wands is shown for the actual object, but each object has a known version as well (representing what the player knows about the object), and it is this known version that has number zero.

Your tip that picking up the other wand and then dropping twice still triggers the bug should be really helpful, because now I can watch and see how the numberon the known object changes.

bron May 21, 2019 09:56

I should also note that I have done this sort of operation many times during the game already, with many different types of wands/staffs, so it definitely has worked before. Although .. I believe (?) that all the other times I've done the multiple recharging thing, the character was in the dungeon, rather than in the town.

wobbly May 21, 2019 16:40

Not sure if it's related but Holy Rage got this crash in coffeeband:

Code:

Pile integrity failure at obj-pile.c:214 Guilty object ============= Name: & Slime Mold~
Same file as current master. I suspect this is a bug from V, rather then anything I've introduced, though of course I can't be sure. If I find it & it is in current master, I'll let you know.

bron May 22, 2019 08:30

I stuck in the following hack:
Code:

        if (tval_can_have_charges(source)) {
/*bcn hack*/
if((source->number)<=0)dest->pval=0;else
                dest->pval = source->pval * amt / source->number;

which allows me to continue playing, although this is clearly NOT anything even remotely like a "fix" for whatever the problem is.

wobbly May 22, 2019 11:19

Quote:

Originally Posted by Nick (Post 138471)
Thanks. I had got to a similar place as you. In fact, the correct number of wands is shown for the actual object, but each object has a known version as well (representing what the player knows about the object), and it is this known version that has number zero.

Your tip that picking up the other wand and then dropping twice still triggers the bug should be really helpful, because now I can watch and see how the numberon the known object changes.

Idle curiousity, does detect object look at 1 list & los the other? Your saying a pair of object lists are out of sync?

wobbly May 22, 2019 20:22

Quote:

Originally Posted by wobbly (Post 138476)
Same file as current master. I suspect this is a bug from V, rather then anything I've introduced, though of course I can't be sure. If I find it & it is in current master, I'll let you know.

I found this & it was me. Ignore

Nick May 25, 2019 01:55

Quote:

Originally Posted by bron (Post 138473)
I should also note that I have done this sort of operation many times during the game already, with many different types of wands/staffs, so it definitely has worked before. Although .. I believe (?) that all the other times I've done the multiple recharging thing, the character was in the dungeon, rather than in the town.

What can you remember of the history of this stack of wands? Had they been recharged like this before, had you had any blow up from recharge fail, had you bought or sold any of them, were they dropped by monsters or found on the ground, did you ever leave them at home? I'm not expecting you to remember all this, just looking for hints as to where the problem might lie.

I plan to fix the problem by actually aligning number of item and its known version every time there is a drop or a pickup, but it would be nice to know what's currently going wrong.

bron May 28, 2019 19:36

Quote:

Originally Posted by Nick (Post 138513)
What can you remember of the history of this stack of wands?

As you can imagine, I'm not real confident that I remember the complete history of these wands, so this is likely to be inaccurate. That said: One wand was bought from the Black Market, the rest were picked up in the dungeon. I have no idea if they were originally on the ground, or if they were dropped by a defeated monster. I did stash the first couple in my Home for awhile, until I had built up a stack of three. I have recharged them before, always in the same way: I have a stack in my inventory with zero charges, I drop one wand, Recharge it on the ground, step to the side (without picking it up), drop another one, Recharge it, etc., until I only have one wand remaining in my inventory. I Recharge the last wand (in my inventory), then pick-up all the charged wands off the ground. I have had at least one wand blow up on a recharge attempt. For this particular set of wands, they have always been discharged in the same way: via the "Tap charges for mana" spell. I don't think I have ever actually fired one at an enemy.

I find it hard to believe that any of that is going to be useful, but I hope to be proven wrong -

Nick May 28, 2019 23:23

Quote:

Originally Posted by bron (Post 138532)
As you can imagine, I'm not real confident that I remember the complete history of these wands, so this is likely to be inaccurate. That said: One wand was bought from the Black Market, the rest were picked up in the dungeon. I have no idea if they were originally on the ground, or if they were dropped by a defeated monster. I did stash the first couple in my Home for awhile, until I had built up a stack of three. I have recharged them before, always in the same way: I have a stack in my inventory with zero charges, I drop one wand, Recharge it on the ground, step to the side (without picking it up), drop another one, Recharge it, etc., until I only have one wand remaining in my inventory. I Recharge the last wand (in my inventory), then pick-up all the charged wands off the ground. I have had at least one wand blow up on a recharge attempt. For this particular set of wands, they have always been discharged in the same way: via the "Tap charges for mana" spell. I don't think I have ever actually fired one at an enemy.

I find it hard to believe that any of that is going to be useful, but I hope to be proven wrong -

Thanks - probably not, but maybe :)

I've done a fix which makes that savefile not crash, but it's fixing when the numbering has gone wrong rather that stopping it going wrong, so I do want to have another look at it.


All times are GMT +1. The time now is 13:34.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.