Re:The case of the critical section that let multiple thread...
by probably_wrong on Monday March 24, 2025 @10:27AM
(#43461489)
The original bug was returning STATUS_SUCCESS to indicate that a function had succeeded without noticing that STATUS_SUCCESS is defined as 0 in a function that's expected to return a non-zero value on success. This specific error could have happened on any language - defining two different return types and using the wrong one could happen in any language.
[ Parent
| on HN ]
Re:The case of the critical section that let multiple thread...
by andy12_ on Monday March 24, 2025 @01:51PM
(#43463627)
> defining two different return types and using the wrong one could happen in any language
This specifically is the kind of bug that is avoided with strong typing. The compiler screams at you when using the wrong return type. For example, if a callback expects a Result type, you must return a Result type, not some random int-like value whose definition of success and failure is arbitrary.