Questions tagged [glibc]

The GNU C library is used as the C library in the GNU system and most systems with the Linux kernel. It defines the "system calls" and other basic facilities such as open, malloc, printf, exit, etc.

glibc
Filter by
Sorted by
Tagged with
10 votes
2 answers
24k views

libc or glibc in ubuntu?

I'm a little bit confused with these libraries. I'm working on Ubuntu now, I use g++ 5 and I see that my applications link in libc.so. Is it a Ubuntu's implementation of C standard library? Is it ...
Alexey's user avatar
  • 750
10 votes
1 answer
36k views

Why would the same binary want linux-vdso.so.1 on one 64-bit RHEL 5.4 server and not another?

I have a customer running a file parsing program called cleanfileg and as of the last update, he is getting date-format error when parsing a file. What's bizarre is that we're both running the same ...
Scott Mcgrath's user avatar
10 votes
2 answers
465 views

Linux-x64 glibc: Why does Feb 1 come before Jan 31?

When you call mktime(), Feb 1 seems to come before Jan 31. Why is this? Am I doing something wrong or is this a bug in glibc? Here's the code: struct tm tm; time_t tt; memset(&tm, 0, sizeof(tm)...
Paul A's user avatar
  • 103
10 votes
2 answers
5k views

Perl process gets stuck with «*** glibc detected *** perl: corrupted double-linked list: 0x0000000001474b40 ***» - how can I make it terminate?

I've been trying to debug a memory corruption problem with Perl 5 and XML::LibXML (which I now maintain). Now here's what I'm getting: shlomif@lap:~/progs/perl/cpan/XML/LibXML/bugs/perl-xml-libxml-...
Shlomi Fish's user avatar
  • 4,440
10 votes
4 answers
703 views

What makes it possible for glibc malloc to compare pointers from different "objects"?

