glibc

Linux下 升级 glibc的版本

廉价感情. 提交于 2019-12-06 14:55:05
查看 glibc的版本号命令: ldd --version 或 rpm -qi glibc 查看操作系统支持的glibc版本, 64位执行命令 strings /lib64/libc.so.6 |grep GLIBC 32位系统 请执行 strings /lib/libc.so.6 |grep GLIBC glibc安装 1, 下载安装包,下载地址: http://ftp.gnu.org/pub/gnu/glibc/ 2,解压: tar - xzvf glibc - 2.14 . tar . gz 3, 进入目录 : cd glibc-2.14 4,依次执行如下命令: mkdir build // 在glibc-2.14目录下建立build文件夹 cd build // 进入build目录 mkdir -p /opt/ glibc - 2.14 //创建 glibc 安装目录 ../ configure -- prefix = /opt/ glibc - 2.14 // 配置glibc并设置当前glibc-2.14安装目录 make && make install // 编译安装glibc-2.14库 注意事项: 当有如下错误时: checking whether ranlib is necessary... no checking LD_LIBRARY_PATH variable

新增libc库glibc

一世执手 提交于 2019-12-06 14:54:48
声明 glibc官方地址 http://www.gnu.org/software/libc/ 查看现在glibc库版本 strings /lib64/libc.so.6 |grep GLIBC 下载安装 wget http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz 因为glibc库使用广泛,为了避免污染当前系统环境,最好自定义安装目录,使用时定义一下环境变量就行了。具体步骤如下: tar xvf glibc-2.14.tar.gz cd glibc-2.14 mkdir build cd build ../configure --prefix=/opt/glibc-2.14 make -j4 make install 查看现libc链接 ls -l /lib64/libc.so.6 /lib64/libc.so.6 -> libc-2.12.so 备份原链接 mv /lib64/libc.so.6 /lib64/libc.so.6.bak 建立新libc链接 ln -s /opt/glibc-2.14/lib/libc-2.14.so /lib64/libc.so.6 加入peofile vim /etc/profile export LD_LIBRARY_PATH=/opt/glibc-2.14/lib:$LD_LIBRARY_PATH

linux/glibc. Can I use fprintf in signal handler?

主宰稳场 提交于 2019-12-06 14:02:33
Can I use fprintf(stderr) in a signal (SIGALRM) handler with glibc/linux? No you cannot. Check the manpage signal(7) for a list of async-signal-safe functions. fprintf is not included in that list. If you don't need formatting then you can use write(STDERR_FILENO, <buf>, <buflen>) to write to stderr. This is not safe, quoting IBM DeveloperWorks article about Signal Handling Safety Suppose the signal handler prints a message with fprintf and the program was in the middle of an fprintf call using the same stream when the signal was delivered. Both the signal handler's message and the program's

C++: Do not show glibc's Backtrace and Memory map on crash

纵饮孤独 提交于 2019-12-06 12:46:54
I'm working on automatic C++ code testing using Python. So I have a Python script that compiles and executes C++ code. When the C++ code crashs, libc output is visible from my Python script output, even if I redirected cout and cerr of the C++ program being executed to /dev/null . Here is a sample isolating the problem: #! /usr/bin/env python # -*- coding: utf8 *-* import sys import os.path import subprocess import shutil import tempfile import string import argparse bug_folder = tempfile.mkdtemp("bug") # Create main.cpp with open( os.path.join(bug_folder,'main.cpp'), "w") as mainfile:

Is maths library included in the glibc now?

倾然丶 夕夏残阳落幕 提交于 2019-12-06 12:09:39
when I try to compile this simple code from terminal: #include<stdio.h> int main(void) { printf("%f\n",sqrt(10)); return 0; } using gcc main.c command, it gets compiled and a.out gives correct answer. It means that that maths functions are added in C standard library which gets linked automatically. But if compile the same code in Eclipse IDE without adding any library to properties, it gives undefined reference error. It means maths functions are not part of C standard library. What is the truth? You may be seeing constant folding here, where using a constant in the math function call will

Docker自定义镜像和上传到阿里云

