<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/internal/sanitizers.h, branch v4.0.4</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Disable TSAN for rb_gc_mark_machine_context</title>
<updated>2025-07-24T23:35:42+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2025-07-18T23:06:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7f25b8f5fb95e547353c3cbf426bb39ec9150fe2'/>
<id>7f25b8f5fb95e547353c3cbf426bb39ec9150fe2</id>
<content type='text'>
Previously this was listed as a suppression, but we actually want this
permanently unsanitized. This should be faster and more reliable since
TASN won't have to match against symbolicated backtraces.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously this was listed as a suppression, but we actually want this
permanently unsanitized. This should be faster and more reliable since
TASN won't have to match against symbolicated backtraces.
</pre>
</div>
</content>
</entry>
<entry>
<title>Inline ASAN poison functions when ASAN is not enabled</title>
<updated>2025-06-30T14:25:58+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2025-06-27T12:51:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ead3739c34b50b081140f1206cd36f13fc7db8ee'/>
<id>ead3739c34b50b081140f1206cd36f13fc7db8ee</id>
<content type='text'>
The ASAN poison functions was always defined in gc.c, even if ASAN was not
enabled. This made function calls to happen all the time even if ASAN is
not enabled. This commit defines these functions as empty macros when ASAN
is not enabled.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The ASAN poison functions was always defined in gc.c, even if ASAN was not
enabled. This made function calls to happen all the time even if ASAN is
not enabled. This commit defines these functions as empty macros when ASAN
is not enabled.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make ASAN default option string built-in libruby</title>
<updated>2025-03-16T08:33:58+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-03-14T07:24:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=453f88f7f1c339a5256bc3a2c733610cc3ee965c'/>
<id>453f88f7f1c339a5256bc3a2c733610cc3ee965c</id>
<content type='text'>
The content depends on ruby internal, not responsibility of the
caller.  Revive `RUBY_GLOBAL_SETUP` macro to define the hook function.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The content depends on ruby internal, not responsibility of the
caller.  Revive `RUBY_GLOBAL_SETUP` macro to define the hook function.
</pre>
</div>
</content>
</entry>
<entry>
<title>Prefix asan_poison_object with rb</title>
<updated>2024-12-19T14:14:34+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-12-18T17:01:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a58675386c10f4183116056bc0cf289548883ac0'/>
<id>a58675386c10f4183116056bc0cf289548883ac0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Export asan_poison_object</title>
<updated>2024-12-19T14:14:34+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-12-13T18:46:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a72717675f0ddaa07127ea2fa25b7c1e271fdbce'/>
<id>a72717675f0ddaa07127ea2fa25b7c1e271fdbce</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Make asan_poison_object poison the whole slot</title>
<updated>2024-12-19T14:14:34+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-12-11T17:18:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c37bdfa5311be0aa8503b995299fb9547cede0a6'/>
<id>c37bdfa5311be0aa8503b995299fb9547cede0a6</id>
<content type='text'>
This change poisons the whole slot of the object rather than just the flags.
This allows ASAN to find any reads/writes into the slot after it has been
freed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change poisons the whole slot of the object rather than just the flags.
This allows ASAN to find any reads/writes into the slot after it has been
freed.
</pre>
</div>
</content>
</entry>
<entry>
<title>Detect ASAN when using older GCC versions</title>
<updated>2024-12-16T22:11:36+00:00</updated>
<author>
<name>Alan Wu</name>
<email>alanwu@ruby-lang.org</email>
</author>
<published>2024-12-16T22:11:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2102fe32ff8191ad51001daf57a1ed09a1ebc824'/>
<id>2102fe32ff8191ad51001daf57a1ed09a1ebc824</id>
<content type='text'>
Newer GCCs have __has_feature and older ones have
__SANITIZE_ADDRESS__[1]. Relevant since ASAN with GCC 11 on the popular
Ubuntu Jammy failed to build previously.

[1]: https://gcc.gnu.org/onlinedocs/gcc-4.8.0/cpp/Common-Predefined-Macros.html
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Newer GCCs have __has_feature and older ones have
__SANITIZE_ADDRESS__[1]. Relevant since ASAN with GCC 11 on the popular
Ubuntu Jammy failed to build previously.

[1]: https://gcc.gnu.org/onlinedocs/gcc-4.8.0/cpp/Common-Predefined-Macros.html
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS for MSAN</title>
<updated>2024-12-04T19:29:24+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-11-29T21:08:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3c91a1e5fda8b3e03348dc533dcf292a598f1f77'/>
<id>3c91a1e5fda8b3e03348dc533dcf292a598f1f77</id>
<content type='text'>
There's no case for when RUBY_MSAN_ENABLED, so the macro ends up doing
nothing when it should instead have __attribute__((__no_sanitize__("memory"))).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There's no case for when RUBY_MSAN_ENABLED, so the macro ends up doing
nothing when it should instead have __attribute__((__no_sanitize__("memory"))).
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix extra semicolon outside of a function in `NO_SANITIZE`</title>
<updated>2024-10-08T14:29:49+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-10-08T12:25:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8ba2c3109c0f80f285b8db2fed10d8f5f026c208'/>
<id>8ba2c3109c0f80f285b8db2fed10d8f5f026c208</id>
<content type='text'>
```
internal/sanitizers.h:57:26: error: ISO C does not allow extra ‘;’ outside of a function [-Wpedantic]
   57 |     COMPILER_WARNING_PUSH; \
      |                          ^
```

and so many.

Remove semicolons following pragma, and repeat the given declaration
at the end to consume a semicolon following the macro call.  As many
`NO_SANITIZE` calls including bigdecimal that is a gem have a trailing
semicolon, it was not able to move the semicolon inside `NO_SANITIZE`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
```
internal/sanitizers.h:57:26: error: ISO C does not allow extra ‘;’ outside of a function [-Wpedantic]
   57 |     COMPILER_WARNING_PUSH; \
      |                          ^
```

and so many.

Remove semicolons following pragma, and repeat the given declaration
at the end to consume a semicolon following the macro call.  As many
`NO_SANITIZE` calls including bigdecimal that is a gem have a trailing
semicolon, it was not able to move the semicolon inside `NO_SANITIZE`.
</pre>
</div>
</content>
</entry>
<entry>
<title>Unpoison page-&gt;freelist before trying to assert on it</title>
<updated>2024-09-23T00:11:54+00:00</updated>
<author>
<name>KJ Tsanaktsidis</name>
<email>kj@kjtsanaktsidis.id.au</email>
</author>
<published>2024-09-21T11:11:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=02b36f75721aa61d48e3031c71695837d7a8a410'/>
<id>02b36f75721aa61d48e3031c71695837d7a8a410</id>
<content type='text'>
Otherwise trying to deref the pointer can cause an ASAN crash, even
though the only reason we're dereferencing it is so that we can assert
on it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Otherwise trying to deref the pointer can cause an ASAN crash, even
though the only reason we're dereferencing it is so that we can assert
on it.
</pre>
</div>
</content>
</entry>
</feed>
