# undefined\_behavior

Published articles for undefined\_behavior.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## std::call\_once vs. std::async

DevFeed: [std::call\_once vs. std::async](<https://devfeed.tech/articles/std-call-once-vs-std-async-42168.md>)

Original publisher: [Read original article](<https://devblogs.microsoft.com/oldnewthing/20260917-00/?p=112706>)

Author: Raymond Chen

Published: 2026-09-17T14:00:00Z

Content type: article

Language: en

Sources: [Raymond Chen](<https://devfeed.tech/sources/raymond-chen.md>)

Topics: [async](<https://devfeed.tech/topics/async.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [implementation](<https://devfeed.tech/topics/implementation.md>), [undefined\_behavior](<https://devfeed.tech/topics/undefined-behavior.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [execution](<https://devfeed.tech/topics/execution.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [code](<https://devfeed.tech/tags/code.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [exception](<https://devfeed.tech/tags/exception.md>), [execution](<https://devfeed.tech/tags/execution.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [old-new-thing](<https://devfeed.tech/tags/old-new-thing.md>), [undefined-behavior](<https://devfeed.tech/tags/undefined-behavior.md>)

### AI overview

This article compares std::call_once with std::async for deferred execution in C++. It discusses retrieving cached results, repeated calls, thread safety, memory allocation, supported execution modes, and exception behavior, with additional commentary on implementation defects and data races in an older GCC implementation.

### Source excerpt

Simple vs complex machinery. The post <CODE>std::call_once</CODE> vs. <CODE>std::async</CODE> appeared first on The Old New Thing.

## C++29 -- начало. Встреча ISO C++ в Брно

DevFeed: [C++29 -- начало. Встреча ISO C++ в Брно](<https://devfeed.tech/articles/c-29-iso-c-24878.md>)

Original publisher: [Read original article](<https://habr.com/ru/companies/yandex/articles/1067348/>)

Author: antoshkka (Яндекс)

Published: 2026-08-17T07:01:31Z

Content type: article

Language: ru

Sources: [Яндекс - Как мы делаем Яндекс / Статьи](<https://devfeed.tech/sources/source.md>)

Topics: [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [floating-point](<https://devfeed.tech/topics/floating-point.md>), [implementation](<https://devfeed.tech/topics/implementation.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [c-plus-plus-29](<https://devfeed.tech/tags/c-plus-plus-29.md>), [floating-point](<https://devfeed.tech/tags/floating-point.md>), [fmt](<https://devfeed.tech/tags/fmt.md>), [format](<https://devfeed.tech/tags/format.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [iso](<https://devfeed.tech/tags/iso.md>), [standard](<https://devfeed.tech/tags/standard.md>), [standard-library](<https://devfeed.tech/tags/standard-library.md>), [tagged-pointers](<https://devfeed.tech/tags/tagged-pointers.md>), [thread](<https://devfeed.tech/tags/thread.md>), [threads](<https://devfeed.tech/tags/threads.md>), [undefined-behavior](<https://devfeed.tech/tags/undefined-behavior.md>), [undefined-behaviour](<https://devfeed.tech/tags/undefined-behaviour.md>)

### AI overview

A report on the ISO C++ committee meeting in Brno, where work on C++29 began. It describes plans to organize and clarify documented undefined behavior and ill-formed-no-diagnostic-required cases, along with changes involving constexpr floating-point evaluation and other language rules.

### Source excerpt

Привет! На связи Антон Полухин из Техплатформы Городских сервисов Яндекса. Недавно в Брно состоялась встреча международного комитета по стандартизации языка программирования C++, в которой я принимал активное участие. В этот раз началась работа над C++29 и как раз о новинках и хочется рассказать. Читать далее

## Comparing Integers and Doubles

DevFeed: [Comparing Integers and Doubles](<https://devfeed.tech/articles/comparing-integers-and-doubles-25089.md>)

Original publisher: [Read original article](<https://databasearchitects.blogspot.com/2025/11/comparing-integers-and-doubles.html>)

Author: Thomas Neumann (noreply@blogger.com)

Published: 2025-11-10T16:55:00Z

Content type: article

Language: en

Sources: [Database Architects](<https://devfeed.tech/sources/database-architects.md>)

Topics: [floating-point](<https://devfeed.tech/topics/floating-point.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [DuckDB](<https://devfeed.tech/topics/duckdb.md>), [sql-server](<https://devfeed.tech/topics/sql-server.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [duckdb](<https://devfeed.tech/tags/duckdb.md>), [floating-point](<https://devfeed.tech/tags/floating-point.md>), [precision](<https://devfeed.tech/tags/precision.md>), [sql](<https://devfeed.tech/tags/sql.md>), [sql-server](<https://devfeed.tech/tags/sql-server.md>), [testing](<https://devfeed.tech/tags/testing.md>), [undefined-behavior](<https://devfeed.tech/tags/undefined-behavior.md>)

### AI overview

The article explains how comparing large integers with double-precision values can lose integer precision and produce non-transitive results in SQL systems. It describes how this can cause differences between ordinary comparisons and hash joins, and outlines a conversion-based approach for correct comparisons.

### Source excerpt

During automated testing we stumbled upon a problem that boiled down to transitive comparisons: If a=b, and a=c, when we assumed that b=c. Unfortunately that is not always the case, at least not in all systems. Consider the following SQL query: select a=b, a=c, b=c from (values( 1234567890123456789.0::double precision, 1234567890123456788::bigint, 1234567890123456789::bigint)) s(a,b,c) If you execute that in Postgres (or DuckDB, or SQL Server, or ...) the answer is (true, true, false). That is, the comparison is not transitive! Why does that happen? When these systems compare a bigint and a double, they promote the bigint to double and then compare. But a double has only 52 bits of mantissa, which means it will lose precision when promoting large integers to double, producing false positives in the comparison. This behavior is highly undesirable, first because it confuses the optimizer, and second because (at least in our system) joins work very differently: Hash joins promote to the most restrictive type and discard all values that cannot be represented, as they will never produce a join partner for sure. For double/bigint joins that leads to observable differences between joins and plain comparisons, which is very bad. How should we compare correctly? Conceptually the situation is clear, an IEEE 754 floating point with sign s, mantissa m, and exponent e represents the values (-1)^s*m*2^e, we just have to compare the integer with that value. But there is no easy way to do that, if we do a int/double comparison in, e.g., C++, the compiler does the same promotion to double, messing up the comparison. We can get the logic right by doing two conversions: We first convert the int to double and compare that. If the values are not equal, the order is clear and we can use that. Otherwise, we convert the double back to an integer and check if the conversion rounded up or down, and handle the result. Plus some extra checks to avoid undefined behavior (the conversion of intma

## Looking for Missed Alarm Bugs in a Formal Verification Tool

DevFeed: [Looking for Missed Alarm Bugs in a Formal Verification Tool](<https://devfeed.tech/articles/looking-for-missed-alarm-bugs-in-a-formal-verification-tool-39746.md>)

Original publisher: [Read original article](<https://blog.regehr.org/archives/2124>)

Author: regehr

Published: 2024-09-04T18:29:03Z

Content type: article

Language: en

Sources: [Embedded in Academia](<https://devfeed.tech/sources/embedded-in-academia.md>)

Topics: [Formal verification](<https://devfeed.tech/topics/formal-verification.md>), [LLVM](<https://devfeed.tech/topics/llvm.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [C](<https://devfeed.tech/topics/c.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [undefined\_behavior](<https://devfeed.tech/topics/undefined-behavior.md>)

Tags: [bugs](<https://devfeed.tech/tags/bugs.md>), [c](<https://devfeed.tech/tags/c.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [formal-verification](<https://devfeed.tech/tags/formal-verification.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [testing](<https://devfeed.tech/tags/testing.md>), [uncategorized](<https://devfeed.tech/tags/uncategorized.md>), [undefined-behavior](<https://devfeed.tech/tags/undefined-behavior.md>), [verification](<https://devfeed.tech/tags/verification.md>)

### AI overview

This co-authored article explains how formal verification tools themselves require rigorous engineering and testing. It describes testing Alive2, a translation validation tool for LLVM optimizations, including the challenge of finding missed-alarm bugs and the use of randomized program generation with YARPGen.

### Source excerpt

[This piece is co-authored with Vsevolod Livinskii.] Formal verification isn't some sort of magic pixie dust that we sprinkle over a computer system to make it better. Real formal verification involves a lot of the same kind of difficult, nasty, grungy engineering work that any other systems-level job involves. Furthermore, the verification tools themselves are [...]

## Blog: Falco Weekly 47 - 2023

DevFeed: [Blog: Falco Weekly 47 - 2023](<https://devfeed.tech/articles/blog-falco-weekly-47-2023-32510.md>)

Original publisher: [Read original article](<https://falco.org/blog/falco-w-47-2023-weekly-recap/>)

Published: 2023-11-24T00:00:00Z

Content type: article

Language: en

Sources: [Falco - Falco](<https://devfeed.tech/sources/falco-falco.md>), [Falco - The Falco blog](<https://devfeed.tech/sources/falco-the-falco-blog.md>)

Topics: [Falco](<https://devfeed.tech/topics/falco.md>), [ci](<https://devfeed.tech/topics/ci.md>), [undefined\_behavior](<https://devfeed.tech/topics/undefined-behavior.md>), [async](<https://devfeed.tech/topics/async.md>)

Tags: [blog](<https://devfeed.tech/tags/blog.md>), [changes](<https://devfeed.tech/tags/changes.md>), [ci](<https://devfeed.tech/tags/ci.md>), [falco](<https://devfeed.tech/tags/falco.md>), [improvements](<https://devfeed.tech/tags/improvements.md>), [undefined-behavior](<https://devfeed.tech/tags/undefined-behavior.md>), [weekly](<https://devfeed.tech/tags/weekly.md>)

### AI overview

A weekly Falco community recap covering cleanup and fixes across Falco libraries, including async event queue and statistics updates, planned tracer deprecation and architecture support, a new official adopter, Falcoctl driver-command work, and the Driverkit v0.16.0 release.

### Source excerpt

Another week, another load of improvements everywhere in the falcosecurity! What happened in Falco this week? Let's go through the major changes that happened in various repositories under the falcosecurity organization. Libs The anticipated 0.14.0 libs tag (and its driver counterpart) are a bit late, unfortunately. Anyway, spring cleaning went on this week! removed stopwatch implementation, now unused: https://github.com/falcosecurity/libs/pull/1493 removed unused sinsp_test.cpp file: https://github.com/falcosecurity/libs/pull/1499 removed jq dep: https://github.com/falcosecurity/libs/pull/1500 Moreover, some fixes on the recently introduced async event queue class happened: https://github.com/falcosecurity/libs/pull/1490, https://github.com/falcosecurity/libs/pull/1504. Finally, some fixes around the stats code: https://github.com/falcosecurity/libs/pull/1505, https://github.com/falcosecurity/libs/pull/1506. Rumors have it coming next week: New big cleanup: deprecation of tracers: https://github.com/falcosecurity/libs/pull/1503 ppc64le support for bpf and kmod + CI build jobs: https://github.com/falcosecurity/libs/pull/1497 remove old metaevents implementation: https://github.com/falcosecurity/libs/pull/1495 Small fix on top of ia32 work: https://github.com/falcosecurity/libs/pull/1501 Second part of an effort by Luca Guerra to clean up libsinsp from potential undefined behavior: https://github.com/falcosecurity/libs/pull/1502. This is so important that deserved to be left alone :) Falco We have a new official adopter! Welcome to Thought Machine: https://github.com/falcosecurity/falco/pull/2919 Small cleanup to avoid Falco configuratiom to be inited twice: https://github.com/falcosecurity/falco/pull/2917 Falcoctl The new driver command was merged! https://github.com/falcosecurity/falcoctl/pull/343 We are now in the process of adding tests and eventually fixing spotted bugs :) Also, the new asset artifact type PR is being reviewed: https://github.com/falcosecurity/

## Uninitialized Stack Variables

DevFeed: [Uninitialized Stack Variables](<https://devfeed.tech/articles/uninitialized-stack-variables-30260.md>)

Original publisher: [Read original article](<https://www.netmeister.org/blog/stack-vars.html>)

Published: 2021-11-25T03:46:08Z

Content type: article

Language: en

Sources: [Signs of Triviality](<https://devfeed.tech/sources/signs-of-triviality.md>)

Topics: [undefined\_behavior](<https://devfeed.tech/topics/undefined-behavior.md>)

Tags: [behavior](<https://devfeed.tech/tags/behavior.md>), [illustration](<https://devfeed.tech/tags/illustration.md>), [undefined-behavior](<https://devfeed.tech/tags/undefined-behavior.md>)

### AI overview

An illustration explains how uninitialized stack variables can lead to undefined behavior.

### Source excerpt

An illustration of how uninitialized stack variables can lead to undefined behavior.