Debian Bug report logs - #553189
mprotect library call shows 5 arguments instead of 3

version graph

Package: ltrace; Maintainer for ltrace is Juan Cespedes <cespedes@debian.org>; Source for ltrace is src:ltrace (PTS, buildd, popcon).

Reported by: ayourtch@cisco.com

Date: Thu, 29 Oct 2009 13:57:06 UTC

Severity: minor

Found in version 0.5.1-2ubuntu1

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Juan Cespedes <cespedes@debian.org>:
Bug#553189; Package ltrace. (Thu, 29 Oct 2009 13:57:11 GMT) (full text, mbox, link).


Acknowledgement sent to ayourtch@cisco.com:
New Bug report received and forwarded. Copy sent to Juan Cespedes <cespedes@debian.org>. (Thu, 29 Oct 2009 13:57:12 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Andrew Yourtchenko <ayourtch@cisco.com>
To: submit@bugs.debian.org
Subject: mprotect library call shows 5 arguments instead of 3
Date: Thu, 29 Oct 2009 13:55:46 +0100 (CET)
Package: ltrace
Version: 0.5.1-2ubuntu1
Severity: minor

I also tested this on 0.5.2. Dummy testcase file foo.c:

#include <sys/mman.h>
int main (int argc, char *argv[])
{
 mprotect ((void*)0xdeadbeef, 4096, PROT_NONE);
 return 0;
}

Running it under ltrace gives:

$ ltrace ./foo
__libc_start_main(0x80483c4, 1, 0xbfa33894, 0x8048410, 0x8048400 <unfinished ...>
mprotect(0xdeadbeef, 4096, 0, 0x8048429, 0xb7f25870) = -1
+++ exited (status 0) +++
$

Based on my analysis, the behaviour is "technically" correct, because 
only the syscall's signature is in the config:

$ grep mprotect /etc/ltrace.conf
int   SYS_mprotect(addr,int,int);
$

And by default the number of arguments that ltrace prints for the 
functions without the signatures is 5.

Indeed "ltrace -S ./foo" prints the syscall itself correctly:

[lots of other syscalls]
__libc_start_main(0x80483c4, 1, 0xbfb799d4, 0x8048410, 0x8048400 
<unfinished ...>
mprotect(0xdeadbeef, 4096, 0, 0x8048429, 0xb7f6d870 <unfinished ...>
SYS_mprotect(0xdeadbeef, 4096, 0)                = -22
<... mprotect resumed> )                         = -1
SYS_exit_group(0 <no return ...>
+++ exited (status 0) +++

Adding the type signature into the config file for the mprotect same as 
SYS_mprotect corrects the output. I suggest this addition is made in the 
/etc/ltrace.conf






Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Jul 2 04:11:04 2023; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.