glibc

GlibC Double free or corruption (fclose)

二次信任 提交于 2019-12-02 21:46:10
问题 I got an error on my C program on runtime. I found some stuff about "double free or corruption" error but nothing relevant. Here is my code : void compute_crc32(const char* filename, unsigned long * destination) { FILE* tmp_chunk = fopen(filename, "rb"); printf("\n\t\t\tCalculating CRC..."); fflush(stdout); Crc32_ComputeFile(tmp_chunk, destination); printf("\t[0x%08lX]", *destination); fflush(stdout); fclose(tmp_chunk); printf("\t[ OK ]"); fflush(stdout); } It seems the fclose(tmp_chunk);

hadoop报错WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

匿名 (未验证) 提交于 2019-12-02 21:40:30
19/06/14 10:44:58 WARN common.Util: Path /opt/hadoopdata/hdfs/name should be specified as a URI in configuration files. Please update hdfs configuration. 19/06/14 10:44:58 WARN common.Util: Path /opt/hadoopdata/hdfs/name should be specified as a URI in configuration files. Please update hdfs configuration. 19/06/14 10:44:58 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 1 解决 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 查看 [root

Centos 6.9 编译安装gcc 4.8.5

眉间皱痕 提交于 2019-12-02 21:36:40
前言 GCC (GNU Compiler Collection,GNU编译器合集)是linux以及其他类UNIX平台上进行开源项目,软件开发等必不可少的工具链组成之一。(其他的还有clang以及llvm等编译器) 对于程序员以及系统管理员而言,经常需要从软件的源码进行手动编译安装, 不论是configure脚本,还是make工具,最终都需要调用gcc(或者其它编译器)来进行实际的编译工作。 另外,各种软件也经常需要使用gcc的新版特性,并且与旧版gcc共存,根据实际的需求进行调用。 实验环境:VMware Workstation Pro 14(试用版) 系统平台: CentOS release 6.9 (Final) 内核 2.6.32-696.el6.x86_64 软件包:minimal最小化安装 基础知识 glibc GNU C Library https://www.gnu.org/ GNU C库项目提供了 GNU系统和GNU / Linux系统的核心库,以及许多其他使用Linux作为内核的系统。glibc是Linux系统中最底层的API,几乎其它任何的运行库都要依赖glibc。这些库提供了关键的API, 包括ISO C11,POSIX.1-2008,BSD,操作系统特定的API等等。这些API包括open, read,write,malloc,printf,

How to use getaddrinfo_a to do async resolve with glibc

廉价感情. 提交于 2019-12-02 20:43:42
An often overlooked function that requires no external library, but basically has no documentation whatsoever. UPDATE (2010-10-11) : The linux man-pages now have documentation of the getaddrinfo_a, you can find it here: http://www.kernel.org/doc/man-pages/online/pages/man3/getaddrinfo_a.3.html As a disclaimer I should add that I'm quite new to C but not exactly a newbie, so there might be bugs, or bad coding practices, please do correct me (and my grammar sucks too). I personally didn't know about it until I came upon this post by Adam Langley, I shall give a few code snippets to illustrate

What is __i686.get_pc_thunk.bx? Why do we need this call?

怎甘沉沦 提交于 2019-12-02 18:49:48
When I disassemble my small function, I happened to see this call call 0xf60d2f47 <__i686.get_pc_thunk.bx>. I have no clue why I need this call in my program. Any explanation would be helpful. This call is used in position-independent code on x86. It loads the position of the code into the %ebx register, which allows global objects (which have a fixed offset from the code) to be accessed as an offset from that register. Position-independent code is code that can be loaded and executed, unmodified, at different addresses. It is important for code that will be linked into shared libraries,

GHashTable that using uint64_t as key and a struct as value

时光总嘲笑我的痴心妄想 提交于 2019-12-02 18:44:41
问题 I am studying the GHashTable . Though there are already some examples in Stackoverflow, they are just some common case. So I am still not sure how to implement my requirements and decide to ask for help. I want to use a uint64_t as key and a struct as value. I find that there is no such built-in hash function in GLib . There is just a g_int64_hash() . Though the key is uint64_t , it will just be about 52 bits. So I think gint64 is OK. But I see some examples using GINT_TO_POINTER() to convert

GLIBCXX_3.4.9 not found

早过忘川 提交于 2019-12-02 17:12:18
I have a problem concerning libstdc++.so . I installed a new version of gcc and tried to compile C++ code. The compiling worked, but when I try to execute the binary ( m5.opt is its name) I've got the following error: build/ALPHA_SE/m5.opt: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by build/ALPHA_SE/m5.opt). Do I need to replace libstdc++.so ? And if so, where can I download the version I want? On the GCC-website they say libstdc++ is a part of gcc now. Details GCC: I had gcc 4.1.2 before, but I downloaded gcc 4.2.4. From the untarred gcc-directory I executed .

GHashTable that using uint64_t as key and a struct as value

拜拜、爱过 提交于 2019-12-02 09:45:24
I am studying the GHashTable . Though there are already some examples in Stackoverflow, they are just some common case. So I am still not sure how to implement my requirements and decide to ask for help. I want to use a uint64_t as key and a struct as value. I find that there is no such built-in hash function in GLib . There is just a g_int64_hash() . Though the key is uint64_t , it will just be about 52 bits. So I think gint64 is OK. But I see some examples using GINT_TO_POINTER() to convert the value (and sometimes they didn't). So just be confused about this. Thanks very much! See in ghash

GlibC Double free or corruption (fclose)

二次信任 提交于 2019-12-02 09:29:59
I got an error on my C program on runtime. I found some stuff about "double free or corruption" error but nothing relevant. Here is my code : void compute_crc32(const char* filename, unsigned long * destination) { FILE* tmp_chunk = fopen(filename, "rb"); printf("\n\t\t\tCalculating CRC..."); fflush(stdout); Crc32_ComputeFile(tmp_chunk, destination); printf("\t[0x%08lX]", *destination); fflush(stdout); fclose(tmp_chunk); printf("\t[ OK ]"); fflush(stdout); } It seems the fclose(tmp_chunk); raises this glibc error : *** glibc detected *** ./crc32: double free or corruption (out): 0x09ed86f0 ***

How do I build into a specified directory using the “prefix” option of configure?

丶灬走出姿态 提交于 2019-12-02 08:18:47
I am trying to build glibc 2.27 on Clear Linux, obtained here: https://www.gnu.org/software/libc/sources.html According to the help, I should build into a directory outside of the source folder using the prefix command. As far as I can tell, I am doing what is described in the installation help: Configuring and compiling the GNU C Library The GNU C Library cannot be compiled in the source directory. You must build it in a separate build directory. For example, if you have unpacked the GNU C Library sources in '/src/gnu/glibc-VERSION', create a directory '/src/gnu/glibc-build' to put the object