Issue #10139 has been reported by Tomoyuki Chikanaga.

----------------------------------------
Backport #10139: Backport r47190 (use RBASIC_SET_CLASS_RAW in setup_fake_str())
https://bugs.ruby-lang.org/issues/10139

* Author: Tomoyuki Chikanaga
* Status: Assigned
* Priority: Normal
* Assignee: Tomoyuki Chikanaga
----------------------------------------
From commit message

    fake strings should not set class by
    RBASIC_SET_CLASS() because it insert write barriers to fake
    (non-RVALUE) structure.
    It can cause unexpected behaviour.
    Ruby 2.1 also have a same problem (setup_fake_str() in parse.y).



-- 
https://bugs.ruby-lang.org/