Add debugging code to vm_objtostring in ASAN

To debug this issue on CI:
http://ci.rvm.jp/logfiles/brlog.trunk_asan.20240922-002945
This commit is contained in:
Peter Zhu 2024-09-23 11:56:29 -04:00
parent ecbc4a67c9
commit c32fd1b5ed
Notes: git 2024-09-25 15:00:28 +00:00

View file

@ -6056,6 +6056,13 @@ VALUE rb_mod_name(VALUE);
static VALUE
vm_objtostring(const rb_iseq_t *iseq, VALUE recv, CALL_DATA cd)
{
// Debugging code for ASAN issues such as:
// http://ci.rvm.jp/logfiles/brlog.trunk_asan.20240922-002945
if (asan_poisoned_object_p(recv)) {
asan_unpoison_object(recv, false);
rb_bug("vm_objtostring: recv is poisoned (type %d)", TYPE(recv));
}
int type = TYPE(recv);
if (type == T_STRING) {
return recv;