Ticket #505 (new bug)

Opened 2 months ago

MacOS: Beachball crash for r754 opening v3.0.9 savefile with randarts

Reported by: roustk@alumni.caltech.edu Assigned to:
Milestone: 3.1.0 Version:
Keywords: Cc:

Description

Simple sequence which reliably crashes r754 under MacOS 10.5.2:

1. Open Angband v3.0.9 and create and save a new character (default options plus randarts).

2. Open Angband v754 and open the saved character.

3. Angband crashes in one of two modes:

  1. Beachball lockup (requiring force quit).
  2. Angband error popup saying "Out of memory!" while Angband window says
      Loading a 3.0.10 savefile...
      Incompatible random artifacts version!
    

Failing to open the file is correct behavior; crashing is not.

It appears that the problem lies in load.c in function old_load(). At line 2331, when loading fails, we return -1 into err and:

  if (err) what = "Cannot parse savefile";

Unfortunately, at line 2280, we defined:

  cptr what = "generic";

Why would this be a problem? cptr is a const char * -- we shouldn't assign things to what, and we *really* shouldn't assign a string longer than 7 characters. This causes the memory error, and probably causes the beachball.

Kevin

Attachments


Add/Change #505 (MacOS: Beachball crash for r754 opening v3.0.9 savefile with randarts)