Skip to main content

Questions tagged [ltrace]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
746 views

Timing system call with ltrace: Adding `syscall` + `clock_gettime`?

I'm looking for some clarity in terms of the system calls. I tried avoiding the vDSO by calling a system call clock_gettime directly. Here is a snippet of a program named sys_clock_gettime. int clock =...
Xavier Merino's user avatar
4 votes
0 answers
252 views

Is there any solution to ltrace calls made by libs opened using dlopen()?

I wrote different two different types of queues. Bundled them in different .sos. I have a driver main.c which tests functions offered by those queues. main.c makes use dlfcn.h to load, unload required ...
Vishwajith.K's user avatar
0 votes
1 answer
1k views

Why ltrace doesn't show a call to glibc __nss_configure_lookup()

I'm trying to understand how ltrace command works. So I've been poking around in /etc/nsswitch.conf. I have a "hosts: resolve" line in there - it tells glibc to dynamically load nss-resolve ...
blaz's user avatar
  • 11
2 votes
1 answer
1k views

Are there any alternatives to ltrace that does the same job?

ltrace doesn't work on binaries linked with the -z now option—Check this question—which is the default on my Ubuntu 19.10 system. It only works on binaries linked with -z lazy. Is there any ...
SkullTech's user avatar
  • 181
3 votes
1 answer
1k views

Why do strace and ltrace cause EINTR to happen?

Consider this program: #include <stdio.h> #include <sys/epoll.h> int main(void) { int epfd = epoll_create1(0); struct epoll_event event; event.events = EPOLLIN; ...
Joseph Sible-Reinstate Monica's user avatar
1 vote
0 answers
350 views

Systemtap causes a segfault, why?

I'm trying to monitor library calls system-wide. I've written this script to trace library calls for libguestfs: probe begin { printf("ok\n") } probe process("/usr/lib64/libguestfs.so.0....
MoeKav's user avatar
  • 31
0 votes
1 answer
558 views

How to continuously check ltrace command output in C program [closed]

I'm trying to capture output of ltrace command using C program. I have tried using popen() but that's not working, I need to capture continuously output not only once. Below is my code: #include &...
Yougeshwar Khatri's user avatar
1 vote
2 answers
1k views

vfork() calls SYS_vfork but fork() calls SYS_clone?

After running ltrace -S on two programs that were compiled by gcc (version 5.4.0), one that calls vfork() and one that calls fork(), I find that vfork() calls SYS_vfork whilst fork() calls SYS_clone.  ...
user2108462's user avatar
3 votes
1 answer
1k views

System-wide monitoring of calls to a library function

I have a modern Linux desktop with lots of processes running concurrently. One of those processes, and I don't know which one, calls a function some_func from a popular dynamic library some_lib (think ...
undercat's user avatar
  • 1,857
3 votes
1 answer
445 views

Can getauxval be used to determine whether or not you're being traced?

Coming off of this question, I patched my kernel in a quest to get SQL Server 2017 on Linux to start up. Now I'm getting further but I'm being shut down, strstr("TracerPid:\t0\n", "TracerPid:") ...
Evan Carroll's user avatar
  • 32.3k
5 votes
2 answers
3k views

How do I hide TracerPID from a process?

I'm conjecturing SQL Server on Linux is checking /proc/self/status for TracerPID and then dying if it's not 0. I want to test that. Playing around, here is the strace, ... lots of stuff openat(...
Evan Carroll's user avatar
  • 32.3k
2 votes
1 answer
2k views

why does ltrace produce no output

For several days I have left this command running in a terminal emulator ltrace -p `pgrep xfwm4` while using the system normally, and I'm yet to see any output from ltrace. Note: xfwm4 is Xfce's ...
Ernest A's user avatar
  • 1,883
2 votes
0 answers
1k views

How to trace at runtime the symbols of loaded shared library?

I want to be able to know what are the symbols that are used from a certain shared library at runtime. I use gdb and I set the solib-search-path to the user defined shared library. I am not sure if ...
Bionix1441's user avatar
6 votes
1 answer
1k views

ltracing shared libraries, how?

I would like to trace the function calls to a particular library, call it libfoo. Unfortunately the documentation I have found on it is sparse, so I have a lot of questions. In the documentation of ...
Mouse.The.Lucky.Dog's user avatar
9 votes
2 answers
4k views

How to determine what instructions a process is executing?

I know about strace and ltrace, but that only tells me what system calls and library calls a process is executing, respectively. I would like to know exactly what instructions a process is executing. ...
cat pants's user avatar
  • 195
2 votes
0 answers
2k views

How to trace calls to library from library?

I have an program that calls libcurl, and libcurl calls libgssapi_krb5. If I want to debug calls to libcurl, then ltrace works. But now I want to debug calls to libgssapi_krb5, then ltrace ...
Magicloud's user avatar
  • 763
10 votes
2 answers
9k views

Which file in kernel specifies fork(), vfork()... to use sys_clone() system call

When ltrace is used for tracing the system calls, I could see that fork() uses sys_clone() rather than sys_fork(). But I couldn't find the linux source where it is defined. My program is: #include<...
user3539's user avatar
  • 4,408