Ticket #39619

Autopick crash with no preference files

Eröffnet am: 2019-09-29 04:44 Letztes Update: 2021-01-01 23:02

Auswertung:
Verantwortlicher:
Typ:
Status:
Geschlossen
Komponente:
(Keine)
Priorität:
3
Schweregrad:
3
Lösung:
Gefixt
Datei:
1

Details

In the English version compiled for Mac OS X (based on the 2.2.1.7 master branch), if neither of the autopick preference files are present and the player selects 'Auto' when destroying an object, the game crashes with a segmentation fault. The top of the call stack at the point of the crash is:

libsystem_c.dylib`flockfile + 18
libsystem_c.dylib`fgets + 42
hengband`my_fgets(fff=0x0000000000000000, buf="\x90Ϳ??", n=1024) at util.c:445:6
hengband`autopick_autoregister(o_ptr=0x0000000109e5fec4) at autopick.c:1959:7
hengband`do_cmd_destroy at cmd-item.c:694:9

In that situation, the first two my_fopen(pref_file, 'r') calls in autopick_autoregister() return a null pointer so pref_fff is null when my_fgets() is called in the while loop. The attached patch resolves the problem by skipping the while loop and close if neither of the preference files could be opened. It does try to append to the preference file (i.e. create it if necessary) in that situation.

Ticket-Verlauf (3/7 Historien)

2019-09-29 04:44 Aktualisiert von: backwardseric
  • New Ticket "Autopick crash with no preference files" created
2019-10-25 01:22 Aktualisiert von: deskull
2020-01-20 22:10 Aktualisiert von: hourier
Kommentar

本件修正し、feature/Refactoring-Hourierブランチにてコミットしました。 後ほどマージ願います

(Edited, 2020-01-20 22:36 Aktualisiert von: hourier)
2020-01-21 00:27 Aktualisiert von: deskull
  • Status Update from Offen to Geschlossen
Kommentar

修正ありがとうございました。チケット閉じます。

2020-01-25 18:05 Aktualisiert von: deskull
  • Verantwortlicher Update from deskull to hourier
2021-01-01 23:02 Aktualisiert von: deskull

Dateianhangliste

Bearbeiten

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Anmelden