Opened 10 years ago

Closed 10 years ago

#1204 closed bug (fixed (in master))

Game crashes when trying to access object knowledge menu

Reported by: ycombinator Owned by:
Milestone: 3.2.0 Keywords: recall


Trunk (commit d54cb24a) build on Linux/amd64.

Save file from previous version was removed and new character was successfully created. When trying to access object knowledge menu (either via ~ or autoinscription setup) game crashes with SIGSEGV. GDB shows that it tries to strcmp two NULL pointers in o_cmp_tval function (ui-knowledge.c:1673) which is called as a comparison predicate from display_knowledge function in the same file. I am posting the complete stack trace in the comments.

As far as I understand this happens because the game tries to compare two scrolls this way, and randomly generated scroll titles are never written to the flavor_info array. It looks like the bug was triggered by the recent overhaul of the flavor parser.

I'm attaching save file in hope it will help to reproduce the bug.

Attachments (1)

1000.Rooslan (37.4 KB) - added by ycombinator 10 years ago.
save file

Download all attachments as: .zip

Change History (3)

comment:1 Changed 10 years ago by ycombinator

Stack trace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f2e4bf82750 (LWP 30701)]
0x00007f2e4aedc6d0 in strcmp () from /lib/
(gdb) bt
#0  0x00007f2e4aedc6d0 in strcmp () from /lib/
#1  0x00000000004a31e8 in o_cmp_tval (a=0x7f2e3c1cca04, b=0x7f2e3c1cca08)
    at ui-knowledge.c:1673
#2  0x00007f2e4ae916e2 in ?? () from /lib/
#3  0x00007f2e4ae9169b in ?? () from /lib/
#4  0x00007f2e4ae9168b in ?? () from /lib/
#5  0x00007f2e4ae9169b in ?? () from /lib/
#6  0x00007f2e4ae9168b in ?? () from /lib/
#7  0x00007f2e4ae9168b in ?? () from /lib/
#8  0x00007f2e4ae9169b in ?? () from /lib/
#9  0x00007f2e4ae9168b in ?? () from /lib/
#10 0x00007f2e4ae91d1f in qsort_r () from /lib/
#11 0x00000000004c0593 in sort (base=0x7f2e3c1cc8f8, nmemb=237, smemb=4, 
    comp=0x4a2ffd <o_cmp_tval>) at z-util.c:299
#12 0x000000000049facd in display_knowledge (title=0x4ea9b8 "known objects", 
    obj_list=0x7f2e3c1cc8f8, o_count=237, g_funcs=
      {maxnum = 100, easy_know = false, name = 0x4a1dfb <kind_name>, gcomp = 0x4a2ffd <o_cmp_tval>, group = 0x4a31f0 <obj2gid>, summary = 0}, o_funcs=
      {display_member = 0x4a2b01 <display_object>, lore = 0x4a2e47 <desc_obj_fake>, xchar = 0x4a322f <o_xchar>, xattr = 0x4a32b2 <o_xattr>, xtra_prompt = 0x4a3335 <o_xtra_prompt>, xtra_act = 0x4a33cc <o_xtra_act>, is_visual = false}, 
    otherfields=0x4ea998 "Squelch  Inscribed          Sym")
    at ui-knowledge.c:392
#13 0x00000000004a3886 in textui_browse_object_knowledge (
    name=0x4ea9e7 "Display object knowledge", row=0) at ui-knowledge.c:1826
#14 0x00000000004a40fd in menu_action_handle (m=0x721a40, 
    event=0x7fff8fac1e10, oid=0) at ui-menu.c:92
#15 0x00000000004a4f7e in menu_handle_action (m=0x721a40, in=0x7fff8fac1e10)
    at ui-menu.c:519
#16 0x00000000004a5390 in menu_select (menu=0x721a40, notify=80)
    at ui-menu.c:656
#17 0x00000000004a3ecd in textui_browse_knowledge () at ui-knowledge.c:2035
#18 0x000000000040eeff in textui_process_key (c=126 '~') at cmd0.c:763
#19 0x000000000040ef84 in textui_process_command (no_request=false)
    at cmd0.c:793
#20 0x00000000004b7e60 in textui_get_cmd (context=CMD_GAME, wait=true)
    at xtra3.c:1800
#21 0x00000000004c0e6e in default_get_cmd (context=CMD_GAME, wait=true)
    at main.c:230
#22 0x0000000000425fb7 in cmd_get (c=CMD_GAME, cmd=0x7fff8fac1fa0, wait=true)
    at game-cmd.c:175
#23 0x00000000004266b4 in process_command (ctx=CMD_GAME, no_request=false)
    at game-cmd.c:323
#24 0x000000000041acc6 in process_player () at dungeon.c:1088
#25 0x000000000041b5e9 in dungeon () at dungeon.c:1510
#26 0x000000000041bc10 in play_game () at dungeon.c:1835
#27 0x00000000004c12b7 in main (argc=1, argv=0x7fff8fac21a8) at main.c:465

Changed 10 years ago by ycombinator

save file

comment:2 Changed 10 years ago by magnate

  • Keywords recall added
  • Milestone changed from Triage to 3.2.0
  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.