glibc

glibc application holding onto unused memory until just before exit

…衆ロ難τιáo~ 提交于 2019-12-02 07:35:02
I have a C++ application (gcc 4.9.1, glibc 2.17) running on linux (Centos 7). It uses various third-party libraries, notably Boost 1.61. As the application runs, I can watch its memory usage increasing steadily via htop's VIRT and RES columns, or the ps command, etc. If I let it go long enough, it will use enormous amounts of that memory and swamp the box. Sounds like a leak, but it passes valgrind with only a few bytes leaked, all in places I'd expect. Debug print messages indicate program flow is as expected. Digging further via the debugger, I find that most of this memory is still in use

How to load library defined symbols to a specified location?

删除回忆录丶 提交于 2019-12-02 06:11:21
问题 The test is on Ubuntu 12.04, 32-bit, with gcc 4.6.3. Basically I am doing some binary manipulation work on ELF binaries, and what I have to do now is to assemble a assembly program and guarantee the libc symbols are loaded to a predefined address by me. Let me elaborate it in an simple example. Suppose in the original code, libc symbols stdout@GLIBC_2.0 is used. #include <stdio.h> int main() { FILE* fout = stdout; fprintf( fout, "hello\n" ); } When I compile it and check the symbol address

how gcc automatically know to include glib library

依然范特西╮ 提交于 2019-12-02 04:16:56
I make simple program in C which uses glib.h , but when I compile it I get an error like: $ gcc test.c -o test test.c:3:18: fatal error: glib.h: No such file or directory compilation terminated. So from above it seems gcc can't find glib.h file (which is a part of the libglib2.0-dev package and have already installed it). So first I try locate glib.h files in my system and found output as below: $ locate glib.h /usr/src/linux-headers-3.2.0-29-generic-pae/include/config/blk/dev/bsglib.h /usr/src/linux-headers-3.2.0-48-generic-pae/include/config/blk/dev/bsglib.h /usr/src/linux-headers-3.2.0-57

Inconsistency in definitions of fputwc(), putwc() and putwchar() in glibc

谁都会走 提交于 2019-12-02 04:15:26
问题 Why fputwc() , putwc() and putwchar() take argument of type wchar_t instead of wint_t ? This contradicts corresponding non-wide character functions fputc() , putc() and putchar() , which take int , not char . 回答1: That is because wchar_t is required to hold an WEOF value and char is not required to hold an EOF value. For char , the fputc() , putc() and putchar() functions need to accept values which can hold both values in the unsigned char and EOF range, where EOF can be a negative number so

LAMP架构介绍以及MySQL安装

只愿长相守 提交于 2019-12-02 03:51:46
11月9日任务 11.1 LAMP架构介绍 11.2 MySQL、MariaDB介绍 11.3/11.4/11.5 MySQL安装 11.1 、LAMP架构介绍 # Apache和PHP是一体的,必须在一台服务器上,但是MySQL可以单独存在一台服务器上,当用户访问量很小的时候,三个服务也可以同时放在一台服务器上,但当访问量比较大时就要分开。Apache通过PHP模块从MySQL抽取数据,这个属于动态文件。还有一种情况是Apache直接从Apache子目录里边抽取文件为静态文件,例如访问网页的logo就是从子目录里边抽取的。 11.2、MySQL_Mar i aDB介绍 11.3、MySQL安装(上) MySQL的几个常用安装包:rpm、源码包、二进制免编译 cd /usr/local/src wget http://mirrors.163.com/mysql/Downloads/MySQL-5.6/mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz tar -zxvf mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz mv mysql-5.6.35-linux-glibc2.5-x86_64 /usr/local/mysql cd /usr/local/mysql useradd mysql mkdir

无需编译,1分钟安装Ubuntu官方构建的最新版Linux内核

