rb_str_resize(Qfalse, 0)
with NKF and without C extensions lock
#3625
Labels
rb_str_resize(Qfalse, 0)
with NKF and without C extensions lock
#3625
Found by @mohamedhafez and reported on Slack:
So this must be a call to
rb_str_resize(str, 0)
withstr=0
but of course it shouldn't be 0.Looking at NKF sources, there is a single call to
rb_str_resize
:truffleruby/src/main/c/nkf/nkf.c
Line 47 in 938589f
result
is a global variable 😨truffleruby/src/main/c/nkf/nkf.c
Line 40 in 938589f
truffleruby/src/main/c/nkf/nkf.c
Lines 164 to 168 in 938589f
So that is very likely the issue.
One solution is to use a native thread-local variable instead.
Or pass it as an extra parameter but that would require touching more of the upstream nkf code.
Or, always use the C extensions lock/a lock for NKF.
The text was updated successfully, but these errors were encountered: