glibc | Unofficial mirror of sourceware glibc repository Updated daily

 by   bminor C Version: glibc-2.37.9000 License: Non-SPDX

kandi X-RAY | glibc Summary

kandi X-RAY | glibc Summary

glibc is a C library typically used in Ubuntu, Debian applications. glibc has no bugs and it has medium support. However glibc has 19 vulnerabilities and it has a Non-SPDX License. You can download it from GitHub, GitLab.

This directory contains the sources of the GNU C Library. See the file "version.h" for what release version you have. The GNU C Library is the standard system C library for all GNU systems, and is an important part of what makes up a GNU system. It provides the system API for all programs written in C and C-compatible languages such as C++ and Objective C; the runtime facilities of other programming languages use the C library to access the underlying operating system. In GNU/Linux systems, the C library works with the Linux kernel to implement the operating system behavior seen by user applications. In GNU/Hurd systems, it works with a microkernel and Hurd servers. The GNU C Library implements much of the POSIX.1 functionality in the GNU/Hurd system, using configurations i[4567]86-*-gnu. When working with Linux kernels, this version of the GNU C Library requires Linux kernel version 3.2 or later. Also note that the shared version of the libgcc_s library must be installed for the pthread library to work correctly.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              glibc has a medium active ecosystem.
              It has 929 star(s) with 305 fork(s). There are 38 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              glibc has no issues reported. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of glibc is glibc-2.37.9000

            kandi-Quality Quality

              glibc has 0 bugs and 0 code smells.

            kandi-Security Security

              OutlinedDot
              glibc has 19 vulnerability issues reported (2 critical, 5 high, 12 medium, 0 low).
              glibc code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              glibc has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              glibc 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.
              It has 12055 lines of code, 491 functions and 198 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            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 glibc
            Get all kandi verified functions for this library.

            glibc Key Features

            No Key Features are available at this moment for glibc.

            glibc Examples and Code Snippets

            No Code Snippets are available at this moment for glibc.

            Community Discussions

            QUESTION

            How puts standard library function works in C?
            Asked 2022-Mar-27 at 06:02

            While going through the standard library functions of C (glibc), I found that printf() actually calls puts() functions (_IO_puts). But I am unable to find out how the puts function actually writes to the stdout ?

            Does it uses write() system call defined in unistd.h or something else ? One thing I find out that puts() actually calling _IO_xputn through _IO_putn.

            Please help. Thank you.

            ...

            ANSWER

            Answered 2022-Mar-27 at 06:02

            For Unix based systems for which Linux is part, most functions in stdio library are wrappers that are one layer above the standard I/O system calls. You see, the operating system provides a set of APIs called system calls. Applications cannot directly access hardware resources and hence they usually call these "system calls" whenever they need to do any sort of privileged thing like writing to the screen or reading from the keyboard.

            In Unix, everything is abstracted as a file so whenever you need to write characters to a screen, all you need to do is open some file that represents the "screen" and write those characters there. The kernel will take care of the rest. Quite simply, this is how you'd do this in C:

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

            QUESTION

            Using RNN Trained Model without pytorch installed
            Asked 2022-Feb-28 at 20:17

            I have trained an RNN model with pytorch. I need to use the model for prediction in an environment where I'm unable to install pytorch because of some strange dependency issue with glibc. However, I can install numpy and scipy and other libraries. So, I want to use the trained model, with the network definition, without pytorch.

            I have the weights of the model as I save the model with its state dict and weights in the standard way, but I can also save it using just json/pickle files or similar.

            I also have the network definition, which depends on pytorch in a number of ways. This is my RNN network definition.

            ...

            ANSWER

            Answered 2022-Feb-17 at 10:47

            You should try to export the model using torch.onnx. The page gives you an example that you can start with.

            An alternative is to use TorchScript, but that requires torch libraries.

            Both of these can be run without python. You can load torchscript in a C++ application https://pytorch.org/tutorials/advanced/cpp_export.html

            ONNX is much more portable and you can use in languages such as C#, Java, or Javascript https://onnxruntime.ai/ (even on the browser)

            A running example

            Just modifying a little your example to go over the errors I found

            Notice that via tracing any if/elif/else, for, while will be unrolled

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

            QUESTION

            How can I realize data local spawning or scheduling of tasks in OpenMP on NUMA CPUs?
            Asked 2022-Feb-27 at 13:36

            I have this simple self-contained example of a very rudimentary 2 dimensional stencil application using OpenMP tasks on dynamic arrays to represent an issue that I am having on a problem that is less of a toy problem.
            There are 2 update steps in which for each point in the array 3 values are added from another array, from the corresponding location as well as the upper and lower neighbour location. The program is executed on a NUMA CPU with 8 cores and 2 hardware threads on each NUMA node. The array initializations are parallelized and using the environment variables OMP_PLACES=threads and OMP_PROC_BIND=spread the data is evenly distributed among the nodes' memories. To avoid data races I have set up dependencies so that for every section on the second update a task can only be scheduled if the relevant tasks for the sections from the first update step are executed. The computation is correct but not NUMA aware. The affinity clause seems to be not enough to change the scheduling as it is just a hint. I am also not sure whether using the single for task creation is efficient but all I know is it is the only way to make all task sibling tasks and thus the dependencies applicable.

            Is there a way in OpenMP where I could parallelize the task creation under these constraints or guide the runtime system to a more NUMA-aware task scheduling? If not, it is also okay, I am just trying to see whether there are options available that use OpenMP in a way that it is intended and not trying to break it. I already have a version that only uses worksharing loops. This is for research.

            NUMA NODE 0 pus {0-7,16-23} NUMA NODE 1 pus {8-15,24-31}

            Environment Variables

            ...

            ANSWER

            Answered 2022-Feb-27 at 13:36

            First of all, the state of the OpenMP task scheduling on NUMA systems is far from being great in practice. It has been the subject of many research project in the past and they is still ongoing project working on it. Some research runtimes consider the affinity hint properly and schedule the tasks regarding the NUMA node of the in/out/inout dependencies. However, AFAIK mainstream runtimes does not do much to schedule tasks well on NUMA systems, especially if you create all the tasks from a unique NUMA node. Indeed, AFAIK GOMP (GCC) just ignore this and actually exhibit a behavior that make it inefficient on NUMA systems (eg. the creation of the tasks is temporary stopped when there are too many of them and tasks are executed on all NUMA nodes disregarding the source/target NUMA node). IOMP (Clang/ICC) takes into account locality but AFAIK in your case, the scheduling should not be great. The affinity hint for tasks is not available upstream yet. Thus, GOMP and IOMP will clearly not behave well in your case as tasks of different steps will be often distributed in a way that produces many remote NUMA node accesses that are known to be inefficient. In fact, this is critical in your case as stencils are generally memory bound.

            If you work with IOMP, be aware that its task scheduler tends to execute tasks on the same NUMA node where they are created. Thus, a good solution is to create the tasks in parallel. The tasks can be created in many threads bound to NUMA nodes. The scheduler will first try to execute the tasks on the same threads. Workers on the same NUMA node will try to steal tasks of the threads in the same NUMA node, and if there not enough tasks, then from any threads. While this work stealing strategy works relatively well in practice, there is a huge catch: tasks of different parent tasks cannot share dependencies. This limitation of the current OpenMP specification is a big issue for stencil codes (at least the ones that creates tasks working on different time steps). An alternative solution is to create tasks with dependencies from one thread and create smaller tasks from these tasks but due to the often bad scheduling of the big tasks, this approach is generally inefficient in practice on NUMA systems. In practice, on mainstream runtimes, the basic statically-scheduled loops behave relatively well on NUMA system for stencil although it is clearly sub-optimal for large stencils. This is sad and I hope this situation will improve in the current decade.

            Be aware that data initialization matters a lot on NUMA systems as many platform actually allocate pages on the NUMA node performing the first touch. Thus the initialization has to be parallel (otherwise all the pages could be located on the same NUMA node causing a saturation of this node during stencil steps). The default policy is not the same on all platforms and some can move pages between NUMA nodes regarding their use. You can tweak the behavior with numactl. You can also fetch very useful information from the hw-loc tool. I strongly advise you to manually the location of all OpenMP threads using OMP_PROC_BIND=True and OMP_PLACES="{0},{1},...,{n}" where the OMP_PLACES string set can be generated from hw-loc regarding the actual platform.

            For more information you can read this research paper (disclaimer: I am one of the authors). You can certainly find other similar research paper on the IWOMP conference and the Super-Computing conference too. You could try to use research runtime though most of them are not designed to be used in production (eg. KOMP which is not actively developed anymore, StarPU which mainly focus on GPUs and optimizing the critical path, OmpSS which is not fully compatible with OpenMP but try to extend it, PaRSEC which is mainly designed for linear algebra applications).

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

            QUESTION

            Tensorflow setup on RStudio/ R | CentOS
            Asked 2022-Feb-11 at 09:36

            For the last 5 days, I am trying to make Keras/Tensorflow packages work in R. I am using RStudio for installation and have used conda, miniconda, virtualenv but it crashes each time in the end. Installing a library should not be a nightmare especially when we are talking about R (one of the best statistical languages) and TensorFlow (one of the best deep learning libraries). Can someone share a reliable way to install Keras/Tensorflow on CentOS 7?

            Following are the steps I am using to install tensorflow in RStudio.

            Since RStudio simply crashes each time I run tensorflow::tf_config() I have no way to check what is going wrong.

            ...

            ANSWER

            Answered 2022-Jan-16 at 00:08

            Perhaps my failed attempts will help someone else solve this problem; my approach:

            • boot up a clean CentOS 7 vm
            • install R and some dependencies

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

            QUESTION

            How to compare two vectors using SIMD and get a strncmp like result?
            Asked 2022-Feb-08 at 16:35

            I want to achieve something like strncmp result but not that complicated I tried to read https://code.woboq.org/userspace/glibc/sysdeps/x86_64/multiarch/strcmp-avx2.S.html source code but I failed to understand it

            suppose we have to 256 bit vector how can I compare these two based on 8 bit comparison to achieve result like strncmp

            I know there is a library but I want to understand the basics.

            how it return -1,0,1 result with _mm256_cmpeq_epi8 and _mm256_min_epu8

            ...

            ANSWER

            Answered 2022-Feb-08 at 16:35

            I would do it like that.

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

            QUESTION

            The `GLIBC_2.29 not found` problem of the installation of transformers?
            Asked 2022-Feb-01 at 11:47

            To run transformers I installed it on CentOS 8 by

            ...

            ANSWER

            Answered 2021-Dec-24 at 03:13

            I had the same issues, and I downgraded to the following version:

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

            QUESTION

            getifaddrs returning 'bad file descriptor'/crashing the application
            Asked 2022-Jan-18 at 10:47

            In my program, I have a thread which has to continuously monitor the network interfaces therefore it continuosly uses getifaddrs() in a while loop.

            ...

            ANSWER

            Answered 2021-Dec-06 at 08:59

            According to man7.org getifaddrs, any of the socket operations could be a cause for EBADF

            ERRORS

            getifaddrs() may fail and set errno for any of the errors specified for socket(2), bind(2), getsockname(2), recvmsg(2), sendto(2), malloc(3), or realloc(3).

            Unrelated, but do you do freeifaddrs() somewhere?

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

            QUESTION

            What does fs:0x30 provide in Linux?
            Asked 2022-Jan-17 at 03:21

            I am trying to understand the source code of atexit() function,but I stuck on this (line 409 ~ line 415, PTR_DEMANGLE())

            I can understand the inline asm need do a vital progress

            ...

            ANSWER

            Answered 2021-Oct-13 at 04:16

            The fs segment register is used in x86-64 Linux to point to thread-local storage. See How are the fs/gs registers used in Linux AMD64? So this instruction will xor the rdx register with the value found at offset 0x30 in the thread-local storage block.

            This code is part of a pointer encryption mechanism in glibc to help harden against certain exploits. There is some explanation of it at https://sourceware.org/glibc/wiki/PointerEncryption. The value at fs:0x30 is an "key" for a trivial "encryption" algorithm; pointers are xor'ed with this value (and then rotated) when they are stored, and rotated back and xor'ed again when they are retrieved from memory, which recovers the original pointer.

            There is no particular significance to the number 0x30; it just happens to be the offset where that value is stored. You can see in the inline assembly that this number comes from offsetof (tcbhead_t, pointer_guard); so the storage at the fs base address is laid out as a tcbhead_t struct, and given the other members that it contains, the pointer_guard member has ended up at offset 0x30. So looking at the name pointer_guard for the member is more informative than its numerical offset.

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

            QUESTION

            Win10 Electron Error: Passthrough is not supported, GL is disabled, ANGLE is
            Asked 2022-Jan-03 at 01:54

            I have an electron repo (https://github.com/MartinBarker/RenderTune) which used to work on windows 10 fine when ran with command prompt. After a couple months I come back on a new fresh windows 10 machine with an Nvidia GPU, and the electron app prints an error in the window when starting up:

            ...

            ANSWER

            Answered 2022-Jan-03 at 01:54

            You can try disabling hardware acceleration using app.disableHardwareAcceleration() (See the docs). I don't think this is a fix though, it just makes the message go away for me.

            Example Usage

            main.js

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

            QUESTION

            Why does this program print characters repeatedly, when they only appear in heap memory once?
            Asked 2021-Dec-31 at 23:21

            I wrote a small program to explore out-of-bounds reads vulnerabilities in C to better understand them; this program is intentionally buggy and has vulnerabilities:

            ...

            ANSWER

            Answered 2021-Dec-31 at 23:21

            Since stdout is line buffered, putchar doesn't write to the terminal directly; it puts the character into a buffer, which is flushed when a newline is encountered. And the buffer for stdout happens to be located on the heap following your heap_book allocation.

            So at some point in your copy, you putchar all the characters of your secretinfo method. They are now in the output buffer. A little later, heap_book[i] is within the stdout buffer itself, so you encounter the copy of secretinfo that is there. When you putchar it, you effectively create another copy a little further along in the buffer, and the process repeats.

            You can verify this in your debugger. The address of the stdout buffer, on glibc, can be found with p stdout->_IO_buf_base. In my test it's exactly 160 bytes past heap_book.

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install glibc

            You can download it from GitHub, GitLab.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            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/bminor/glibc.git

          • CLI

            gh repo clone bminor/glibc

          • sshUrl

            git@github.com:bminor/glibc.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