Attachment "c35e347c6f-encoding-user-race.tcl" to
ticket [c35e347c6f]
added by
serhiy.storchaka
2026-10-18 21:43:18.
# Several threads calling [encoding user] at the same time.
# Crashes on OpenBSD (double free in setlocale()).
package require Thread
set threads {}
for {set i 0} {$i < 8} {incr i} {
lappend threads [thread::create -joinable {
for {set j 0} {$j < 20000} {incr j} {
encoding user
}
}]
}
foreach t $threads {
thread::join $t
}
puts ok