NickMcConnell / NarSil

Unofficial rewrite of Sil 1.3.0
13 stars 2 forks source link

Signal 11 exit/panic on forge use #728

Open x123 opened 1 month ago

x123 commented 1 month ago

When reviewing the nixpkgs PR https://github.com/NixOS/nixpkgs/pull/349999 to update from 1.3.0-234-g228c4f0cb -> 1.3.0-353-g7a242f456 I noticed during playtesting that the use of a forge would reliably crash/panic narsil. Not sure of a way to reliably bisect without having to play through at each step to get to a forge.

Steps to reproduce:

  1. Go to a forge
  2. Select base item type
  3. Hit any other key (to pick what to craft)

The game immediatly crashes with:

narsil: Exiting on signal 11!

System info:

 - system: `"x86_64-linux"`
 - host os: `Linux 6.11.4, NixOS, 24.11 (Vicuna), 24.11.20241018.4c2fcb0`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.24.9`
 - channels(root): `"home-manager-23.05.tar.gz, nixos, sops-nix"`
 - channels(x): `""`
 - nixpkgs: `/nix/store/riqkpszjqk02bi1wppfg8ip5xvh102qd-source`
NickMcConnell commented 1 month ago

The trick here is that 1.3.0-353-g7a242f456 is from an experimental branch named id with new changes to ID which is going to form the bases of version 1.4. I have pushed it as a branch and had it build so that other people can test it - which you seem to have done accidentally 😁 - thank you, this is helpful feedback for the new branch. For your purposes though, the latest on the main branch is 1.3.0-350-ga51756908. I don't think there's an obvious way to tell the branches apart from the release title - you need to actually go and compare the commit against the main and id branches.

x123 commented 1 month ago

I've submitted a PR in nixpkgs to correct the automatic update tooling to only hit the latest commit on main, rather than the latest commit on any branch.

Thanks for the detailed feedback and all the hard work on narsil. I have been enjoying it immensely, despite never having beaten a run.

NickMcConnell commented 1 month ago

Thank you! I wasn't even sure anyone was playing it, please feel free to submit any other bugs/requests.

NickMcConnell commented 3 weeks ago

This looks likely to be because known objects aren't handled correctly (or at all?) in smithing

NickMcConnell commented 3 weeks ago

Should be fixed in 491a3ed5f

backwardsEric commented 2 weeks ago

Working through the tutorial (compiled on macOS with 'make -f Makefile.osx OPT="-O0 -g -DUSE_STATS -fsanitize=address -fsanitize=undefined"), creating the base item at the forge for the requested boots of speed works, but there is NULL pointer access when trying to add the speed enchantment. The top of the call stack at the point of the crash is:

  1. include_pval(obj=0x0000000100c8d060) at ui-smith.c:124
  2. special_display(menu=0x00007ff7bfefc660, oid=0, cursor=true, row=2, col=19, width=43) at ui-smith.c:612
  3. display_menu_row(menu=0x00007ff7bfefc660, pos=0, top=0, cursor=true, row=2, col=19, width=43) at ui-menu.c:595
  4. display_scrolling(menu=0x00007ff7bfefc660, cursor=0, top=0x00007ff7bfefc6f4, loc=0x00007ff7bfefc6f8) at ui-menu.c:213
  5. menu_refresh(menu=0x00007ff7bfefc660, reset_screen=false) at ui-menu.c:626
  6. menu_select(menu=0x00007ff7bfefc660, notify=208, popup=false) at ui-menu.c:790
  7. special_menu(name="Enchant", row=1) at ui-smith.c:660
  8. menu_action_handle(m=0x000060f00050cf20, event=0x00007ff7bfefcc40, oid=1) at ui-menu.c:110
  9. menu_handle_action(m=0x000060f00050cf20, in=0x00007ff7bfefcc40) at ui-menu.c:688
  10. menu_select(menu=0x000060f00050cf20, notify=209, popup=false) at ui-menu.c:828
  11. textui_smith_object(cost=0x00007ff7bfefd240) at ui-smith.c:1485
  12. smith_object(cost=0x00007ff7bfefd240) at game-input.c:257
  13. do_cmd_smith_aux(flush=false) at obj-smith.c:1451
  14. do_cmd_smith(cmd=0x0000000100c64ae0) at obj-smith.c:1502
  15. process_command(ctx=CTX_GAME, cmd=0x0000000100c64ae0) at cmd-core.c:347
  16. narsil`cmdq_pop(c=CTX_GAME) at cmd-core.c:379
  17. process_player at game-world.c:892
  18. run_game_loop at game-world.c:996
  19. play_game(mode=GAME_TUTORIAL) at ui-game.c:932

At line 124 of ui-smith.c, i is 0 and obj->known is NULL.