Comparing pointers with a relational operator (e.g. <, <=, >= or >) is only defined by the C standard when the pointers both point to within the same aggregate object (struct, array or ...
kqr's user avatar
  • 14.9k
10 votes
1 answer
6k views

Explanation of memcpy memmove GLIBC_2.14/2.2.5

My issue originated with a shared library I was given without the option to recompile the library. The error stated undefined reference to memcpy@GLIBC_2.14. The version of GLIBC on my machine was 2....
PickleWeasel's user avatar
10 votes
1 answer
5k views

open O_CREAT | O_EXCL on NFS in Linux?

When in the Linux 2.6 kernel and in NFSv3 did open("fname", O_CREAT|O_EXCL) became valid? The current canonical open(2) system call documentation (http://www.kernel.org/doc/man-pages/online/pages/...
Jeff's user avatar
  • 3,505
10 votes
1 answer
13k views

Conda glibc dependency conflict

I get a weird error when I try to build a conda package. $ conda-build pkg2 .... Found conflicts! Looking for incompatible packages. This can take several minutes. Press CTRL-C to abort. failed .....
Evgeny Tanhilevich's user avatar
10 votes
1 answer
9k views

Building GCC with glibc in a non-standard location without root

I have a system that I do not have root access to, but I need to install the current version of GCC (4.7.2) on. The system is running an x86_64 build of Linux 2.6.18 and already has GCC 4.1 (without ...
Austin Wagner's user avatar
10 votes
1 answer
3k views

How to make Ubuntu's crypt(3) support Blowfish?

According to the crypt(3) manual, Blowfish (indicated by the $2a$ prefix) is one of the supported cypher methods: ID | Method ───────────────────────────────────────────────────────── 1 | MD5 2a |...
mae's user avatar
  • 15.4k
10 votes
2 answers
1k views

Detecting ABI compatibility issues with GCC

I recently spent a fairly substantial amount of time tracking down a problem that turned out to be caused by compiling a library with -D_GLIBCXX_DEBUG (which tells libstdc++ to use a debug version of ...
EvanED's user avatar
  • 947
10 votes
4 answers
7k views

Executing binary: `GLIBCXX_3.4.11' not found

I'm trying to run some pre-compiled code but I'm getting the following error: ./bin/stipdet: /cm/shared/apps/gcc/4.3.4/lib64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by ./bin/...
Bart's user avatar
  • 1,077
10 votes
1 answer
196 views

call to ‘__wmemcpy_chk_warn’: "wmemcpy called with length bigger than size of destination buffer"

I have this snippet of code (lets name it problem.cpp): #include <string> using str = std::wstring; static str foo(str text = str()) { text.resize(4); return text; } int main() { ...
srohmen's user avatar
  • 223
10 votes
1 answer
137 views

What happened with the relocating allocator?

I was reading old glibc documentation here when I saw three strange functions that I had never seen before (r_alloc, r_alloc_free and r_re_alloc). They implemented an allocator that realocates memory ...
Mabus's user avatar
  • 1,463
10 votes
1 answer
796 views

Can GHC link binaries against a libc implementation such as uclibc (used in OpenWrt by default)?

I am using Debian/MIPS+QEMU to build MIPS ports of PortFusion (a TCP tunneling solution). The resulting binaries are linked against GNU libc. Thus, they cannot be just copied over and used on vanilla ...
Cetin Sert's user avatar
  • 4,547
10 votes
2 answers
229 views

What's the purpose of the casts to signed int in glibc memmove?

Source code There they do unsigned long int dstp = (long int) dest; unsigned long int srcp = (long int) src; /* This test makes the forward copying code be used whenever possible. Reduces the ...
John Smith's user avatar
9 votes
4 answers
25k views

Configuring for a compiler different than the default while running configure

I am compiling the glibc library. Before I could do that, I need to run configure. However, for compiling glibc, I need to use the gcc compiler which is not the default compiler on the machine. The ...
MetallicPriest's user avatar
9 votes
2 answers
1k views

I was perusing glibc when I came across the socket code, can someone explain what is going on?

Here is the source I was browsing: glibc source. My particular question arises from this particular set of functions: socket library. For example(most of the functions are set up this way) socket/...
GRAYgoose124's user avatar
9 votes
1 answer
21k views

difference between %ms and %s scanf

Reading the scanf manual I encounter this line: An optional 'm' character. This is used with string conversions (%s, %c, %[), Can someone explain it with simple example stating the difference and ...
rondino's user avatar
  • 405
9 votes
3 answers
2k views

When invoking clock_gettime() may the returned tv_nsec field actually exceed a second?

When you invoke clock_gettime() it returns a timespec structure. struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; I don't find in the man page a garantee ...
yves Baumes's user avatar
  • 8,956
9 votes
3 answers
2k views

namespace issues in c++11?

Can somebody please explain the following: $ cat test.cpp #include <string> std::string div; $ g++ -c test.cpp $ g++ -std=c++11 -c test.cpp test.cpp:2:13: error: 'std::string div' redeclared ...
Tomasz Grobelny's user avatar
9 votes
2 answers
7k views

How is /usr/lib64/libc.so generated?

[root@xx test]# cat /usr/lib64/libc.so /* GNU ld script Use the shared library, but some functions are only in the static library, so try that secondarily. */ OUTPUT_FORMAT(elf64-x86-64) GROUP (...
compile-fan's user avatar
  • 17.3k
9 votes
3 answers
3k views

glibc's '-lmcheck' option and multithreading

We've been trying to hunt down some heap corruption issues in our multi-threaded C++ apps. As one technique, we tried add -lmcheck to the libraries line of the application. This is causing the app to ...
Michael Kohne's user avatar
9 votes
2 answers
6k views

Loading executable or executing a library

There is a large number of questions on SO about how to execute a library or dynamically load an executable. As far as I can tell, all the answers come down to: compile your executable as position-...
foxcub's user avatar
  • 2,537
9 votes
2 answers
1k views

Why is sys_fork not used by glibc's implementation of fork?

In eglibc's nptl/sysdeps/unix/sysv/linux/i386/fork.c there's a definition: #define ARCH_FORK() \ INLINE_SYSCALL (clone, 5, \ CLONE_CHILD_SETTID | ...
Ruslan's user avatar
  • 18.7k
9 votes
6 answers
8k views

Using NodeJS 18 in AWS Amplify on Amazon Linux 2 fails

Trying to upgrade an existing React app running on AWS Amplify from node v16 to v18 The image used is the provided Amazon Linux 2 Expected it to install node 18 on the machine it spun up and build the ...
Sahar LaOr's user avatar
9 votes
1 answer
5k views

How long does Glibc take to compile?

I've been compiling it in a virtual machine for over 8 hours now and it still hasn't finished. The terminal is still printing things so I know it's still compiling. The host system is a 2.10Ghz ...
tangrs's user avatar
  • 9,800
9 votes
1 answer
2k views

Cross compile PHP with UCLIBC

THIS IS A REPOST, PREVIOUS POST GOT CLOSED, MOVED TO SERVERFAULT AND CLOSED AGAIN. I think this post is a valid stackoverflow problem because i think its caused by some automake/compile/linking error. ...
Maidenone's user avatar
  • 723
9 votes
3 answers
3k views

Linking compiled library to newer version of glibc

I am working on a project that uses the ftdi D2XX drivers to interface with the ENTTEC DMX usb pro device. The ftdi drivers (libftdi2xx.so.1.1.12 stored in /usr/local/lib/) are compiled against a ...
Brotherhood's user avatar
9 votes
2 answers
10k views

use different glibc version

Currently I have glibc which does not support epoll, so I installed new glibc at non default lation which supports epoll. I have python program which uses this epoll. I tried to set LD_LIBRARY_PATH ...
big's user avatar
  • 1,928
9 votes
1 answer
7k views

Error while importing Tensorflow in python2.7 in Red Hat release 6.6. 'GLIBC_2.17 not found'

This is essentially a repeat of question asked here. However, I am using Red Hat Version 6.6, which has glibc 2.12 (glibc 2.17, I think was introduced with RHEL ver 7). Is it possible to install ...
kampta's user avatar
  • 4,828
8 votes
2 answers
9k views

not able to use g++ from Fedora

$ yum list | grep gcc arm-gp2x-linux-gcc.i686 4.1.2-11.fc12 @fedora arm-gp2x-linux-gcc-c++.i686 4.1.2-11.fc12 @fedora gcc.i686 ...
Lazer's user avatar
  • 92.5k
8 votes
3 answers
4k views

temporary file location when using tmpfile() in C

$ man tmpfile says The standard does not specify the directory that tmpfile() will use. Glibc will try the path prefix P_tmpdir defined in <stdio.h>, and if that fails the directory /tmp....
rootkea's user avatar
  • 1,484
8 votes
4 answers
762 views

What corner cases must we consider when parsing $PATH on Linux?

I'm working on a C application that has to walk $PATH to find full pathnames for binaries, and the only allowed dependency is glibc (i.e. no calling external programs like which). In the normal case, ...
Shea Levy's user avatar
  • 5,305
8 votes
1 answer
28k views

Non-blocking read on pipe

Can one do non-blocking I/O on a pipe? fcntl fails to set O_NONBLOCK. Page 918 of The Linux Programming Interface includes a table 'Semantics of reading n bytes from pipe or FIFO (p)'. This table ...
Tobin's user avatar
  • 369
8 votes
1 answer
5k views

dlopen doesn't respect `RTLD_LOCAL`?

I have A.so, which links to a particular versioned libstdc++.so.6 at its own directory (via rpath set to $ORIGIN). If I dlopen A.so alone, it works fine. If I dlopen my system's libstdc++.so.6 (...
colinfang's user avatar
  • 21.4k
8 votes
1 answer
3k views

How does the dlsym work?

it's very easy to find how to use dlsym() and other functions from this family, but how does it work internally? Is it possible to write own, easy implementation of dlsym()? I'm wondering if it is ...
kashpersky's user avatar
8 votes
4 answers
6k views

what's the difference between fallocate and ftruncate

They can all change file size according to my test. why can they all change file to larger and to shorter? what's the difference between fallocate and ftruncate?
Lenge's user avatar
  • 89
8 votes
1 answer
1k views

Which function in glibc calls the main function

I am trying to understand how Linux launches a program. I read somewhere that some function in glibc calls the main function. Profiling with callgrind and looking at the call-graphs in Kcachegrind, I ...
pythonic's user avatar
  • 21.1k
8 votes
1 answer
6k views

error while using make to compile Glibc-2.11.1 for Linux From Scratch

I am building LFS and I am in the part where we need to install Glibc-2.11.1 http://www.linuxfromscratch.org/lfs/view/6.6/chapter05/glibc.html I have successfully configured it but I cant run the ...
Rohan Bojja's user avatar
8 votes
2 answers
7k views

Compiling glibc from source with debug symbols

I need to compile glibc from source with debug symbols. Where do I specify the -g option for this? How do I later make a sample code link to this particular glibc rather than the one installed on my ...
woodstok's user avatar
  • 2,754
8 votes
2 answers
2k views

How to stop Clang from duplicating functions in standard C header files?

I've got some perfectly lovely C99 codes that are compiled from multiple .c files, and when I compile with Clang 2.7, I get some very strange errors: /usr/include/bits/stdio.h:77: multiple definition ...
Norman Ramsey's user avatar
8 votes
5 answers
61k views

How can I resolve this issue: libm.so.6: version `GLIBC_2.29' not found, C/C++?

When I've tried to execute my C++ demo app on RPI CM4, app that was cross compiled on Ubuntu OS: $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.1 ...
User's user avatar
  • 127
8 votes
4 answers
350 views

Strict aliasing rule and strlen implementation of glibc

I have been reading about the strict aliasing rule for a while, and I'm starting to get really confused. First of all, I have read these questions and some answers: strict-aliasing-rule-and-char-...
Yağmur Oymak's user avatar
8 votes
1 answer
5k views

Moving to different Linux build system, getting error: undefined symbol: stat

This may just be an issue with the build system I am migrating to, but I'll include differences in the two systems and how I encountered the problem. My old build system is a SLES 10 machine. The gcc/...
Jetson's user avatar
  • 81
8 votes
2 answers
961 views

C linkage for function pointer passed to C library

My case is pretty simple: I want my C++ program to deal with Unix signals. To do so, glibc provides a function in signal.h called sigaction, which expects to receive a function pointer as its second ...
qdii's user avatar
  • 12.8k
8 votes
2 answers
9k views

Error while building glibc

I'm trying to install glibc to debug a C-framework I'm working on. But, I'm getting an error in the build process. Here's the error msg: make[3]: Leaving directory `/root/glibc-source/glibc-2.14/elf' ...
AKR1989's user avatar
  • 117
8 votes
1 answer
2k views

Fedora 28 / GLIBC 2.27 libm.so.6 logf() and powf() c++

As I am sure other Fedora 28 users will know, the OS's glibc was recently updated to glibc 2.27. Amongst many other things, 2.27 has added new implementations of logf() and powf(). This has caused my ...
Amanda's user avatar
  • 331
8 votes
3 answers
7k views

How to tell gcc to stop using built-in functions?

I am using my own modified glibc. I saw in the compiled code that compiler was not using many standard library functions from my glibc when I linked with it. Then I put -fno-builtin flag. Things got ...
MetallicPriest's user avatar
8 votes
2 answers
16k views

Can I use glibc under windows?

Is it (or would it) be possible to use glibc under windows (as a replacement of msvcrt)? I know this is a stupid question, and answers like cygwin will pop up, but I am really asking: is it possible ...
rubenvb's user avatar
  • 75.6k

1 2 3
4
5
47