#valgrind

Stéphane Charette 🇨🇦charette@mstdn.ca
2025-11-28

Valgrind takes just over 24 hours to run through something in Darknet/YOLO.

Then it prompts once for every single issue it found. 7182 records:

==1747473== ---- Print suppression ? --- [Return/N/n/Y/y/C/c] ----

- Is there a difference between uppercase and lowercase?
- I can guess what "n" and "y" means, but what is "c"? Cancel? Continue?

This is not a time to start experimenting since it took me over 24 hours to get to this stage, and I cannot find the answer in the valgrind docs. #cpp #valgrind

hiddenalphahiddenalpha
2025-11-12

Overhelming! All those tools around building software. , actions, , , , , and what the heck more. But unfortunately all of them waay too complex and feature-bloated for my taste. In addition, I'm absolutely NOT a fan of . But what's the alternative then? ...

Read more:
hiddenalpha.ch/slnk/id/1-x0VwN

Sergei Trofimovichtrofi@fosstodon.org
2025-11-11

Today's bug is a minor `valgrind` build system bug: bugs.kde.org/show_bug.cgi?id=5

There `valgrind` probed at `./configure` time presence of `-W${flag}` support in `gcc` and used `-Wno-${flag}` to disable it. And it worked until gcc.gnu.org/git/?p=gcc.git;a=c

`gcc-16` will not allow countering `-Walloc-size-larger-than=42` with `-Wno-alloc-size-larger-than=42` any more. It has to be spelled as `-Wno-alloc-size-larger-than`.

#bug #valgrind

2023-07-20

The FUTO July 2023 Microgrants Picks: Valgrind, KeePassXC, Oobabooga, and Neovim!

peertube.futo.org/videos/watch

2025-09-23

This looks exciting. GO runtime: add valgrind instrumentation go-review.googlesource.com/c/g

#valgrind

N-gated Hacker Newsngate
2025-09-23

🎉 Wow, added support! Now you can safely ignore memory leaks while you try to remember why you enabled just to read about it. 🙄🔍
go-review.googlesource.com/c/g

2025-08-20

the idris2 docs suggest that a char* returned from an FFI will be `free`'d right away after making another copy.

the #ChezScheme docs do not explicitly state that (and I think idris2 is relying on chez scheme to do this), and #valgrind seems to suggest not.

Alejandro Baezzeab@fosstodon.org
2025-08-17

#Valgrind is such an important tool. Especially when working with c libraries. Great work on #ghostty getting #gtk actually function for it. 😅
mitchellh.com/writing/ghostty-

GripNewsGripNews
2025-08-14

🌗 Ghostty GTK 應用程式重寫:擁抱 GObject 系統與 Valgrind 驗證
➤ Zig 與 GTK 的深度整合:一場關於記憶體安全與系統設計的實踐
mitchellh.com/writing/ghostty-
本文詳述了 Ghostty 終端機模擬器 GTK 版本重寫的技術細節。作者 Mitchell Hashimoto 深入探討瞭如何運用 Zig 語言與 GObject 系統進行整合,並強調了使用 Valgrind 工具對整個應用程式進行徹底記憶體驗證的重要性。重寫後的 Ghostty 應用程式展現了更高的穩定性、功能豐富度與可維護性,並成功解決了先前版本中因 C ABI 封裝而產生的記憶體安全問題。
+ 很高興看到作者如此細緻地分享重寫過程中的技術挑戰與心得,特別是關於 GObject 系統與 Zig 的整合,這對許多跨語言開發者來說非常有啟發性。
+ Valgrind 在 GTK 應用程式中的應用確實是一項艱鉅的任務,但成果斐然。

N-gated Hacker Newsngate
2025-08-14

🚀 Wow, rewriting with and is like knitting a sweater with spaghetti - impressive, but why? 🤔 Meanwhile, using to verify memory is just a fancy way of saying "I found in my own code, again." 🍝💻
mitchellh.com/writing/ghostty-

2025-08-12

You also know you're making progress when valgrind output looks like this:

==32514== All heap blocks were freed -- no leaks are possible
==32514==
==32514== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Stay tuned, later in the day I'll show you current project status 😉

#c #programming #cprogramming #valgrind

2025-08-08

Say what you want but GDB and Valgrind are invaluable pieces of my c programming arsenal 😎

#gdb #valgrind #cprogramming #c #freesoftware #foss

