ltrace | This directory contains sources of ltrace | Code Inspection library

 by   dkogan C Version: 0.7.3checkpoint1 License: GPL-2.0

kandi X-RAY | ltrace Summary

kandi X-RAY | ltrace Summary

ltrace is a C library typically used in Code Quality, Code Inspection applications. ltrace has no bugs, it has a Strong Copyleft License and it has low support. However ltrace has 1 vulnerabilities. You can download it from GitHub.

This directory contains sources of ltrace. See the file configure.ac to see what version this is. Ltrace is a debugging program which runs a specified command until the command exits. While the command is executing, ltrace intercepts and records both the dynamic library calls called by the executed process and the signals received by the executed process. Ltrace can also intercept and print system calls executed by the process. For general building and installation instructions, see the file INSTALL. For list of authors and contributors, see the file CREDITS. ltrace is free software. See the file COPYING for license. Some documentation on ltrace usage is given in the manual page, which is in the file ltrace.1.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              ltrace has a low active ecosystem.
              It has 38 star(s) with 16 fork(s). There are 7 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 8 open issues and 1 have been closed. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of ltrace is 0.7.3checkpoint1

            kandi-Quality Quality

              ltrace has no bugs reported.

            kandi-Security Security

              ltrace has 1 vulnerability issues reported (0 critical, 1 high, 0 medium, 0 low).

            kandi-License License

              ltrace is licensed under the GPL-2.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              ltrace releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ltrace
            Get all kandi verified functions for this library.

            ltrace Key Features

            No Key Features are available at this moment for ltrace.

            ltrace Examples and Code Snippets

            No Code Snippets are available at this moment for ltrace.

            Community Discussions

            QUESTION

            system("/bin/sh") closes immediately when input given through pipe
            Asked 2021-May-07 at 16:16

            I wrote a c program as below:

            ...

            ANSWER

            Answered 2021-May-07 at 16:16

            sh will read the stdin till it is encountering the EOF. In the first case you do not send EOF (which can be done by pressing Ctrl-D depending on your environment). In the second case the EOF is happening after the piped input is exhausted (that is after the echo 123 is done). To understand better you can simulate the sh behavior with a simple program:

            Source https://stackoverflow.com/questions/67438144

            QUESTION

            Meaning of read and syscall with arguments
            Asked 2021-Mar-03 at 20:02

            I'm playing with strace and ltrace tools to get information about a program which contains a prompt for a user entry.

            With strace, after the read from the prompt is called, there is an openat of a specific file in readOnly:

            ...

            ANSWER

            Answered 2021-Mar-03 at 20:02

            No. "22d72c" are the 6 characters that read read from your file... just check the beginning of file.

            Indeed if you read from STDIN_FILENO using read (or for example use fgets; strace will output

            Source https://stackoverflow.com/questions/66462933

            QUESTION

            typcast does not cast the whole string to int (in C)
            Asked 2021-Jan-05 at 20:30

            I have a problem. Typecast works not like I want. So I have a variable called sz of type char array. This array contains 0x421. But I want this as an integrer, not as a string. So I tried typecasting like that:

            ...

            ANSWER

            Answered 2021-Jan-05 at 20:30

            *sz is the same as sz[0], i.e. the first character of the string. In your case the first character has the numeric value 33 (aka hex 0x21). In other words, your code prints 33.

            If you want to convert the first sizeof(int) characters to an integer, you should use bit shifting instead.

            If sizeof(int) is 4 and you want little endian conversion, it would be something like:

            Source https://stackoverflow.com/questions/65585725

            QUESTION

            Is there a way to find all the functions used in a c program?
            Asked 2020-Nov-27 at 12:24

            I have the source code for a huge (exaggerated) c program with multiple files. I was hoping if there was any way to find all the functions (both standard and builtin) used (both declared and called) in the program. I know I can compile it and track the function and system calls using tools like ltrace and strace, by redirecting the output to a file first and then using grep to select the function calls. Or I can use regex on shell on all the files, but I don't know regex (yet). So does any one know a tool that could help me to quickly find all the functions called and declared in a c program?

            ...

            ANSWER

            Answered 2020-Nov-27 at 12:24

            Check if this helps, comments in code:

            Source https://stackoverflow.com/questions/65023948

            QUESTION

            Is it dangerous, that ___tls_get_addr called in 32bit environment?
            Asked 2020-Sep-24 at 08:12

            We have x86_64 system, but all libraries and applications are built for i386 and we run them in i386 mode. gdb (and ltrace too) tell us, that ___tls_get_addr is used, that was designed for x86_64 as far, as I can see (___tls_get_addr gnu) and also we have glibc version 2.19-18 (looks like issue was fixed only in glibc-2.24). Is it dangerous, that ___tls_get_addr is called from applications running in i386 mode? How can we fix that problem, if it's a problem? Thanks in advance.

            ...

            ANSWER

            Answered 2020-Sep-24 at 08:12

            The GCC bug in __tls_get_addr stack alignment you reference is specific to x86-64. It does not exist on i386. I'll assume you swapped i386 and x86-64 in your question.

            In general, the distribution toolchains are consistent and well-tested. If you compile your programs with the system compiler and use the system glibc version, __tls_get_addr will work as expected, even if the GCC bug has not been fixed. The bug only materializes if buggy programs are run with a malloc that happens to use vector instructions. With glibc's malloc, this only happens with GCC 7 or later. Once Fedora started to use GCC 7 as the system compiler, the incomplete workaround for the GCC bug in glibc was discovered, and a more complete workaround was implemented upstream (and integrated into Fedora). Before the GCC 7 switch, the buggy applications were running just fine.

            Some distributions have backported the fix because they support multiple compilers and malloc implementations. In the end, this is a distribution integration issue, so if you have doubts, you need to talk to your distribution support.

            ___tls_get_addr (three underscores) is merely an internal implementation detail. It was visible to some debugging tools in glibc 2.20 and earlier because it was not a hidden symbol. In glibc 2.21 and later, it was made hidden (on i386), and ltrace and similar tools will no longer report it. This is merely a minor performance optimization, it does not affect functionality.

            Source https://stackoverflow.com/questions/64035199

            QUESTION

            Profiling C++ OpenCV functions being called from Python code
            Asked 2020-May-20 at 19:26

            I am using OpenCV 4.0.0 to do image processing using the Python bindings in the cv2 module. I have used the cProfile library, which tells me that (obviously) the OpenCV functions I call directly are taking up the most time, but cannot see deeper because they are calling C++ functions from a compiled library. I would like to profile the OpenCV code to determine which functions are taking up the majority of the execution time.

            I have tried the built in OpenCV profiling described here, but I get a warning

            ...

            ANSWER

            Answered 2019-Apr-08 at 15:22

            I have had success with the perf tool, which lets me know which functions are taking the most time. On my Pynq board specifically, the executable is found in /usr/lib/linux-tools-4.15.0-20 which is not by default in PATH. I also used FlameGraph for excellent visualization of the call graph.

            Source https://stackoverflow.com/questions/55448110

            QUESTION

            Alternative to ltrace that works on binaries linked with `-z now`?
            Asked 2020-May-05 at 17:04

            ltrace doesn't work on binaries linked with the -z now option, which is the default on my Ubuntu 19.10 system. It only works on binaries linked with -z lazy.

            Is there any alternative to ltrace that does the same job, but works on now binaries also?

            ...

            ANSWER

            Answered 2020-May-05 at 17:04

            You can use uftrace utility written by Namhyung Kim. It's available as a package in Ubuntu although I built the code from master branch manually to make sure I use the newest vanilla version. Example main.c:

            Source https://stackoverflow.com/questions/61394462

            QUESTION

            No output when running ltrace
            Asked 2020-Apr-29 at 15:38

            As the title says, ltrace does not work properly on my system. It shows no output in most cases, like

            ...

            ANSWER

            Answered 2020-Apr-29 at 15:38

            This may have to do with binaries being compiled with -z now. I created a quick test program (I'm using Ubuntu 16.04):

            Source https://stackoverflow.com/questions/43213505

            QUESTION

            segmentation fault on default array initialization
            Asked 2020-Apr-23 at 22:16

            There's default limit of stack size in Linux, the segmentation fault occurs if it's exceeded.

            Why does the segmentation fault not show up on the first one but do on the second one with nothing but one line of default array initialization below? All are compiled by g++ -O0.

            To be clear, no heap allocation is observed on the second one by ltrace, and the segmentation fault occurs as expected in case of the assignment operation on the third one.

            1)

            ...

            ANSWER

            Answered 2020-Apr-23 at 22:15

            Even w/o optimization, g++ warns unused variable arr on the first one with option -Wunused-variable, and objdump shows nothing continues with the initialization after the stack space is allocated for the array.

            However, the second one receives no warning even it has that line of logically dead code. Not only is the stack space allocated for the array, but also the implicit initialization on the items takes place, thus finally causes the segmentation fault at runtime.

            The operation = on the third one tries to assign the array size to another storage place beyond the stack limit, thus certainly causes the segmentation fault as well.

            According to the reference:

            Implicit initialization

            If an initializer is not provided:

            objects with automatic storage duration are initialized to indeterminate values (which may be trap representations).

            objects with static and thread-local storage duration are initialized as follows:

            pointers are initialized to null pointer values of their types.

            objects of integral types are initialized to unsigned zero.

            objects of floating types are initialized to positive zero.

            members of arrays, structs, and unions are initialized as described above, recursively, plus all padding bits are initialized to zero.

            It seems that the first one belongs to objects with automatic storage duration and the second one to objects with thread-local storage duration in view of g++.

            Source https://stackoverflow.com/questions/61390038

            QUESTION

            default allocated heap size for a Linux process
            Asked 2020-Apr-19 at 20:48

            What is the default allocated heap size during a process startup in Linux? It's not about ulimit but because of noticing this question.

            I also did the following test via g++ -O0 -Wall -std=c++11 and strace, no syscalls for the change of heap allocation on new, delete the tested object were revealed.

            ...

            ANSWER

            Answered 2020-Apr-19 at 18:10

            There is no default heap size. The heap is always dynamic and starts at zero. The system calls used are mmap, brk and sbrk.

            Most dynamic linked programs use heap in the program loader. They also use it when setting up output buffers for std::cout, FILE *stdout, etc. This is what you see as the "initial heap."

            If you built a program without using the C runtime support libraries you would not see any heap usage.

            Source https://stackoverflow.com/questions/61307351

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install ltrace

            You can download it from GitHub.

            Support

            The following targets are currently (at least somewhat) supported. Some of them may be more or less broken in reality, it is not feasible to test each release comprehensively on each target.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/dkogan/ltrace.git

          • CLI

            gh repo clone dkogan/ltrace

          • sshUrl

            git@github.com:dkogan/ltrace.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Code Inspection Libraries

            Try Top Libraries by dkogan

            feedgnuplot

            by dkoganPerl

            gnuplotlib

            by dkoganPython

            mrcal

            by dkoganPython

            vnlog

            by dkoganPerl

            numpysane

            by dkoganPython