set_thread_area in strace
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, se开发者_如何学JAVAg_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 -m32Are 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 of strace
, one possibly outdated. However, something also looks odd about this:
set_thread_area(0xff9db33c) = 0
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, since set_thread_area
on i386 takes a pointer to a struct ldt_desc
, while on x86_64 it just takes the actual pointer value to load into the thread register.
精彩评论