2,410 questions
0
votes
1
answer
63
views
Unfreeable Memory when Using Capstone
I disassembled a 7,838,304-Byte portion of /usr/lib/x86_64-linux-gnu/dri/i965_dri.so using Capstone as shown below:
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#...
0
votes
0
answers
33
views
Monitor sigprocmask calls with Syscall User Dispatch?
I'm using prctl(PR_SET_SYSCALL_USER_DISPATCH, ...) to enable Syscall User Dispatch with a SIGSYS handler that gets called when the application issues any syscall. The prctl() call also marks the code ...
1
vote
0
answers
96
views
std::shared_mutex priority inversion
pthread_rwlock_wrlock are used inside real-time threads to cause hang to live, Why would you live?
There is a priority inversion bug described here involving pthread_rwlock_wrlock and real time ...
0
votes
2
answers
79
views
How to reliably map glibc dynamic symbols (e.g., open@glibc) to kernel syscalls (e.g., openat)?
I am trying to build a mapping between the dynamic symbols in ELF files (from glibc) and the actual kernel syscalls they invoke.
My environment is x86_64 Ubuntu 22.04.
What I've Tried
Parsing man 2 ...
0
votes
1
answer
49
views
Where Can I See the Mapping Flow Between .dynsym and Kernel System Calls?
I'm struggling to reconcile the difference between the symbols listed in my ELF file's dynamic symbol table (.dynsym) and the system calls observed via strace.
When I perform static analysis using ...
0
votes
1
answer
77
views
Returning memory from glibc malloc non-main arenas to the operating system
I simulated a scenario in Java that leads to severe glibc memory fragmentation.
Step one: simulate a multithreaded environment with 600 threads.
Step two: every second, start two new threads that ...
2
votes
2
answers
88
views
mallopt(M_PERTURB) does not perturb the memory on free
I am trying to catch memory-related bugs such as use-after-free by mallopt(M_PERTURB, <value>).
According to the doc, the memory will be initialized to value when it has been released by free.
...
3
votes
0
answers
126
views
Cross-compiling GLIBC for ARM
I am tying to cross-compile GLIBC_2.36 from source for ARM. I am using arm-linux-gnueabihf toolchain to do this. The command I am passing from my build directory is below:
../glibc-2.36/configure --...
0
votes
0
answers
17
views
Some Problems when Installing Isaac-sim [duplicate]
Installing Isaac Sim packages with custom glibc.
Installing /tmp/tmp.osPlx0PAd4/omniverse_kit-106.5.0.162521-cp310-none-manylinux_2_34_x86_64.whl...
which: relocation error: /scratch/jiaqi/local/glibc/...
2
votes
2
answers
216
views
Why GDB is unable to break on main()?
I am launching my a.out application manually by passing it as an argument to dynamic loader like below. My application is compiled in debug mode.
*gdb --args /lib64/ld-linux-x86-64.so.2 ./a.out
I am ...
0
votes
1
answer
85
views
Getting a 32-bit program to run on a 64-bit distro without distribution-installed 32-bit libc [closed]
I'm trying to run an executable compiled for 32-bit Linux, on two machines running 64-bit Linux.
On one machine, the 32-bit version of glibc, and perhaps some related facilities, are installed as a ...
-1
votes
1
answer
167
views
These critical programs are missing or too old: "GNU ld compiler" when building glibc 2.42
I'm trying to build glibc 2.42 on a SLES 15 SP 6 machine (yeah, sorry about that, not my choice).
When configuring glibc, I am told:
These critical programs are missing or too old: "GNU ld ...
0
votes
0
answers
53
views
Cpanel shared Nodejs hosting GLIBC_2.29 not found
I am developing an app using fastify 5.6 & better-sqlite3 - 12.2.0
all is well and better-sqlite3 speed is phenomenal. The development was done in Windows 11 machine.
I am trying to host this in a ...
0
votes
0
answers
23
views
The fclose in child process affects parent process' file operations when there is no fflush before fork [duplicate]
I have file stream opened for reading. I read some data. Then I fork and close the stream. This however affects the parent process file stream (or its descriptor I believe), unless I fflush the file ...
4
votes
2
answers
216
views
Can I printf a half-precision floating-point value?
I have a _Float16 half-precision variable named x in my C program, and would like to printf() it. Now, I can write: printf("%f", (double) x);, and this will work; but - can I printf x ...
6
votes
4
answers
621
views
how to avoid buffered printf() blocking
Is there some way to know ahead of time when buffered printf() will block, giving an opportunity to avoid the call and either delay or discard output? For example a low level method of knowing when ...
0
votes
0
answers
89
views
glibc build error: `syslog` function not inlinable
I am trying to bulid glibc from source at Ubuntu 18.04
GLIBC_VERSION="2.28"
GLIBC_DIR="$HOME/.local/src/opt/glibc-$GLIBC_VERSION"
GLIBC_TAR="$HOME/.local/src/opt/glibc-$...
0
votes
0
answers
17
views
can glibc support build with -finstrument-functions [duplicate]
Is it feasible for glibc to support building with -finstrument-functions? I've detected a bug that could potentially be associated with glibc. However, I'm not certain which specific function is ...
2
votes
1
answer
93
views
Why does modifying a pthread_attr_t from pthread_getattr_default_np() affect the default attributes?
I'm observing unexpected behavior when using pthread_getattr_default_np() in conjunction with pthread_attr_setaffinity_np() on Linux.
I override the default thread attributes using ...
3
votes
2
answers
93
views
Should I care about Wcast-qual errors?
I recently read the NASA's power of 10 rules, and thought the rule about "using the compiler's most pedantic setting" was very interesting, considering warnings exist for a reason. I already ...
0
votes
4
answers
157
views
How to use register_printf_specifier in a portable way?
I'm doing a collections library in C in which I implement several data structures that I want to be able to display directly with printf (for example I have a String struct that I want to be able to ...
1
vote
1
answer
782
views
How to analyse problem: "malloc(): unsorted double linked list corrupted" [closed]
Problem phenomenon:
My C-process ABORT when one thread calling malloc(GLIB-2.33), and error string is "malloc(): unsorted double linked list corrupted";
pwndbg> bt
#0 __GI_raise (sig=...
0
votes
0
answers
104
views
/lib64/libpthread.so.0: version `GLIBC_PRIVATE' not found (required by xxx)
After running an application that had been running without any problems on Amazon-Linux-2/RHEL 7.9 for the first time in Amazon-Linux-2023/RHEL 9 environment, I got the following error and application ...
0
votes
1
answer
38
views
Libm.so.6 compatibility?
I have built a custom toolchain for RPi with ct-ng.
For libm.so.6 it ctng's sysroot, I have checked, it's containing these GLIBC versions:
GLIBC_2.17
GLIBC_2.18
GLIBC_2.23
GLIBC_2.24
GLIBC_2.25
...
1
vote
1
answer
1k
views
VS Code Remote-SSH fails with "GLIBC_2.28 not found" on Ubuntu 18.04
After upgrading VS code version 1.99, I cannot connect to my remote server. I’m trying to connect to my remote server (Ubuntu 18.04) via VS Code Remote-SSH, but the server fails to start with:
Missing ...
0
votes
1
answer
90
views
How to understand GLIBC incompatibility?
Unfortunately a project I'm working on doesn't work on some platforms. It crashes with an error like
/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found
/lib/x86_64-linux-gnu/libm.so.6: ...
0
votes
1
answer
139
views
How to tell julia that it should use a locally installed glibc version for compilation?
I am working on a HPC3 and want to install CUDA.jl to utilize the GPU while working in Julia. While compiling CUDA.jl (via Pkg.build("CUDA")), I realized that my glibc version is too low (...
1
vote
2
answers
333
views
Why does my hello-world Rust executable depend on libgcc_s?
I'm building the following program in Rust:
fn main() {
println!("Hello, world!\n");
}
on a Devuan Excalibur system (like Debian Trixie but without systemd; rustc version 1.84). After ...
1
vote
1
answer
237
views
R Package Installation Failure on Pop!_OS 22.04: GLIBCXX/GLIBC Version Mismatch (readr, googlesheets4)
I'm getting dependency errors when I try to install R packages readr and googlesheets4 on my Pop!_OS 22.04 system. This is particularly problematic because readr is a core dependency of the tidyverse ...
0
votes
0
answers
118
views
Unable to install libjemalloc2 with amazoncorreto image
I am trying to migrate from openjdk-17 to amazoncorreto java 17 but stuck with 3 libs which I am not able to figure out. Currently I am using below base image(which extends from debian 11 and has apt-...
-3
votes
1
answer
81
views
SkiaSharp Version Compatible with glibc 2.17 on CentOS 7
I'm working on a CentOS 7 system, which has glibc 2.17 and cannot be upgraded. I need to use SkiaSharp, but the latest version (v3) requires glibc 2.27+, which causes compatibility issues.
My setup:
...
2
votes
1
answer
132
views
Is it safe to run a container based on a higher version of Linux on a lower version of the Linux operating system? [closed]
For example, my operating system is Ubuntu 18.04, and I built an image based on Ubuntu 24.04 on this system. During the image build, I compiled a C program P inside the image. Later, I run this ...
0
votes
2
answers
131
views
Why does realloc(NULL, size) call my malloc wrapper, but realloc(ptr, 0) does not call my free wrapper? [closed]
I have wrapped my dynamic memory functions (malloc, calloc, realloc, and free) to track memory usage in my program.
I have encountered the following:
Calling realloc(NULL, 5) goes directly to my ...
0
votes
1
answer
155
views
Rust Binary Linking Issue: exec /opt/rust_application: no such file or directory on Scratch Container
I’m working on creating a scratch image as part of a test network for a system I’m building. My goal is to set up a multi-stage Docker build that allows me to compile and run a Rust application both ...
0
votes
1
answer
44
views
Running the app with custom downloaded glibc gives seg fault [duplicate]
I downloaded custom glibc and then compiled using g++ dt.cpp -std=c++11 -Wl,-rpath "/opt/glibc-2.28/lib", but it gives seg fault
#include <iostream> ...
1
vote
1
answer
134
views
Crash when dlopening shared library which accesses global variable in constructor
This simple library
$ cat foo.c
int glob;
int foo() {
return 0;
}
__attribute__((constructor))
void init() {
glob = foo();
}
$ gcc -g -O0 -shared -fPIC foo.c -o libfoo.so
loads fine when I ...
1
vote
1
answer
66
views
Output errors when using libmvec intrinsics for trigo functions manually (like cosf)
Referencing this link, I tried to integrate the libmvec intrinsics into some existing C++ code.
Naturally, this involved me changing the forward declaration to
extern "C" __m128 ...
6
votes
2
answers
346
views
How does shared-library sharing work for `linux` systems with different toolchains?
I would like to understand what happens exactly at compile/runtime when a C++ executable tries to run on Linux. I know this is somewhat vague, so I will try to be more specific in the following ...
2
votes
1
answer
867
views
In CMake, how can I declare a dependency on glibc with a specific or a minimum version?
Suppose I'm building a C library or app, and that my code uses libc (directly); but I'm relying on functionality or a bug fix which only became available in a certain version of glibc, or on a bug fix ...
2
votes
0
answers
264
views
Why does calloc allocate a new chunk instead of reusing tcache memory?
Let’s consider the following C code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
void *ptr;
ptr = malloc(8);
printf("First malloc: %p\n", ptr);
...
3
votes
0
answers
100
views
javafx 23.01 requires different glibc versions to run under linux x64 and aarch64
I recently upgraded the version of javafx to 23.01 and found that it can run normally under x64 Linux after the upgrade, but it cannot run normally under the aarch64 version of Linux, indicating that ...
0
votes
0
answers
284
views
How to use latest SkiaSharp in Debian 10 (buster)
ASP.NET 9 MVC application is running in Debian 10 (buster) server. It use captcha
https://github.com/VahidN/DNTCaptcha.Core
nuget package whose latest version requires Skiasharp 3.116.1
https://www....
0
votes
0
answers
248
views
/__e/node20/bin/node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /__e/node20/bin/node)
I have a github action (someone else made it, and pretty sure it works in the past)
jobs:
# some other job/steps...
upload-binary-to-s3:
if: startsWith(github.ref_name, 'xx-vault-plugin_')
...
4
votes
1
answer
287
views
Hook setenv(), getenv() using C code during runtime to make them thread safe [closed]
As it is already painfully known, modifying the process environment in a multi-threaded application during runtime is asking for trouble. However, not always we can control who accesses that.
In this ...
0
votes
1
answer
66
views
Building GCC found no GLIBCXX in libstdc++.so
I am now building GCC 12.1.0 on CentOS 7.4, and I'm surprisingly find that there are no GLIBCXX at all in the built libstdc++.so.6. However, older version like 5.5.0, 7.4.0 and 9.3.0 would not run ...
3
votes
2
answers
192
views
Is glibc's behavior around localtime_r and TZ compliant to POSIX
I was in the progress of porting some code to use localtime_r instead of localtime to make it more thread-safe, but ran into a very interesting difference between localtime and localtime_r, and it ...
0
votes
0
answers
105
views
Purpose of ld-linux.so dynamic section relocations
I was debugging an ELF shared library and noticed that in its
dynamic section the d_ptr values, which are stored as relative addresses on disk, are converted into absolute addresses when the library ...
0
votes
1
answer
176
views
Is it reliable to use pthread_self() to get a thread ID even from C++ threads?
On Linux, libstdc++ doesn't use pthread_create() to create threads, as it can be seen from this bug: https://bugzilla.kernel.org/show_bug.cgi?id=218607 (libpsx wraps pthread_create() to intercept ...
0
votes
1
answer
102
views
CLOCK_REALTIME_COARSE not settable?
clock_gettime(clockid_t clockid, struct timespec *tp);
clockid CLOCK_REALTIME_COARSE:
A faster but less precise version of CLOCK_REALTIME. This clock is not settable. ...
But if I adjust ...
1
vote
1
answer
150
views
GLIBC Compile Error: Implicit Declaration of Function
I am trying to compile GLIBC from source however during that process I get the following error:
../sysdeps/ieee754/flt-32/e_gammaf_r.c: In function ‘__ieee754_gammaf_r’:
../sysdeps/ieee754/flt-32/...