Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
IT Security NachrichtenXiaomis KI-Modell sorgt für Aufsehen, greift mit Kampfpreisen an(22.09.2026 um 17:00 Uhr)
IT Security Nachrichten120Hz-Flaggschiff und auch kleiner: Jmgo bringt neue 4K-Beamer(22.09.2026 um 17:20 Uhr)
IT Security NachrichtenMy 5 favorite Siri AI ‘onscreen awareness’ tricks – and why(22.09.2026 um 15:06 Uhr)
IT Security DownloadsGitHub Release: php/php-src vphp-8.5.11 (22.09.2026)(22.09.2026 um 15:39 Uhr)
IT Security DownloadsGitHub Release: php/php-src vphp-8.4.26 (22.09.2026)(22.09.2026 um 17:00 Uhr)
IT Security DownloadsGitHub Release: php/php-src vphp-8.6.0RC1 (22.09.2026)(22.09.2026 um 17:18 Uhr)
IT Security NachrichtenXiaomis KI-Modell sorgt für Aufsehen, greift mit Kampfpreisen an(22.09.2026 um 17:00 Uhr)
IT Security Nachrichten120Hz-Flaggschiff und auch kleiner: Jmgo bringt neue 4K-Beamer(22.09.2026 um 17:20 Uhr)
IT Security NachrichtenMy 5 favorite Siri AI ‘onscreen awareness’ tricks – and why(22.09.2026 um 15:06 Uhr)
IT Security DownloadsGitHub Release: php/php-src vphp-8.5.11 (22.09.2026)(22.09.2026 um 15:39 Uhr)
IT Security DownloadsGitHub Release: php/php-src vphp-8.4.26 (22.09.2026)(22.09.2026 um 17:00 Uhr)
IT Security DownloadsGitHub Release: php/php-src vphp-8.6.0RC1 (22.09.2026)(22.09.2026 um 17:18 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

CodeSOD: Tangled Up in Foo

DZ's tech lead is a doctor of computer science, and that doctor loves to write code. But you already know that "PhD" stands for "Piled high and deep", and that's true of the tech lead's clue. For example, in C#: private List<Foo>…

0
↗ Quelle (thedailywtf.com)
Reagiere als Erste:r — dein Feedback zählt!

DZ's tech lead is a doctor of computer science, and that doctor loves to write code. But you already know that "PhD" stands for "Piled high and deep", and that's true of the tech lead's clue.


For example, in C#:


private List<Foo> ExtractListForId(string id)
{
List<Foo> list = new List<Foo>();
lock (this)
{
var items = _foos.Where(f => f.Id == id).ToList();
foreach (var item in items)
{
list.Add(item);
}
}
return list;
}

The purpose of this function is to find all the elements in a list where they have a matching ID. That's accomplished in one line: _foo.Where(f => f.Id == id). For some reason, the function goes through the extra step of iterating across the returned list and constructing a new one. There's no real good reason for this, though it does force LINQ to be eager- by default, the Where expression won't be evaluated until you check the results.


The lock is in there for thread safety, which hey- the enumerator returned by Where is not threadsafe, so that's not a useless thing to do there. But it's that lock which hints at the deeper WTF here: our PhD-having-tech-lead knows that adding threads ensures you're using more of the CPU, and they've thrown threads all over the place without any real sense to it. There's no clear data ownership of any given thread, which means everything is locked to hell and back, the whole thing frequently deadlocks, and it's impossible to debug.


It's taken days for DZ to get this much of a picture of what's going on in the code, and further untangling of this multithreaded pile of spaghetti is going to take many, many more days- and much, much more of DZ's sanity.



[Advertisement] Picking up NuGet is easy. Getting good at it takes time. Download our guide to learn the best practice of NuGet for the Enterprise.


Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten CodeSOD: Tangled Up in Foo

Thematisch verwandte Begriffe: CodeSOD, Tangled · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-95667 | The MISP installer scripts (for Debian 12, Debian 13, Ubuntu 24.04, and …
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick