2

I was using ltrace -S to see what system calls dlopen was making but then I noticed that SYS_mmap was limited to only 4 arguments:

SYS_mmap(0x7f1c325fe000, 8192, 3, 2066)

while it takes a total of 6 arguments. In particular, the file descriptor, which is the sixth argument is not shown, which is crucial for my analysis.

Is there a way to make ltrace show all my arguments?

Tested in ltrace 0.7.3, Ubuntu 16.04.

2
  • 2
    The line for mmap is commented out in /etc/ltrace.conf in version 0.7.3. ;addr SYS_mmap(addr,ulong,int,int,int,long). I don't know why. Maybe because the system call on Linux differs slightly from the glibc wrapper. If you want, copy ltrace.conf to another file, remove the ;, and give ltrace the -F /path/to/new/ltrace.conf option. Commented Oct 29, 2018 at 22:48
  • @MarkPlotnick thanks for your UNIX-fu. Commented Oct 30, 2018 at 9:01

1 Answer 1

0

As mentioned by Mark Plotnick:

sed 's/;addr SYS_mmap/addr SYS_mmap'/ /etc/ltrace.conf > ltrace.conf
ltrace -S -F ltrace.conf ./dlopen.out

and now the mmaps look just right:

SYS_mmap(0, 285983, 1, 2, 3, 0) = 0x7f7db3ea6000

Tested on Ubuntu 18.04, ltrace 0.7.3.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.