rss2
0xStubs
0xstubs.org · American English
System Administration, Programming and Reconfigurable Computing
rss2 audio wordpress content slash wfw atom dc sy
- Last post
- May 23, 2025
- Posts in 24 h · 7 days · 30 days
- 0 · 0 · 0
- Our last check
- Answering
- Served from
- Germany
- Site title
- 0xStubs – System Administration, Programming and Reconfigurable Computing
- Text score at discovery
- 8,977
- Format
- rss2
- Features in the feed
- content, slash, wfw, atom, dc, sy
- Community
- wordpress
Posts
What our queue read from this feed. Open one to read it here, or go to the site that published it.
- Using the C++23 std Module with GCC 15
May 23, 2025 · original
A couple months ago, I wrote about Using the C++23 std Module with Clang 18 . Now that GCC 15 has been released , there is support for the C++23 std module in GCC as well. We use the following minimal example for testing this feature: import std; int main() { std::print("Hello world!\n"); } Similar to Clang, some preparation is required to allow compiling this code. We need to compile the module interface: g++ -std=c++23 -fmodules -fsearch-include-path -c bits/std.cc The resulting std.o file is actually not required. What is important for us is the gcm.cache/std.gcm file that is generated by this compiler call. With this file present, we can now compile our code: g++ -std=c++23 -fmodules -o test test.cpp Note that we have to use the -fmodules flag in both compiler calls with GCC, while this flag must not be used when using Clang. Of course, all of this can be easily automated in a Makefi - Using the C++23 std Module with Clang 18
Sep 1, 2024 · original
A feature introduced in C++20 is modules . With C++23, the standard library is now supposed to provide an std module that can be used instead of all the #include s that we are used to. This allows code like the following: import std; int main() { std::print("Hello world!\n"); } While (partial) support for modules is included in GCC since version 11 and Clang since version 8, support for the std module is currently still lacking in libstdc++ and only included in libc++ since version 17 (see https://en.cppreference.com/w/cpp/compiler_support ). But since I have Clang 18 and libc++ installed, I wanted to give it a try. Simply trying to compile above code, unfortunately leads to an error: % clang++ -std=c++23 -stdlib=libc++ -o test test.cpp test.cpp:1:8: fatal error: module 'std' not found 1 | import std; | ~~~~~~~^~~ 1 error generated. One might be tempted to try Clang’s -fmodules flag but - openSUSE Tumbleweed on the StarFive VisionFive 2
Oct 2, 2023 · original
In March, I wrote about my initial contact with the StarFive VisionFive 2 board. Since then, StarFive released a couple of new releases of their Debian-based operating system. However, these releases are still based on a Debian unstable snapshot from 2022 and a Linux 5.15.0 kernel that contains several severe vulnerabilities. Updating the image is not possible without breaking their custom fixes to mesa. By now there are also dozens of distributions available for the board. Many of them rely on StarFive’s outdated kernel sources . Others merge those kernel sources with more recent upstream patches or selectively apply StarFive patches on up-to-date mainline kernel sources . However, looking at the current status of the upstreaming efforts for the JH7110 SoC, it shows that most parts of the SoC are supported in mainline Linux 6.6. The most important part missing is certainly the HDMI outp - Using the C++ bool type in HPC codes
Aug 3, 2023 · original
When writing C++ code, you are probably inclined to use data types that are closest to what you are trying to express, expecting that this allows the compiler to provide the most efficient implementation possible. So, when processing boolean values, i.e., single-bit information distinguishing between true and false , you will likely want to use the bool type in C++. However, this bool type may behave in unexpected ways, in particular if you are working with codes that have to perform well and correctly in multi-threaded codes. Performance impact Let’s first have a look at performance. Consider a code that determines if a given memory area is uniformly filled with a given byte value. This code should clearly be memory-bandwidth-bound: bool same(const char *ptr, const char elem, const size_t len) { bool same = true; for (size_t i = 0; i len; i++) { if (ptr[i] != elem) same = false; } retur - “touch -r $ $@” in Makefiles – Please don’t
May 15, 2023 · original
Recently I had a bad memory module in my main storage system which is also the backup target of many of my systems. To be on the safe side, I validated all backed up files against their origin via checksums. Interestingly, multiple systems showed differing checksums for all DejaVu font files, i.e. the files in the backup did not match those in the system. Clearly, this was not caused by the bad memory module. It looked very much like a systematic issue. I (and many others, I presume) use rsync for backups. By default, rsync identifies modified files by looking at modification time and size of the files. If files change without either of those attributes changing, rsync won’t transfer the file again. And that’s where bad Makefiles come into play… dejavu-fonts include a command in nearly all of their Makefile targets that sets the modification time of the compiled targets to the modificati - Tinkering with the StarFive VisionFive 2
Mar 30, 2023 · original
With RISC-V getting more and more attention, I was curious and got myself a StarFive VisionFive 2 , a single board computer equipped with a SiFive JH7110 SoC which implements the RV64GC ISA. While the performance is not on par with ARM SBCs yet, the overall experience has been quite good so far. In this article, I share some of my experiences with it. StarFive VisionFive 2 SBC Warning First of all, a word of warning: Do not use the VisionFive 2 with the currently available image (202302) for any form of productive work, in particular not in multi-user environments. Its kernel is based on Linux 5.15.0 which contains the Dirty Pipe vulnerability . Therefore, it is very easy for everyone with access to the board to get root permissions. See the corresponding bug report . It seems to be relatively easy to rebase the modified kernel onto a current Linux 5.15 release, as already done by Michal - Stuck UART on the ZedBoard
Mar 25, 2023 · original
Recently I grabbed my trusted old Avnet / Digilent ZedBoard to test how well the current Xilinx tools work with this now a decade old platform. However, I was facing a weird issue: The serial output by the Zynq PS was only received via USB on my computer when I was sending characters via UART from my computer to the PS as well. As soon as there was a pause in communication, any further serial output by the PS was silently dropped. I noticed that I could make the UART work again just by touching the device file corresponding to the USB-to-UART chip (e.g., /dev/ttyACM0 ). It looked like the USB-to-UART bridge was just falling asleep until I poked it either by sending data from the USB side or by touching the device file. Turns out, this is exactly what was happening. There is a USB feature called autosuspend which is enabled by default on Arch Linux and puts USB devices to sleep after 1-2 - How not to use the HackRF One as a spectrum analyzer
Nov 2, 2022 · original
A while ago I wrote about how to use the HackRF One as a spectrum analyzer , and mentioned that apart from using its sweep functionality, it could also be used as a real-time 20 MHz spectrum analyzer using any SDR software. I now had to learn about its limitations and possible pitfalls when using it this way. I wanted to look at the spectrum put out by an RF transmitter when transmitting an unmodulated carrier, i.e., a simple sine wave. In particular, I wanted to know about any nearby spurs, so looking at it with a high-bandwidth SDR seemed to be a good idea. So I connected the transmitter to the HackRF One, using appropriate attenuation. Looking at the spectrum put out by the transmitter gave me a bit of a shock: RF Spectrum as shown by the HackRF One, using SDRangel The transmitter seemed to put out around 192 kHz of junk around the carrier. In particular, there were spurs visible at - - libc’s random number generators and what to be aware of when seeding them
Jan 7, 2022 · original
When you need pseudo-random numbers in C code, commonly used routines are random() , rand() and rand_r(unsigned int*) . First and foremost, it is important to know that none of these routines produce high quality random numbers suitable for cryptographic use. But there are cases where you just need some random looking numbers. Let’s focus on these use-cases in this blog post. For example, let’s assume you have a multi-threaded OpenMP program where you need to generate different pseudo-random numbers in each thread. A natural approach to this would be the following: #pragma omp parallel { unsigned seed = omp_get_thread_num(); #pragma omp for for (...) { int rnd = rand_r(&seed); ... } } Each thread stores its own state of the random number generator and initializes ( seeds ) it with its thread number. Therefore, each thread should obtain different random numbers, although they will be iden - Understanding USB Microphone Whine
Aug 8, 2021 · original
I recently got my hands on a USB microphone, namely the Samson Meteor Mic , a large diaphragm electret condenser microphone that not only looks cute but also has overall good reviews online. However, when testing the microphone I was rather disappointed by the annoying background noise that is clearly audible when turning up the volume of the microphone. Have a listen: Example of background noise Same example as before but amplified We hear two things here: One is relatively normal microphone hiss. The other is a high-pitched noise which you really do not want to have in your recordings. Let’s have a look at the spectrum of the recorded noise, using Audacity and its spectrum analysis (i.e., an FFT): FFT of recorded noise (please excuse the bad contrast) We can clearly see a peak at exactly 1 kHz as well as corresponding harmonics. Interestingly, these harmonics seem to disappear at 7, 8
Discovered by the rss-feed-index crawler, which checks each feed at most once a month.
Same record as JSON: https://api.agentalog.com/api/feeds/fd_0xstubs_org_87c730cdcdd76639. More from this site: 0xstubs.org in the Feeds tab.