How to install GLIBC 2.29 or higher in Ubuntu 18.04

You can try to download glibc from the official source and install it: wget -c https://ftp.gnu.org/gnu/glibc/glibc-2.29.tar.gz tar -zxvf glibc-2.29.tar.gz mkdir glibc-2.29/build cd glibc-2.29/build ../configure –prefix=/opt/glibc make make install Pay attention to avoid breaking your OS environment: you need to specify the prefix and configure the separate path when you are using it. See this answer … Read more

man sscanf: %d is deprecated in C or glibc?

How come %d is deprecated? It seem that all int specifiers are deprecated. They are not deprecated in the sense that that term is ordinarily used in software documentation. There is no plan for their removal from the language and there are no direct replacements. The ISO committee responsible for maintaining the language standard has … Read more

Can one use libSegFault.so to get backtraces for SIGABRT?

env SEGFAULT_SIGNALS=”abrt segv” LD_PRELOAD=/lib/libSegFault.so someapp Note that the actual path to the preload library may differ. On my machine, I’d use env SEGFAULT_SIGNALS=”abrt segv” LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so some-64bit-app or env SEGFAULT_SIGNALS=”abrt segv” LD_PRELOAD=/lib/i386-linux-gnu/libSegFault.so some-32bit-app depending whether the application I was running was compiled 64-bit or 32-bit. (You can use file to check.) The source tells us there … Read more

How to upgrade glibc from version 2.12 to 2.14 on CentOS?

You cannot update glibc on Centos 6 safely. However you can install 2.14 alongside 2.12 easily, then use it to compile projects etc. Here is how: mkdir ~/glibc_install; cd ~/glibc_install wget http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz tar zxvf glibc-2.14.tar.gz cd glibc-2.14 mkdir build cd build ../configure –prefix=/opt/glibc-2.14 make -j4 sudo make install export LD_LIBRARY_PATH=/opt/glibc-2.14/lib

Why is glibc’s sscanf vastly slower than fscanf on Linux?

sscanf() converts the string you pass in to an _IO_FILE* to make the string look like a “file”. This is so the same internal _IO_vfscanf() can be used for both a string and a FILE*. However, as part of that conversion, done in a _IO_str_init_static_internal() function, it calls __rawmemchr (ptr, ‘\0’); essentially a strlen() call, … Read more

_GNU_SOURCE and __USE_GNU

_GNU_SOURCE is the only one you should ever define yourself. __USE_GNU is defined internally through a mechanism in features.h (which is included by all other glibc headers) when _GNU_SOURCE is defined, and possibly under other conditions. Defining or undefining __USE_GNU yourself will badly break the glibc headers.