余生长醉 提交于 2019-12-02 03:15:59
glibc是应用和kernel的桥梁,glibc封装kernel提供的API形成系统调用system call,Ubuntu上glibc对应libc6这个包。 升级kernel不升级核心库glibc一般不会影响软件的正常使用,像VirtualBox安装时编译有虚拟化相关的dkms内核模块,更新内核后需要重新编译这些模块: sudo /etc/init.d/vboxdrv setup 模块生成在 /lib/modules/`uname -r`/updates/dkms/vbox* 注:14.04上升级内核时会自动生成VirtualBox的内核模块,不需要手动执行。 新内核里集成了最新的Intel图形驱动 /lib/modules/`uname -r`/kernel/drivers/gpu/drm/i915/i915.ko 这得益于Intel官方Linux开源图形驱动项目:https://01.org/linuxgraphics/ Intel在2012年推出的Ivy Bridge架构的比如i5-3230M等等3代的CPU运行在Ubuntu12.04的3.2.0内核上可能会偶尔出现系统冻结freeze死机的情况。 旧内核不能很好地支持新架构,升级内核一般能解决类似问题。 http://kernel.ubuntu.com/~kernel-ppa/mainline/

php shell command error GLIBCXX_3.4.9 not found

Deadly 提交于 2019-12-02 02:44:41
问题 Im trying to execute shell command from php to convert files to pdf but i get this error. Could someone explain me in details how to fix it? Im not so good in linux( and also if i execute command straight through terminal everything works. /usr/lib/libreoffice/program/oosplash: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /usr/lib/libreoffice/program/../ure-link/lib/libuno_sal.so.3) 回答1: version `GLIBCXX_3.4.9' not found The problem is that in this environment

Linux下安装解压版mysql

↘锁芯ラ 提交于 2019-12-02 02:19:24
一、前提条件 1.1 安装虚拟机 1.2 安装Linux(此处用的是CentOS6.4) 1.3 mysql压缩包(mysql-5.6.43-linux-glibc2.12-x86_64.tar.gz) 1.3.1 下载地址 https://dev.mysql.com/downloads/mysql/5.6.html#downloads 1.3.2 相关选项 1.4 文件传输工具(XftpPortable.exe),用来Window操作系统向Linux传输文件 二、安装步骤 2.1 把tomcat压缩包通过文件传输助手传到Linux系统中 2.1.1 在系统的/usr/local文件目录下新建一个tmp文件夹,用来存放压缩包 2.1.2 将压缩包传输到tmp文件夹中 2.2 文件解压 2.2.1 解压命令 2.3 解压后的文件复制到/usr/local/mysql文件夹下 2.3.1 复制命令 2.3 创建用户组和该用户组下的用户 2.4 赋权(让该用户组和用户对mysql文件夹具有操作权限) 2.5 判断/etc/my.cnf文件是否存在,如果存在则删除 2.6 初始化数据库 2.7 复制mysql全局文件,将初始化生成的全局文件,复制到/etc/my.cnf 2.8 复制启动文件 2.9 启动mysql服务 2.10 添加软连接 2.11 操作数据库,默认是没有密码的 2.11

Hadoop问题解决:WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

寵の児 提交于 2019-12-02 02:12:09
在配置好hadoop的环境之后,命令启动./start-all.sh发现经常出现这样的一个警告: WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 关于解决这个问题总结了一下方法: 按警告的描述是说 hadoop的native库导入失败,定位这个问题就是要看下native目录下的静态库 libhadoop.so.1.0.0文件,一般出现这个问题都是依赖包版本的过低导致不兼容问题。 1、因为网上有的说是linux系统是32位,libhadoop.so.1.0.0是64位,就会导致这个问题,那我们先来看一下系 [root@master sbin]# uname -r 2.6.32-279.el6.x86_64 在看一下libhadoop.so.1.0.0的版本 [root@master native]# file libhadoop.so.1.0.0 libhadoop.so.1.0.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped

Is there a portable/standard-compliant way to get filenames and linenumbers in a stack trace?

泪湿孤枕 提交于 2019-12-02 01:26:03
问题 I've just read How to generate a stacktrace when my gcc C++ app crashes which is pretty old by now (5 years). Some answers suggest solutions allowing you to get, for every stack frame, the name of the function and an offset (within the stack I guess). But what I (and may others) really need is the source filename and line number where the call was made (assuming the code was compiled with debug information). One of the answers linked to a part of glibc which does this (libSegfault; see files