{"slug": "undefinedbehaviorsanitizer", "name": "UndefinedBehaviorSanitizer", "category": "other", "category_name": "Other software", "description": "", "recommenders": 3, "commenters": 5, "warners": 0, "score": 3.226, "rising": 0.35, "first": "2025-11-14", "latest": "2026-10-30", "why": "Tools like UBsan [1] can detect integer overflow in debug builds, and are used internally at Google to run automated tests.", "why_is_quote": true, "has_verdict": false, "sentiment": {"recommend": 3, "neutral": 2, "compare": 0, "warn": 0}, "spark": [1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0], "listed": true, "loved": [], "caveat": "", "short_quote": "Tools like UBsan [1] can detect integer overflow in debug builds, and are used internally at Google to run automated tests.", "kind": "", "icon": true, "domain": "llvm.org", "github_repo": null, "official_url": "https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html", "pricing": "", "aliases": ["UBSan", "UndefinedBehaviorSanitizer"], "verdict": null, "praise": [{"label": "", "summary": "", "quotes": [{"id": 786444129, "item_id": 49152758, "url": "https://news.ycombinator.com/item?id=49152758", "by": "pg83", "date": "2026-08-03", "version": null, "stance": "recommend", "quote": "asan/ubsan agree with me", "excerpt": "Yes, \"blazingly fast\", but not in Rust! In fact, I have my own development model in C++, which allows me to write at approximately the same level of safety that Rust provides (at least, I think so, and asan/ubsan agree with me) - https://github.com/pg83/std/blob/master/README.md", "context": "", "use_case": "undefined behavior detection", "switched_from": "", "story": "Show HN: Shitty \u2013 fast terminal. Memory-unsafe and faster than yours"}, {"id": 783650849, "item_id": 48978178, "url": "https://news.ycombinator.com/item?id=48978178", "by": "Ygg2", "date": "2026-07-20", "version": null, "stance": "recommend", "quote": "run this with UBSAN, ASAN, and other C tools", "excerpt": "> Proof: You just listed examples of unbounded lifetimes. > I said \"effectively disable\". For example: Not sure what you meant by this example since it doesn't compile. It seems the borrow checker caught your mischief. So much for effectively disabling stuff :P You haven't effectively disabled anything; you just (tried to) wrote unsound code that washes one mutable ref as another. This stuff is allowed provided share", "context": "", "use_case": "", "switched_from": "", "story": "Claude Code uses Bun written in Rust now"}, {"id": 734825856, "item_id": 45926616, "url": "https://news.ycombinator.com/item?id=45926616", "by": "sltkr", "date": "2025-11-14", "version": null, "stance": "recommend", "quote": "Tools like UBsan [1] can detect integer overflow in debug builds, and are used internally at Google to run automated tests.", "excerpt": "Tools like UBsan [1] can detect integer overflow in debug builds, and are used internally at Google to run automated tests. So if you use a signed integer, there is a chance that overflows are caught in tests. 1. https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html", "context": "", "use_case": "catching integer overflow in tests", "switched_from": "", "story": "V8 Garbage Collector"}]}], "caveats": [], "who": [], "tags": [], "use_cases": ["undefined behavior detection", "catching undefined behavior", "catching integer overflow in tests"], "compared": [{"slug": "addresssanitizer", "name": "AddressSanitizer", "co": 3, "switched_from": 0, "switched_to": 0}], "makers": [], "threads": [{"url": "https://news.ycombinator.com/item?id=50249598", "title": "Iterating Backwards in C", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=49149326", "title": "Show HN: Shitty \u2013 fast terminal. Memory-unsafe and faster than yours", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=48966569", "title": "Claude Code uses Bun written in Rust now", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=46020730", "title": "Hardening the C++ Standard Library at scale", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=45925431", "title": "V8 Garbage Collector", "mentions": 1}], "sentiment_by_month": {"2025-11": {"recommend": 1, "neutral": 1}, "2025-12": {}, "2026-01": {}, "2026-02": {}, "2026-03": {}, "2026-04": {}, "2026-05": {}, "2026-06": {}, "2026-07": {"recommend": 1}, "2026-08": {"recommend": 1}, "2026-09": {}, "2026-10": {"neutral": 1}}, "versions": [], "version_unnamed": 0, "family_ref": null, "runs_on": null, "lines": [], "quotes": [{"id": 804893040, "item_id": 50305815, "url": "https://news.ycombinator.com/item?id=50305815", "by": "seeknotfind", "date": "2026-10-30", "version": null, "stance": "neutral", "quote": "Ubsan is a misnomer here from a technical perspective.", "excerpt": "Ubsan is a misnomer here from a technical perspective. However overflow unsigned or not is unexpected in many cases. As such, sanitizing it (and many other hard to reason about behaviors) by default is great practice. For an example, when unsigned values are used to count, overflows from summing over 2**N often result in incorrect behavior. This may be incrementing or even counting beans. One particularly famous exam", "context": "", "use_case": "", "switched_from": "", "story": "Iterating Backwards in C"}, {"id": 786444129, "item_id": 49152758, "url": "https://news.ycombinator.com/item?id=49152758", "by": "pg83", "date": "2026-08-03", "version": null, "stance": "recommend", "quote": "asan/ubsan agree with me", "excerpt": "Yes, \"blazingly fast\", but not in Rust! In fact, I have my own development model in C++, which allows me to write at approximately the same level of safety that Rust provides (at least, I think so, and asan/ubsan agree with me) - https://github.com/pg83/std/blob/master/README.md", "context": "", "use_case": "undefined behavior detection", "switched_from": "", "story": "Show HN: Shitty \u2013 fast terminal. Memory-unsafe and faster than yours"}, {"id": 783650849, "item_id": 48978178, "url": "https://news.ycombinator.com/item?id=48978178", "by": "Ygg2", "date": "2026-07-20", "version": null, "stance": "recommend", "quote": "run this with UBSAN, ASAN, and other C tools", "excerpt": "> Proof: You just listed examples of unbounded lifetimes. > I said \"effectively disable\". For example: Not sure what you meant by this example since it doesn't compile. It seems the borrow checker caught your mischief. So much for effectively disabling stuff :P You haven't effectively disabled anything; you just (tried to) wrote unsound code that washes one mutable ref as another. This stuff is allowed provided share", "context": "", "use_case": "", "switched_from": "", "story": "Claude Code uses Bun written in Rust now"}, {"id": 737601553, "item_id": 46100097, "url": "https://news.ycombinator.com/item?id=46100097", "by": "steveklabnik", "date": "2025-11-30", "version": null, "stance": "neutral", "quote": "I thought it should too, but it doesn't seem to", "excerpt": "I thought it should too, but it doesn't seem to, unless I made a mistake, which I probably did: https://godbolt.org/z/Ex63vxj4r", "context": "", "use_case": "catching undefined behavior", "switched_from": "", "story": "Hardening the C++ Standard Library at scale"}, {"id": 734825856, "item_id": 45926616, "url": "https://news.ycombinator.com/item?id=45926616", "by": "sltkr", "date": "2025-11-14", "version": null, "stance": "recommend", "quote": "Tools like UBsan [1] can detect integer overflow in debug builds, and are used internally at Google to run automated tests.", "excerpt": "Tools like UBsan [1] can detect integer overflow in debug builds, and are used internally at Google to run automated tests. So if you use a signed integer, there is a chance that overflows are caught in tests. 1. https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html", "context": "", "use_case": "catching integer overflow in tests", "switched_from": "", "story": "V8 Garbage Collector"}]}