1,138 questions
1
vote
2
answers
366
views
Error when coding my own implementation of realloc()
I am contacting you because I need to code the functions realloc / strlen (signed and unsigned) / memcpy.
I have recoded these functions but it's doens't working and now I have valgrind errors like ...
0
votes
1
answer
260
views
glibc: Disable "corrupted double-linked list" check with MALLOC_CHECK_=0
For experimental purposes, I want to disable all the heap corruptions checks of glibc. In particular, I want to disable this check in the _int_free function:
/* Check that the top of the bin ...
19
votes
1
answer
11k
views
art::ConditionVariable::WaitHoldingLocks(art::Thread*)
Our mobile app is published in the Google play store. The Crashes and ANR report is generated in Firebase Crashlytics. There is an ANR shown as below.
0 libc.so (syscall+28)
1 libart.so(art::...
1
vote
1
answer
859
views
What to do next when you get core backtrace pointing to libc?
So, I messed up and want to know why... and turns out, I have a coredump to tell me why. But the coredump tells me,
Program terminated with signal SIGABRT, Aborted
(gdb) bt
#0 0x00007f4e36c08c0c in ...
-2
votes
1
answer
598
views
secure_getenv function not giving the expected result
In my program I am using secure_getenv function to fetch some environment variables. I included stdlib.h in my program. This is the sample call to secure_getenv.
Line 1 : char *myenv;
Line 2 : myenv = ...
1
vote
1
answer
2k
views
Is libpthread needed if the pthread API is in libc
Looking at the output of readelf -s /lib/x86_64-linux-gnu/libc.so.6 on my Ubuntu 22.04 box, I see (what looks to be) the entire pthread API contained in the .text section.
As a sanity check, I ...
0
votes
0
answers
970
views
Cross-compile GCC for x86_64-w64-mingw32 target
I would like to cross-compile GCC 6.3.0 for x86_64-w64-mingw32 target on Ubuntu 16.04.
I'm following the below steps:
Get the source files:
$ wget "http://sourceforge.net/projects/mingw-w64/...
2
votes
1
answer
8k
views
version `GLIBC_2.33' not found when trying to open vscode from Terminal
When I try to open Visual Studio Code using the command line code in the Terminal, I got this error that I don't understand:
$ code
/snap/code/117/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-...
4
votes
0
answers
2k
views
Error: failed to run custom build command for `libc v0.2.139`, but the problem seems deeper
I've been going through the Rust Book. I did cargo new learning to create the new project. cargo build worked and I was able to execute the default "Hello, world!" program no problem, but ...
1
vote
1
answer
3k
views
libc dll file is missing on windows 10
I'm trying to run this code in vscode for a school task, but I keep getting an error of a missing file 'libc.dll' I am somewhat confused of this file since I am new to this and not sure where to look ...
0
votes
1
answer
140
views
Py-cpu not downloading - Error: version `GLIBC_2.33' not found (required by /nix/store/...-gcc-10.3.0-lib/lib/libstdc++.so.6 [duplicate]
I wanted to use py-cpu for a project but it gave me a lot of errors regarding libc. Please don't give me "Your Linux is old", but if you do please explain how to fix it!
I wanted to install ...
1
vote
1
answer
135
views
'sprintf' libc call gives SegFault in assembly on Ubuntu (sometimes) [duplicate]
I am trying to stringify and integer in assembly (NASM) by making an sprintf call.
I have the following assembly code which does this:
sprintf_Int_str db "%lld",
dq 0
...
...
0
votes
0
answers
293
views
How to build GCC ARM project with hard restrictions to link libgcc?
Im has found, what even with --specs.nano.specs --specs.nosys.lib will link libgcc, if some dependencies request it (like some float operations).
With -nostdlib flag, compiler will throw out newlib-...
0
votes
1
answer
2k
views
GLIBC_2.28 and GLIBC_2.29 not found on Google Colab
How to install them?
When I start rendering a scene, I get this:
/lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.28' not found (required by ./Blender_K-cycles_linux/blender)
/lib/x86_64-linux-gnu/...
0
votes
2
answers
414
views
Overloading new/delete operators on ubuntu 22.04, libc 2.35 and calling SDL2 SDL_CreateRenderer causes segmentation fault
I have my own memory manager in linux (ubuntu) in order to detect memory leaks or memory corruption in my c/c++ code.
To use my own memory manager just I've overloaded new/delete global operators like ...
4
votes
0
answers
1k
views
Fresh flutter demo app: Access denied finding property "persist.vendor.sf.fbc" on moto e20
I created a new Flutter project (Flutter Demo) and used my moto e20 for debugging. I did not make any modifications to the example code.
In debug console i get the following errors.
Launching lib\main....
0
votes
0
answers
87
views
Call number in the EAX register in system call __open does not match the expected value [duplicate]
I am quite new in this domain. I am currently working on a academic research project which involves understanding "when" a system call is made from a C code. I am using Clang-llvm toolchain ...
0
votes
1
answer
100
views
Strange behavier of "getgroups"
I'm working on a little learning project,need to call "getgroups(int gidsetsize, gid_t grouplist[])"
I'v got "0" result of an id should have a list.
while checking all ...
-1
votes
1
answer
726
views
What are the differences between the various C standard library implementations [closed]
While I was researching how fopen and moreover the structure FILE are built I found out it wasn't all just GNU libc. I began to look closer at the various implementations such as Google's Bionic, ...
1
vote
0
answers
587
views
Undefined reference to `memcpy@GLIBC_2.14'
I am installing a package (on Ubuntu 20.04) and get the following errors:
loslib.c:(.text+0x2b0): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
/home/satadru/anaconda3/envs/sedona/...
1
vote
0
answers
308
views
QtCore QthreadPool segmentation fault when accessing qlibc 2.34 error __libc_start_main
First post (quantum physicist, not engineer). I have a multi-threaded Qt5 application that performs perfectly on Ubuntu 18.04 LTS using the QThread and QtConcurrent libraries. In main(), the first ...
1
vote
2
answers
93
views
Strange interaction between setlocale and mbstowcs
I have a strange behaviour between setlocale and mbstowcs.
Here is a sample code :
#include <cstdlib>
#include <iostream>
#include <clocale>
int main()
{
std::setlocale(LC_CTYPE,...
0
votes
1
answer
255
views
Can I use dl_iterate_phdr to monitor an exec process?
I would like to get the base address of a process that I am calling with execl such as in the following code.
Does the approach make any sense?
#include <stdio.h>
#define __USE_GNU
#include <...
16
votes
6
answers
68k
views
GLIBC_2.33 not found - while building Flutter for Linux
I was trying to run a flutter app on Ubuntu 22.04 LTS. Everything was working fine. But, today this problem came up while running the app. The Flutter SDK fails to build the app throwing the below ...
0
votes
1
answer
678
views
Buffer Overflow in strcpy(): return address of system() has a \x00 byte. (return-to-libc)
I'm currently learning about a return-to-libc method to bypass the non-executable stack countermeasure. The return address I'm trying to overflow on the stack is the libc system() function's address ...
2
votes
1
answer
6k
views
Alpine docker image __isnan: symbol not found
Here's the Dockerfile I am using to build a Golang application and a worker
FROM golang:1.15 AS build
RUN mkdir -p /go/api/proj
WORKDIR /go/api/proj
COPY go.* ./
RUN go mod download
COPY . .
RUN ...
0
votes
0
answers
29
views
Dynamically collect the list of native lib functions and signatures (via JNA) [duplicate]
I need to call standard os functions from within Java code.
I managed to successfully load the lib using the following construct:
interface CStdLib extends Library {
/**
* C STDLIB instance.
...
0
votes
1
answer
293
views
How to force/test malloc failure in shared library when called via Python ctypes
I have a Python program that calls a shared library (libpq in this case) that itself calls malloc under the hood.
I want to be able to test (i.e. in unit tests) what happens when those calls to malloc ...
3
votes
1
answer
279
views
How does _dl_runtime_resolve achieve thread safety?
I'm reading this article: https://ypl.coffee/dl-resolve/
Since the GOT table is resolved at runtime (at first call to this function), I'm wondering how does _dl_runtime_resolve ensure it's multi-...
-1
votes
2
answers
272
views
How is a char array maximum size in C determined?
Learning C and checking the reference from the GNU reference manual. I don't understand how is the maximum size that can be allocated to a char array defined in an exact way. In my test program when ...
1
vote
1
answer
403
views
Changing the timezone in libc time at compile time
We have firmware that will be deployed on devices all over the world and that will be synced to UTC by a host device. To track time, we end up converting between struct tm and time_t (Unix time) ...
0
votes
0
answers
409
views
LLVM how to add libc library function to ir module
I am building an IR module using the IRBuilder, and I want to be able to call libc functions from inside this module (For the most part math functions like atan that don't have intrinsics).
I think I ...
0
votes
1
answer
466
views
The libc function "system" does not get linked in the executable produced by GCC even after using the static flag
I am new to systems programming. I was just trying to implement the ret2libc attack on my own. To implement that, I need the address of the start of the libc function "system" in the ...
-2
votes
1
answer
54
views
Creating a new Linux systemcall need changes in libc as well?
If I am creating a new Linux system call , does that need changes in libc as well?
2
votes
0
answers
342
views
tcmalloc by default, but overridable
The common usage of tcmalloc vs glibc is "glibc malloc/free is the default; use LD_PRELOAD to use tcmalloc".
An application I'm working on, they want the reverse: tcmalloc by default, but ...
0
votes
0
answers
244
views
Is there a libc implementation contained in a single C file?
I'm looking for a libc implementation in a single C source file.
Previously, I tried decompiling musl's libc.so with Ghidra but the result contained too many errors. Even after manually fixing these ...
0
votes
1
answer
101
views
Which libc function reserves a port number so the OS won't allow other processes to use it?
I am writing a my first low-level networking application (a simple VPN) in rust and need to modify both the IP source address and TCP/UDP source port for each packet. Therefore I need to use raw ...
0
votes
1
answer
463
views
Code compiled on RHEL 8 using gcc not working on RHEL 6. Getting error `GLIBC_2.14' not found
We are having an application which is built using gcc on RHEL 8.
When we run the executable for this application on RHEL 6 we are getting error `GLIBC_2.14' not found required by application.
What are ...
3
votes
1
answer
331
views
Which shared libraries should I not include when distributing binary-only software on Linux?
The usual recommendation for handling the dependencies on Linux is by using the distro's package manager.
The good part of this approach is that you can reuse the basic set of libraries configured, ...
1
vote
1
answer
537
views
Installing libc6 on Google Colab
Hello i wanted to run Blender K-Cycles on Google Colab but got the following error message
lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found
lib/x86_64-linux-gnu/libc.so.6: version `...
5
votes
1
answer
3k
views
Where is the Android libc documentation?
For glibc you can find an online documentation here.
I am looking for an equivalent documentation for Android's libc implementation (headers located under sysroot/usr/include).
Is there a ...
1
vote
0
answers
308
views
How to pass gcc flags from goreleaser file, to link libraries
I'm running goreleaser build -f goreleaser_build.yml, on REHL linux. When setting no flag, the binary it builds has a few shared dynamic linked libraries:
linux-vdso.so.1 => (0x00007fff239f6000)...
0
votes
1
answer
132
views
what is different at same libc? 1.2 1.3 1.4 etc
Reference: https://libc.nullbyte.cat/
There are same libc-2.27.so but different Ubuntu.
Ex)
libc6_2.27-3ubuntu1.2_amd64
libc6_2.27-3ubuntu1.3_amd64
libc6_2.27-3ubuntu1.4_amd64
What these number ...
1
vote
0
answers
600
views
What is je_free function in libc.so?
Could somebody please explain me what is je_free function defined in libc.so and when is it called?
Note1: while investigating one crash reported in our application, I see application code is directly ...
1
vote
0
answers
182
views
What is the behavior of Darwin libc with respect to wide characters?
Note: I have asked this on AskDifferent, and it was closed as off topic.
I am thinking of writing a C program (or rather, a program generator) which will need to process Unicode text. It will be ...
1
vote
1
answer
1k
views
Compile c program with access to stdlib functions, but without _start and all of the libc init functions using gcc
So essentially I want to compile a c program statically with gcc, and I want it to be able to link c stdlib functions, but I want it to start at main, and not include the _start function as well as ...
0
votes
2
answers
87
views
How to distinguish calling a c library function from making a system call?
There is the C library function pipe(3) and the kernel (system call) pipe(2).
Both have the same signature and should be used like this (same include header):
#include <unistd.h>
int fds[2];
...
1
vote
0
answers
397
views
When and how to initialize standard I/O streams (stdin, stdout, stderr)?
Experimenting with static binaries, I found myself reimplementing parts of libc. My libc is static (i.e. a .a archive,) targets 64-bit Linux only and will probably never be POSIX compliant but I'm ...
1
vote
1
answer
802
views
How do I setsockopt of a TcpStream via libc?
I know TcpStream has stream.set_read_timeout but I need to make it in libc for Windows, but my code don´t works and I believe it is because I can't understand the way to put milliseconds in _value: *...
0
votes
0
answers
1k
views
Cross compile unit tests to arm-none-eabi and emulate in qemu
I've got code that is some what compiler dependent and I'd like to run the unit test written in gtest in qemu. I've found this tutorial that explains how to do it for arm-linux-gnueabihf all though it ...