Photo of Tony Stark from the movie Iron Man with the letter C on top of his head, the text GDB on top of his right hand and the text valgrind on top of his left hand
2025-07-14

#Valgrind valgrind.org not only tweaks your instruction stream it also wraps all your system calls so it knows all (memory) manipulation that goes on in your program (and to hide itself from the program it is running inside).

We integrated the #LTP linux-test-project.readthedocs syscalls testsuite with make ltpchecks

We are now down to ~50 failures builder.sourceware.org/testrun

All tracked in the meta bug dependency tree bugs.kde.org/showdependencytre

Lets bring that count down to zarro boogs!

Felix Palmen :freebsd: :c64:zirias@bsd.cafe
2025-06-16

Next #swad release will still be a while. 😞

I *thought* I had the version with multiple #reactor #eventloop threads and quite some #lockfree stuff using #atomics finally crash free. I found that, while #valgrind doesn't help much, #clang's #thread #sanitizer is a very helpful debugging tool.

But I tested without #TLS (to be able to handle "massive load" which seemed necessary to trigger some of the more obscure data races). Also without the credential checkers that use child processes. Now I deployed the current state to my prod environment ... and saw a crash there (only after running a load test).

So, back to debugging. I hope the difference is not #TLS. This just doesn't work (for whatever reason) when enabling the address sanitizer, but I didn't check the thread sanitizer yet...

2025-06-10

TIL: calling munmap() with wrong parameters can cause really strange occasional crashes in #AddressSanitizer or #Valgrind. Wrong parameters meaning in this case:
- passing wrong (too large) size,
- passing NULL,
- calling munmap() multiple times for the same pointer.

Debugging the crashes was painful. What helped in the end was "doing the boring right thing": adding error checking to all related system calls, adding debug logs, fixing code smells.

#softwareDevelopment #Linux #mmap

Felix Palmen :freebsd: :c64:zirias@bsd.cafe
2025-06-08

I just stress-tested the current dev state of #swad on #Linux. The first attempt failed miserably, got a lot of errors accepting a connection. Well, this lead to another little improvement, I added another static method to my logging interface that mimics #perror: Also print the description of the system errno. With that in place, I could see the issue was "too many open files". Checking #ulimit -n gave me 1024. Seriously? 🤯 On my #FreeBSD machine, as a regular user, it's 226755. Ok, bumped that up to 8192 and then the stress test ran through without issues.

On a side note, this also made creating new timers (using #timerfd on Linux) fail, which ultimately made swad crash. I have to redesign my timer interface so that creating a timer may explicitly fail and I can react on that, aborting whatever would need that timer.

Anyways, the same test gave somewhat acceptable results: throughput of roughly 3000 req/s, response times around 500ms. Not great, but okayish, and not directly comparable because this test ran in a #bhyve vm and the requests had to pass the virtual networking.

One major issue is still the #RAM consumption. The test left swad with a resident set of > 540 MiB. I have no idea what to do about that. 😞 The code makes heavy use of "allocated objects" (every connection object with metadata and buffers, every event handler registered, every timer, and so on), so, uses the #heap a lot, but according to #valgrind, correctly frees everything. Still the resident set just keeps growing. I guess it's the classic #fragmentation issue...

Felix Palmen :freebsd: :c64:zirias@bsd.cafe
2025-06-04

Hm, is #valgrind's #helgrind useless for code using #atomic operations? Example, it complains about this:

==9505== Possible data race during read of size 4 at 0xADD57F4 by thread #14
==9505== Locks held: none
==9505== at 0x23D0F1: PSC_ThreadPool_cancel (threadpool.c:761)
[....]
==9505== This conflicts with a previous write of size 4 by thread #6
==9505== Locks held: none
==9505== at 0x23CDDE: worker (threadpool.c:373)

so, here's threadpool.c:761:

if ((pthrno = atomic_load_explicit(
&job->pthrno, memory_order_consume)) >= 0)

and here's threadpool.c:373:

atomic_store_explicit(&currentJob->pthrno, -1,
memory_order_release);

Ok, I *think* this should be fine? Do I miss something?

(screenshots for readability ...)

#c #coding #c11 #atomics

valgrind outputthreadpool.c:761threadpool.c:373
2025-05-22

:ubuntu: 🐛 Found what I think is a bug in the Valgrind package

bugs.launchpad.net/ubuntu/+sou

TL;DR: HTML, CSS, JavaScript and XML files have executable bits set when they shouldn't

Always report your bugs!

#Ubuntu #Valgrind #Bug

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst