[#108552] [Ruby master Bug#18782] Race conditions in autoload when loading the same feature with multiple threads. — "ioquatix (Samuel Williams)" <noreply@...>
Issue #18782 has been reported by ioquatix (Samuel Williams).
11 messages
2022/05/14
[ruby-core:108534] [Ruby master Bug#18777] NDEBUG macro defined after including ruby.h
From:
"Kerilk (Brice Videau)" <noreply@...>
Date:
2022-05-12 20:23:22 UTC
List:
ruby-core #108534
Issue #18777 has been reported by Kerilk (Brice Videau).
----------------------------------------
Bug #18777: NDEBUG macro defined after including ruby.h
https://bugs.ruby-lang.org/issues/18777
* Author: Kerilk (Brice Videau)
* Status: Open
* Priority: Normal
* ruby -v: 3.0.2p107;3.1.2p20
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
Hello,
When using ruby 3+, including `ruby.h` results in the `NDEBUG` macro becoming defined, which deactivates assertions.
This simple (see attached `test.c` file) example illustrates this:
```C
#include <assert.h>
#include <ruby.h>
int main() {
assert(0);
return 0;
}
```
I expect:
```bash
gcc test.c
./a.out
```
To fail, and it does not. Commenting the `#include <ruby.h>` yields the expected result.
I found several discussion in the issues regarding `NDEBUG` in Ruby 3+, but none seem to describe this particular behavior. Sorry if I missed something.
Thanks.
---Files--------------------------------
test.c (79 Bytes)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>