二次信任 提交于 2019-12-06 11:41:40
alpine制作jdk镜像 alpine Linux 简介 1.Alpine Linux是一个轻型Linux发行版,它不同于通常的Linux发行版,Alpine采用了musl libc 和 BusyBox以减少系统的体积和运行时的资源消耗。 2.Alpine Linux提供了自己的包管理工具:apk(注意:ubuntu中是apt-get),我们可以通过https://pkgs.alpinelinux.org/packages 查询包信息 3.Alpine Docker镜像继承了Alpine Linux发行版的这些优势,相比于其他Linux Docker镜像,它的体积非常小 基于alpine 制作JDK8 镜像 #1. 下载镜像 docker pull alpine:latest #2. 创建并编辑dockerfile touch Dockerfile //创建 vi Dockerfile //编辑 dockerfile内容 #1.指定基础镜像,并且必须是第一条指令 FROM alpine:latest #FROM alpine:3.10 #2.指明该镜像的作者和其电子邮件 MAINTAINER xyz "xyz@qq.com" #3.在构建镜像时,指定镜像的工作目录,之后的命令都是基于此工作目录,如果不存在,则会创建目录 WORKDIR /cjh_docker/jdk #4

Problems on injecting into printf using LD_PRELOAD method

这一生的挚爱 提交于 2019-12-06 10:14:11
I was hacking printf() of glibc in one of my project and encountered some problem. Could you please give some clues? And one of my concern is why the same solution for malloc/free works perfect! As attached, “PrintfHank.c” contains my own solution of printf() which will be preloaded before standard library; and “main.c” just outputs a sentence using printf(). After editing two files, I issued following commands: compile main.c gcc –Wall –o main main.c create my own library gcc –Wall –fPIC –shared –o PrintfHank.so PrintfHank.c –ldl test the new library LD_PRELOAD=”$mypath/PrintfHank.so” $mypath

安装glibc

大憨熊 提交于 2019-12-06 09:58:27
wget http://ftp.gnu.org/gnu/glibc/glibc-2.23.tar.gz tar -zxvf glibc-2.23.tar.gz cd glibc-2.23 mkdir build cd build ../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin make -j8 make install 来源: https://www.cnblogs.com/hshy/p/11975551.html

Why does backtrace not contain Objective-C symbols regardless of -rdynamic?

心已入冬 提交于 2019-12-06 09:04:58
问题 Update: I'm working with the GNU-runtime on Linux. The problem does not occur on MacOS with the Apple-runtime. Update 2: I compiled the GNU-runtime on MacOS and build the example with it. The error does not occur on MacOS with the GNU-runtime. I would say the problem is the glibc (since backtrace and backtrace_symbols are glibc extensions). When printing a backtrace in a GCC compiled Objective-C app using backtrace and backtrace_symbols , I don't get any Objective-C symbols. Only the

自定义镜像上传阿里云

风格不统一 提交于 2019-12-06 08:41:29
1、alpine制作jdk镜像 2、Alpine制作jre镜像(瘦身) 3、Docker镜像上传至阿里云 alpine 制作 jdk 镜像 alpine Linux简介 1.Alpine Linux是一个轻型Linux发行版,它不同于通常的Linux发行版,Alpine采用了musl libc 和 BusyBox以减少系统的体积和运行时的资源消耗。 2.Alpine Linux提供了自己的包管理工具:apk(注意:ubuntu中是apt-get),我们可以通过https://pkgs.alpinelinux.org/packages 查询包信息 3.Alpine Docker镜像继承了Alpine Linux发行版的这些优势,相比于其他Linux Docker镜像,它的体积非常小 对比常用的、没有压缩过的基础镜像(查看当前的:latest标签): Alpine - 4.8MB centos - 124.8 MB Debian - 125.1MB Centos - 196MB 4.建议使用Alpine Linux 3.10.0版本,这也是 v3.10 稳定系列的首个版本 alpine:3 .10 基于alpine制作JDK8镜像 #1.下载镜像 docker pull alpine:latest #2.创建并编辑dockerfile touch Dockerfile vi