lingo.lol is one of the many independent Mastodon servers you can use to participate in the fediverse.
A place for linguists, philologists, and other lovers of languages.

Server stats:

59
active users

#clang

0 posts0 participants0 posts today

What do OpenBSD people use for static analysis of C code?

Valgrind was available for a while but it seems to have been removed now

Apparently there is something called the "Clang Static Analyzer", but I'm not sure how to actually use it (it seems you have to compile your program with specific Clang flags?)

I know there are countless other bugs in my code, but its nice to see "no leaks detected" when I do some stupid shit with void pointers :)

#openbsd#c#gcc

#MastoPrompt #clang Absolute darkness. Pain. Rippling through my body, waves crashing from every direction and nowhere all at once. I can see nothing. What just happened? Breathe. Think. Ok, systems check- it feels like I am lying an my back, pressed against cold .. urgh, wet… floor. The back of my head hurts. My back is rigid, painful, spasms locking my shoulders, my arms… I can’t feel my arms. Ok calm down. Heartbeat racing in my ears alongside the ringing, panic chattering (1/7)

Continued thread

For two days straight, I just can't reproduce #swad #crashing with *anything* in place (#clang #sanitizer instrumentation, attached #debugger like #lldb) that could give me the slightest hint what's going wrong. 😡

But it *does* crash when "unobserved". And it looks like this is happening a lot sooner (or, more often?) when using #LibreSSL ... but I also suspect this could be a red herring in the end.

Situation reminds me of my physics teacher back at school, who used to say something in german I just can't ever forget:

"Wer misst, misst Mist."

Feeble attempt in english would be "the one who measures measures crap", it was his humorous way to bring one consequence of #Heisenberg's indeterminacy principle to the point. And indeed, #debugging computer programs always suffers from similar problems...

I need help. First the question: On #FreeBSD, with all ports built with #LibreSSL, can I somehow use the #clang #thread #sanitizer on a binary actually using LibreSSL and get sane output?

What I now observe debugging #swad:

- A version built with #OpenSSL (from base) doesn't crash. At least I tried very hard, really stressing it with #jmeter, to no avail. Built with LibreSSL, it does crash.
- Less relevant: the OpenSSL version also performs slightly better, but needs almost twice the RAM
- The thread sanitizer finds nothing to complain when built with OpenSSL
- It complains a lot with LibreSSL, but the reports look "fishy", e.g. it seems to intercept some OpenSSL API functions (like SHA384_Final)
- It even complains when running with a single-thread event loop.
- I use a single SSL_CTX per listening socket, creating SSL objects from it per connection ... also with multithreading; according to a few sources, this should be supported and safe.
- I can't imagine doing that on a *single* thread could break with LibreSSL, I mean, this would make SSL_CTX pretty much pointless
- I *could* imagine sharing the SSL_CTX with multiple threads to create their SSL objects from *might* not be safe with LibreSSL, but no idea how to verify as long as the thread sanitizer gives me "delusional" output 😳

c/c++ devs of fediverse, what does your debugging workflow look like? I've used gdb manually a bit but it's quite laborious to set up each session. I need to be able to do step-through debugging with variable inspection.

[VS]Code and studio are very good for step through debugging once they're set up, but I'd rather avoid them altogether if possible, especially since you have to jump through a series of flaming hoops to get c debugging working in the non-telemetry open source version of code.

Any/all suggestions appreciated, other than 'use rust' #programming #clang #cpp

Continued thread

I had a couple of pretty fun days in the #SaltMine. On Friday, I set up a #Jenkins server so that one of my projects can support Jenkins as well as #Gitlab. I always love learning new packages. Yesterday, I spent a lot of time in the #clang compiler's source code trying to figure out some problems with their static analysis, either their static analysis or my understanding of it.

Just a few days ago, I lunched my new relay service for the #Fediverse and I'm really happy to see that there're already many ones connected to - more than 50 instances in just a few days!

But what makes me even really happy is to see, that my service [2] also gets linked in the release notes of #snac [1] / #snac2 - and I can recommend the usage of relay services (it doesn't matter which one!) to everyone. It provides more content from connected instances to you, but also brings your posts - from your local instance - up to other ones within the federated network where it can get much easier distributed around other instances.

#snac is the perfect way to host an own fediverse instance. Using the #ActivityPub protocol allows you to connect to all other instances. With the integrated #Mastodon API, you can also use most of your usual clients or web clients. Snac is light, fast, does not require any database and follows the KISS way - which the most of us BSD people are living. With relay services, it's the perfect match for singe-user instances and @grunfink is always open for ideas and to help! It does not always need to be #Mastodon, #GoToSocial etc!

And if you're using any other software, you may still benefit by using relay services. And if you're still looking for a guide, howto setup snac2 on #FreeBSD, my howto [3] might help you out.

[1]: codeberg.org/grunfink/snac2
[2]: fedi-relay.gyptazy.com
[3]: gyptazy.com/install-snac2-on-f