strace中的set_thread_area
在程序上使用 strace:除了 set_thread_area 之外,strace 在 Debian 和 CentOS 中输出相同的提取输出。 (该程序的版本在两个 Linux 上完全相同。)
为什么它们不同?有什么办法可以让两个 Linux 上的输出相同吗?这种差异可以用 C 编程吗? Debian/CentOS 中是否缺少某些软件包?
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7fb16c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0 open("/dev/urandom", O_RDONLY) = 3 read(3, "\242\177)", 3) = 3
set_thread_area(0xff9db33c) = 0
编辑
第一:CentOS i686
第二:Debian x64 但使用 -m32 编译
Using strace on a program: strace outputs the same extract output in Debian and CentOS except for set_thread_area. (The program's version is exactly the same on both Linuxes.)
Why are they different ? Is there any way so that the output is the same on both Linuxes ? Can this difference be programmed in C ? Is some package missing in Debian/CentOS ?
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7fb16c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0 open("/dev/urandom", O_RDONLY) = 3 read(3, "\242\177)", 3) = 3
set_thread_area(0xff9db33c) = 0
EDIT
First: CentOS i686
Second: Debian x64 but compiled with -m32
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否询问地址不同的原因,或者为什么
strace
输出格式不同?如果是后者,我怀疑您只是在处理两个不同版本的strace
,其中一个可能已经过时了。然而,这看起来也很奇怪:地址
0xff9db33c
绝对不是 i386 上的有效用户空间地址。您的系统之一可能是 x86_64 吗?这也可以解释不同的格式,因为 i386 上的 set_thread_area 需要一个指向 struct ldt_desc 的指针,而在 x86_64 上它只需要实际的指针值加载到线程寄存器中。Are you asking about the reason the addresses are different, or why
strace
formats the output differently? If it's the latter, I suspect you're just dealing with two different versions ofstrace
, one possibly outdated. However, something also looks odd about this:The address
0xff9db33c
is definitely not a valid userspace address on i386. Is it possible one of your systems is x86_64? That would also explain the different format, sinceset_thread_area
on i386 takes a pointer to astruct ldt_desc
, while on x86_64 it just takes the actual pointer value to load into the thread register.