glibc

__vdso_time missing from core utils?

*爱你&永不变心* 提交于 2019-11-30 12:02:04
I built the latest glibc and now i'm having some trouble with functions in coreutils like ls or cat or anything else like vim . My error is -bash-4.0$ cat cat: error while loading shared libraries: __vdso_time: invalid mode for dlopen(): Invalid argument and I built, glibc without errors with the following configure ../glibc/configure --prefix=/home/ex/uid377/glibbuilt On older versions, like 2.14, running the utilities results in a segmentation fault. -bash-4.0$ ./pwd ./pwd: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./pwd) -bash-4.0$ LD_LIBRARY_PATH=/home/ex/uid377/glibc

glibc, glib and gnulib

我是研究僧i 提交于 2019-11-30 11:21:18
问题 what are differences in the strength and features in gnulib glib and glibc Thanks! 回答1: glibc is a core C runtime library. It provides things like printf(3) and fopen(3) . glib is an object-based event loop and utility library written in C. gnulib is a library that provides an adapter from the POSIX API to the native API. All three are used for completely different tasks. 回答2: glibc , the shortened form of GNU C Library , is the GNU Project's implementation of the C standard library. The API

How to sleep for a few microseconds

守給你的承諾、 提交于 2019-11-30 09:40:42
Consider the following code: #include <stdio.h> #include <time.h> #include <math.h> // Compile with gcc -lrt -lm -o test_clock test_clock.c #define CLOCK CLOCK_MONOTONIC int main(int argc, char** argv) { double temp, elapsed; int j; struct timespec requestStart, requestEnd, req; // Pseudo-sleep clock_gettime(CLOCK, &requestStart); temp = 0; for(j=0; j < 40; j++) temp += sin(j); clock_gettime(CLOCK, &requestEnd); elapsed = ( requestEnd.tv_sec - requestStart.tv_sec ) / 1e-6 + ( requestEnd.tv_nsec - requestStart.tv_nsec ) / 1e3; printf("Elapsed: %lf us\n", elapsed); // Nanosleep clock_gettime

gdb reverse debugging avx2

烈酒焚心 提交于 2019-11-30 08:39:05
问题 So I have a new fancy cpu that supports avx2 instruction set. This is great, but breaks gdb reverse debugging. When compiling with no optimisations code still uses shared libraries, eg calls memset() which then goes and invokes an avx2 optimised version of memset. This is great but avx2 is not supported by gdb record. process record does not support instruction 0xc5 at address 0x7ffff690dd80. 0xc5 is the vex prefix here. reverse debugging works great with a cpu that does not support avx2. How

Are functions in the C standard library thread safe?

£可爱£侵袭症+ 提交于 2019-11-30 08:29:37
Where can I get a definitive answer, whether my memcpy (using the eglibc implementation that comes with Ubuntu) is thread safe? - Honestly, I really did not find a clear YES or NO in the docs. By the way, with "thread safe" I mean it is safe to use memcpy concurrently whenever it would be safe to copy the date byte for byte concurrently. This should be possible at least if read-only data are copied to regions that do not overlap. Ideally I would like to see something like the lists at the bottom of this page in the ARM compiler docs. You can find that list here, at chapter 2.9.1 Thread-Safety

Enable mtrace (MALLOC_TRACE) for binary program

安稳与你 提交于 2019-11-30 07:39:47
问题 How can I enable mtrace() (and MALLOC_TRACE env) for a binary program without sources? mtrace is feature of glibc: http://www.gnu.org/s/hello/manual/libc/Allocation-Debugging.html Thanks 回答1: mtrace.c #include <mcheck.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #include <stdio.h> void __mtracer_on () __attribute__((constructor)); void __mtracer_off () __attribute__((destructor)); void __mtracer_on () { char *p=getenv("MALLOC_TRACE"); char tracebuf[1023]; if(!p) p="malloc

How to compile my own glibc C standard library from source and use it?

柔情痞子 提交于 2019-11-30 07:04:54
I am trying to compile my own glibc. I have a directory glibc , which contain the glibc source code I downloaded from the internet. From that directory I typed mkdir ../build-glibc . Now from the build-glibc directory I typed ../glibc/configure , which performed the configuration. Now I'm not sure how to call make . I can't call it from glibc directory since it doesn't have the configuration set, neither I can call it from build-glibc , since makefile is not in that directory. How do I solve this problem? The Makefile is going to exist in your build-glibc directory if the configure script

38.Maria安装 Apache安装

与世无争的帅哥 提交于 2019-11-30 05:45:01
11.6 MariaDB安装 11.7/11.8/11.9 Apache安装 扩展 apache dso https://yq.aliyun.com/articles/6298 apache apxs http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/programs/apxs.html apache工作模式 https://blog.csdn.net/STFPHP/article/details/52954303 11.6 MariaDB安装: 基本类似于MySQL,一样使用二进制的免编译包 cd /usr/local/src wget https://downloads.mariadb.com/MariaDB/mariadb-10.2.6/bintar-linux-glibc_214-x86_64/mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz tar zxvf mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz mv mariadb-10.2.6-linux-glibc_214-x86_64 /usr/local/mariadb cd /usr/local/mariadb ./scripts/mysql_install_db -

MariaDB安装-Apache安装

时光毁灭记忆、已成空白 提交于 2019-11-30 05:44:36
安装mariadb :(二进制免编译方式) cd /usr/local/src wget https://downloads.mariadb.com/MariaDB/mariadb-10.2.6/bintar-linux-glibc_214-x86_64/mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz tar zxvf mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz mv mariadb-10.2.6-linux-glibc_214-x86_64 /usr/local/mariadb cd /usr/local/mariadb ./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mariadb/ --datadir=/data/mariadb cp support-files/my-small.cnf /usr/local/mariadb/my.cnf #根据机器情况选择配置,large,medium,small区别是配置里缓存缓冲参数不同;此步骤没将配置拷贝到默认的/etc/目录下,后续需修改启动配置 #vim /usr/local/mariadb/my.cnf 基本不用改 cp support-files/mysql

How is the address of the text section of a PIE executable determined in Linux?

混江龙づ霸主 提交于 2019-11-30 05:31:46
First I tried to reverse engineer it a bit: printf ' #include <stdio.h> int main() { puts("hello world"); } ' > main.c gcc -std=c99 -pie -fpie -ggdb3 -o pie main.c echo 2 | sudo tee /proc/sys/kernel/randomize_va_space readelf -s ./pie | grep -E 'main$' gdb -batch -nh \ -ex 'set disable-randomization off' \ -ex 'start' -ex 'info line' \ -ex 'start' -ex 'info line' \ -ex 'set disable-randomization on' \ -ex 'start' -ex 'info line' \ -ex 'start' -ex 'info line' \ ./pie \ ; Output: 64: 000000000000063a 23 FUNC GLOBAL DEFAULT 14 main Temporary breakpoint 1, main () at main.c:4 4 puts("hello world")