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.

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
  • 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. – Mark Plotnick Oct 29 '18 at 22:48
  • @MarkPlotnick thanks for your UNIX-fu. – Ciro Santilli OurBigBook.com Oct 30 '18 at 09:01

1 Answers1

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.

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985