libc

Apt-get can't install anything due to broken dependencies

岁酱吖の 提交于 2019-12-24 12:09:59
问题 Whenever I run apt-get install for any package I get this error ➜ ~ sudo apt-get install clang-5.0 Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: gcc-7-multilib : Depends: libc6-dev-i386 (>= 2.11) but it is not going to be installed libc6-dev-x32 : Depends: libc6-dev-i386 (= 2.25-2) but it is not going to be installed E: Unmet

Can docker solve a problem of mismatched C shared libraries?

前提是你 提交于 2019-12-24 11:28:15
问题 I am trying to run some haskell code on an ubuntu (18.04) host, which was compiled on my laptop. host: 4.15.0-36-generic #39-Ubuntu SMP Mon Sep 24 16:19:09 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux laptop: 4.14.74-1-MANJARO #1 SMP PREEMPT Fri Oct 5 14:16:52 UTC 2018 x86_64 GNU/Linux The error I get is /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found After doing some research I learned that this is because my laptop has version 2.28 of glibc installed, but the host only has libc6

On Mac OS X, how can you get a debug build of System/LibC for source level debugging?

痴心易碎 提交于 2019-12-24 02:42:51
问题 I downloaded LibC source from opensource.apple.com, but since it's part of one monolithic library /usr/lib/libSystem.B.dylib would I have to somehow rebuild the entire thing? I have a BSD command line program, ported from Linux. I want to be able to set breakpoints in LibC functions and step through. I'm trying to close in on what seems to be heap corruption in my program (which doesn't occur on Linux - I've already ported back to Linux and run memcheck there.) 回答1: Have you take a look at

wcstombs() has invalid output on Android

喜欢而已 提交于 2019-12-24 02:23:49
问题 I'm trying to port some old C/C++ code to android(latest version of NDK), but I'm struggling with function wcstombs(). This function returns wierd result on Android and I don't know why. Look at this code (it's wcstombs() example from C++ reference) const wchar_t str[] = L"wcstombs example"; char buffer[32]; int ret; ret = wcstombs ( buffer, str, sizeof(buffer) ); if (ret==32) buffer[31]='\0'; __android_log_print(ANDROID_LOG_WARN, "dbg", "%d ... %s", ret, buffer); // Application.mk APP_ABI :=

Is wordexp in libc on OSX 10.9.5 known to leak?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-23 15:57:48
问题 Is wordexp on OSX 10.9.5 known to leak memory? And if not, what is wrong with my code? On my own local machine running OSX 10.10.5 I run my code through Valgrind and get no lost bytes . No leaks on my Ubuntu Linux machine either. However, when I turned on valgrind checks on my travis-ci account that uses OSX 10.9.5 I suddenly get a leak from memory allocated inside of wordexp even though I free it using wordfree as the man page describes: ==8968== LEAK SUMMARY: ==8968== definitely lost: 1,024

Why is tzset() a lot slower after forking on Mac OS X?

心不动则不痛 提交于 2019-12-23 10:26:40
问题 Calling tzset() after forking appears to be very slow. I only see the slowness if I first call tzset() in the parent process before forking. My TZ environment variable is not set. I dtruss 'd my test program and it revealed the child process reads /etc/localtime for every tzset() invocation, while the parent process only reads it once. This file access seems to be the source of the slowness, but I wasn't able to determine why it's accessing it every time in the child process. Here is my test

ANR in random usage of application

霸气de小男生 提交于 2019-12-23 08:51:50
问题 I have an VOIP application and the engine part is C(NDK) Level.On random usage of application i end with an ANR pointing to " at android.os.MessageQueue.nativePollOnce(Native Method)" . Using android-ndk-r5 ANR Traces: ----- pid 13735 at 2013-05-23 15:56:47 ----- Cmd line: com.myapp.voip DALVIK THREADS: (mutexes: tll=0 tsl=0 tscl=0 ghl=0) "main" prio=5 tid=1 NATIVE | group="main" sCount=1 dsCount=0 obj=0x41315508 self=0x413058e8 | sysTid=13735 nice=0 sched=0/0 cgrp=apps handle=1074442032 |

Android Source: Is fopen() in bionic libc only used for system internal apps?

断了今生、忘了曾经 提交于 2019-12-23 05:20:52
问题 I created an NDK application that does the following successfully: #include <string.h> #include <stdio.h> #include <android/log.h> JNIEXPORT jstring JNICALL Java_my_package_NativeAccess_stringFromJNI( JNIEnv* env, jobject thiz) { char* str = "Native Code!"; FILE* file = fopen("sdcard/hello.txt","w+"); if (file == NULL) { file = fopen("mnt/sdcard/hello.txt","w+"); if (file == NULL) { file = fopen("storage/sdcard/hello.txt","w+"); } } if (file == NULL) { str = "Native Code! fopen() did not work

C++: How to force libc declarations into std::?

社会主义新天地 提交于 2019-12-22 06:53:54
问题 So, I find myself in the need of libc in my C++ program. However, I do not like the idea of sprinkling it all over the global namespace. Ideally, I'd like to force the entirety of libc into the std:: namespace so I'd have to do std::memcpy rather than memcpy . Is this possible? And how? I'm willing to use compiler-specific macros if needed (I target only MS VC++ 10.0 and GCC 4.6). Edit: I do literally mean 'force the declarations into std' - so that they are uncallable without the std::

C++: How to force libc declarations into std::?

北战南征 提交于 2019-12-22 06:52:04
问题 So, I find myself in the need of libc in my C++ program. However, I do not like the idea of sprinkling it all over the global namespace. Ideally, I'd like to force the entirety of libc into the std:: namespace so I'd have to do std::memcpy rather than memcpy . Is this possible? And how? I'm willing to use compiler-specific macros if needed (I target only MS VC++ 10.0 and GCC 4.6). Edit: I do literally mean 'force the declarations into std' - so that they are uncallable without the std::