glibc

Do different programs gets their memory from a common heap or from a separate heap?

﹥>﹥吖頭↗ 提交于 2019-12-09 11:16:56
问题 I am a bit confused how glibc on linux allocates its memory to various program.These are the few questions: Is it been allocated from a common heap(i.e is there a common heap across all of the processes in linux) or is there one heap allocated for every process in the system. Also suppose if I am compiling one static library and it finally gets statically linked to the main process, how it will get its memory? Is it already linked with some other heap(as we already compiled it) or will gets

Cross compile glibc for arm, got undefined reference to some unwind functions

让人想犯罪 __ 提交于 2019-12-08 21:55:29
Now I need to build glic-2.15 for our armv7 soc platform. I follow the following steps to build it: Download and extracted glibc-2.15 and glibc-ports from http://ftp.gnu.org/gnu/libc/ mkdir build-glibc cd build-glibc echo "CFLAGS += -D__ARM_ARCH_7__ -D__LINUX_ARM_ARCH__=7 -march=armv7 -U_FORTIFY_SOURCE -fno-stack-protector" > configparms PATH={toolchain}/bin BUILD_CC={build}/bin/gcc CC={toolchain}/bin/arm-linux-gnueabihf-gcc AR={toolchain}/bin/arm-linux-gnueabihf-ar RANLIB={toolchain}/bin/arm-linux-gnueabihf-ranlib ../glibc-2.15/configure --prefix=/linaro-toolchain/ \ --exec-prefix=/linaro

Cross compile PHP with UCLIBC

微笑、不失礼 提交于 2019-12-08 16:05:02
问题 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. This is a programming problem not a server admin problem. Cross compile PHP https://serverfault.com/questions/418521/cross-compile-php Start of post I have downloaded the PHP 5.4.0 source, extracted it and moved into the source folder. I do a configure with: ./configure --build=x86_64-unknown

About thread safety in malloc and free [duplicate]

感情迁移 提交于 2019-12-08 10:40:37
问题 This question already has answers here : Closed 10 years ago . Possible Duplicate: Malloc thread-safe? I heard that glibc malloc() was not thread safe, since several threads of a process calling malloc() simultaneously will lead to undefined behaviour. And my question is if a thread calls free() will another thread is calling malloc(), will this lead to undefined behaviour as well? 回答1: If you link with -pthreads, malloc() will be threadsafe in glibc. Without that, the linker doesn't link in

make curl with different glibc version: unresolved GLIBC_PRIVATE [duplicate]

落花浮王杯 提交于 2019-12-08 10:14:13
问题 This question already has answers here : Multiple glibc libraries on a single host (11 answers) Closed 3 years ago . The distribution glibc version is 2.11.3. I compiled the version 2.22 into /usr/glibc/ . Running make for a new curl version 7.46 I receive this errors: /usr/glibc/lib/libpthread.so.0: undefined reference to `__mktemp@GLIBC_PRIVATE' /usr/glibc/lib/libpthread.so.0: undefined reference to `__tfind@GLIBC_PRIVATE' /usr/glibc/lib/libpthread.so.0: undefined reference to `__tdelete

*** glibc detected *** sendip: free(): invalid next size (normal): 0x09da25e8 *** [duplicate]

*爱你&永不变心* 提交于 2019-12-08 04:30:17
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: C++ Error: free(): invalid next size (fast): That's a C++ question (albeit a 'C++ being abused' question). Alternative duplicate: Facing an error: glibc detected free invalid next size (fast) I am using a Linux tool to generate some n/w traffic but getting this error when i try to send data greater than some length while the tool has provision for it. My whole project has stuck in between. As I have not created

Cross compile glibc for arm, got undefined reference to some unwind functions

限于喜欢 提交于 2019-12-08 03:59:59
问题 Now I need to build glic-2.15 for our armv7 soc platform. I follow the following steps to build it: Download and extracted glibc-2.15 and glibc-ports from http://ftp.gnu.org/gnu/libc/ mkdir build-glibc cd build-glibc echo "CFLAGS += -D__ARM_ARCH_7__ -D__LINUX_ARM_ARCH__=7 -march=armv7 -U_FORTIFY_SOURCE -fno-stack-protector" > configparms PATH={toolchain}/bin BUILD_CC={build}/bin/gcc CC={toolchain}/bin/arm-linux-gnueabihf-gcc AR={toolchain}/bin/arm-linux-gnueabihf-ar RANLIB={toolchain}/bin/arm

How does glibc's write work?

蹲街弑〆低调 提交于 2019-12-08 01:24:27
问题 I tried to compile a simple program that called write with -nostdlib , but I got the error: /path/to/file:3: undefined reference to `write' I thought write was a Unix thing and was always there, but apparently not, turns out libc has write function. I found the source code: /* Write NBYTES of BUF to FD. Return the number written, or -1. */ ssize_t __libc_write (int fd, const void *buf, size_t nbytes) { if (nbytes == 0) return 0; if (fd < 0) { __set_errno (EBADF); return -1; } if (buf == NULL)

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

风流意气都作罢 提交于 2019-12-07 20:31:50
问题 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

How does a socket event get propagated/converted to epoll?

孤者浪人 提交于 2019-12-07 19:13:59
问题 I am curious how epoll_wait() receives the event that a registered socket (with epoll_ctl()) is ready for read/write. I believe that glibc magically handles it. Then, is there a document describing how the following events can be triggered for a socket? EPOLLPRI EPOLLRDNORM EPOLLRDBAND EPOLLWRNORM EPOLLWRBAND EPOLLMSG EPOLLERR EPOLLHUP EPOLLRDHUP P.S. Originally I was trying to paste the enum EPOLL_EVENTS in sys/epoll.h on my box here; stackoverflow thinks that I don't format the code block