crash in 4.1.3 nightly

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bron
    Knight
    • May 2008
    • 515

    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
    Vanilla maintainer
    • Apr 2007
    • 9634

    #2
    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.
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.

    Comment

    • bron
      Knight
      • May 2008
      • 515

      #3
      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.

      Comment

      • wobbly
        Prophet
        • May 2012
        • 2629

        #4
        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.

        Comment

        • bron
          Knight
          • May 2008
          • 515

          #5
          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.

          Comment

          • wobbly
            Prophet
            • May 2012
            • 2629

            #6
            Originally posted by Nick
            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?

            Comment

            • wobbly
              Prophet
              • May 2012
              • 2629

              #7
              Originally posted by wobbly
              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

              Comment

              • Nick
                Vanilla maintainer
                • Apr 2007
                • 9634

                #8
                Originally posted by bron
                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.
                One for the Dark Lord on his dark throne
                In the Land of Mordor where the Shadows lie.

                Comment

                • bron
                  Knight
                  • May 2008
                  • 515

                  #9
                  Originally posted by Nick
                  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 -

                  Comment

                  • Nick
                    Vanilla maintainer
                    • Apr 2007
                    • 9634

                    #10
                    Originally posted by bron
                    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.
                    One for the Dark Lord on his dark throne
                    In the Land of Mordor where the Shadows lie.

                    Comment

                    Working...
                    😀
                    😂
                    🥰
                    😘
                    🤢
                    😎
                    😞
                    😡
                    👍
                    👎