Writing Elbereth's name and walking around it segfaults the game
@liam-middlebrook 已经在做这个了。
开始于 2017年11月19日。
评估
这个 Issue 还没有评估数据。
描述
This is a bug that exists in both bingehack4 and our upstream nethack4. It appears to be due to a flaw in the pline/vpline code.
Bingehack4 commit: 85dbdba39459cb83fc0010010daed47a86718c2b
Nethack4 commit: cb7da80ab47cfe158b0a32b7e47f36b2ab6c529b
It can be reproduced with the following steps:
- Create a new (or load an existing game)
- Write Elbereth's name 50 times
50^e - Move to an adjacent space
- Write Elbereth's name 50 times
50^e - Move back and forth between the two spaces (I usually experience a segfault around the 7th move)
The stacktrace of the segfault itself isn't particularly interesting. It just occurs when histevents[0] is out of range. However the stacktrace of where histcount is changed to an unrealistic value is fairly interesting. Here's the stacktrace of that situation where histcount changed from 54 to 1164473445 (in the original game that I found this issue during).
#0 0x00007f414c171b3e in __strcpy_ssse3 () from /usr/lib/libc.so.6
#1 0x00007f414e5b83d2 in vpline (nonblocking=nonblocking@entry=0 '\000', norepeat=norepeat@entry=0 '\000',
line=0x562f4a103c90 "You read: \"Elbe? ??E||er? nF||cretnEl|? et?Llbcre?nE|b rethv|be?eth_lberethEl e?ct\\ElUerc+h|l erc?h|l|?reth4|berethL?? rcth?l|e?e??Elbere?h||bc?e?hElberTth[|ber?thElbereth l|e(e?nEl crcthE|b?rethFlb7r"..., line@entry=0x7f414e6b63bd "You %s: \"%s\".", the_args=the_args@entry=0x7ffea3a8e8e0) at /home/loothelion/repos/bingehack4/libnethack/src/pline.c:99
#2 0x00007f414e5b84d0 in pline (line=line@entry=0x7f414e6b63bd "You %s: \"%s\".") at /home/loothelion/repos/bingehack4/libnethack/src/pline.c:33
#3 0x00007f414e5ee15a in read_engr_at (x=37, y=13) at /home/loothelion/repos/bingehack4/libnethack/src/engrave.c:376
#4 0x00007f414e56bbb5 in look_here (obj_cnt=8, picked_some=<optimized out>, show_weight=show_weight@entry=0 '\000', feeling=0 '\000') at /home/loothelion/repos/bingehack4/libnethack/src/invent.c:2004
#5 0x00007f414e5a7396 in check_here (picked_some=<optimized out>) at /home/loothelion/repos/bingehack4/libnethack/src/pickup.c:71
#6 0x00007f414e5aa35d in pickup (what=what@entry=1, uim=<optimized out>) at /home/loothelion/repos/bingehack4/libnethack/src/pickup.c:292
#7 0x00007f414e578bbe in spoteffects (pick=<optimized out>, pick@entry=1 '\001') at /home/loothelion/repos/bingehack4/libnethack/src/hack.c:2349
#8 0x00007f414e57ce7f in domove (arg=<optimized out>, uim=<optimized out>, thismove=<optimized out>) at /home/loothelion/repos/bingehack4/libnethack/src/hack.c:2241
#9 0x00007f414e54c555 in do_command (command=<optimized out>, command@entry=79, arg=arg@entry=0x7ffea3a8ed18) at /home/loothelion/repos/bingehack4/libnethack/src/cmd.c:1663
#10 0x00007f414e5425bb in command_input (cmdidx=cmdidx@entry=79, arg=arg@entry=0x7ffea3a8ed18) at /home/loothelion/repos/bingehack4/libnethack/src/allmain.c:1402
#11 0x00007f414e546b46 in nh_play_game (fd=fd@entry=6, followmode=<optimized out>, followmode@entry=FM_PLAY) at /home/loothelion/repos/bingehack4/libnethack/src/allmain.c:660
#12 0x00007f414d31317d in nhnet_play_game (gid=6, followmode=FM_PLAY) at /home/loothelion/repos/bingehack4/libnethack_client/src/clientapi.c:158
#13 0x0000562f47ffc52c in playgame (fd_or_gameno=6, followmode=<optimized out>) at /home/loothelion/repos/bingehack4/nethack/src/rungame.c:758
#14 0x0000562f47ffcfb4 in loadgame () at /home/loothelion/repos/bingehack4/nethack/src/rungame.c:732
#15 0x0000562f47fec92a in mainmenu () at /home/loothelion/repos/bingehack4/nethack/src/main.c:303
#16 main (argc=<optimized out>, argv=<optimized out>) at /home/loothelion/repos/bingehack4/nethack/src/main.c:367
- 主要语言
- C
- 星标
- 17
- 派生
- 8
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ComputerScienceHouse/bingehack4 的其他 Issue
-
Create Bingehack4 Docker Container for CI Build可能重新可做 @liam-middlebrook 于 3233 天前认领,目前没有进行中的 PR。 未关闭enhancement wishlist
ComputerScienceHouse/bingehack4#76 · 已指派 1 人 ·
-
Rework Event System可能重新可做 @liam-middlebrook 于 3386 天前认领,目前没有进行中的 PR。 未关闭bug enhancement wishlist
ComputerScienceHouse/bingehack4#70 · 1 条评论 · 已指派 1 人 ·
-
Create Missing Tiles可能重新可做 @liam-middlebrook 于 3551 天前认领,目前没有进行中的 PR。 未关闭
ComputerScienceHouse/bingehack4#67 · 已指派 1 人 ·
-
enhancement
难度 5/5 一周以上 新手友好度 30/100
ComputerScienceHouse/bingehack4#60 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
ComputerScienceHouse/bingehack4#56 · 1 条评论 ·
查看 ComputerScienceHouse/bingehack4 的全部 Issue
相似的 Issue
-
severity: low
难度 2/5 1-3 小时 新手友好度 70/100
luainkernel/lunatik#1853 ·
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 5 天内回复
-
constants.h: M_PI / M_PI_2 fallbacks cause -Wambiguous-macro when H3 is compiled as a Clang module未关闭
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
area:backend bug launch:p2 scope:core
难度 2/5 1-3 小时 新手友好度 62/100
Chelis-Lang/chelis#3494 ·
维护者通常 1 天内回复