CSAPP Attack Lab Phase1 Ubuntu22.04 上的分段故障

问题描述 投票:0回答:1

我是一名初学者,最近在 Ubuntu22.04 上进行 CSAPP 攻击实验室工作。 我下载文件并在终端中运行 ctarget,

./ctarget

通常,CTARGET 期望接收标准输入作为代码注入,注入太多字符会导致分段错误。 然而,没有输入任何内容,程序就会突然终止:

Ouch!: You caused a segmentation fault!
Better luck next time
FAILED

我尝试使用GDB来检查出了什么问题,当它终止时我检查了堆栈帧:

(gdb) bt
#0  0x00007ffff7c750d0 in __vfprintf_internal (
    s=0x7ffff7e1a780 <_IO_2_1_stdout_>, 
    format=format@entry=0x4044bc "Type string:", ap=ap@entry=0x556311b8, 
    mode_flags=mode_flags@entry=0)
    at ./stdio-common/vfprintf-internal.c:1244
#1  0x00007ffff7c6079f in __printf (
    format=format@entry=0x4044bc "Type string:")
    at ./stdio-common/printf.c:33
#2  0x00000000004022c3 in launch (offset=<optimized out>)
    at support.c:293
#3  0x000000000040233d in stable_launch (offset=<optimized out>)
    at support.c:340

但是我已经无能为力了.o(╥﹏╥)o ubuntu系统可以吗?如果我切换到其他 Linux 发行版,它会起作用吗?

非常感谢您回答我的问题。

ubuntu segmentation-fault
1个回答
0
投票

我回来了!虽然没有人回答我。:) 我尝试过Ubuntu20.04、21.03、21.10、22.04,但都不起作用。 最后尝试了Fedora 39,运行正常! 不知道是不是Ubuntu系统的一个功能。 就发在这里供参考吧。

© www.soinside.com 2019 - 2024. All rights reserved.