1

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

2
  • compare strace versions.
    – osgx
    Apr 29, 2011 at 15:09
  • and provide more details on the 2 systems, like cpu type.. Apr 29, 2011 at 15:19

1 Answer 1

1

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 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.

2
  • I am asking about the output format. Why does CentOS have urandom and Debian does not ? Apr 29, 2011 at 17:51
  • Um, urandom is not part of set_thread_area. It's a separate thing. At what point in the trace does it appear? I suspect it's setting up a random canary for stack-smashing protection. Apr 29, 2011 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.