# New Ticket Created by Dan Zwell # Please include the string: [perl #132447] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=132447 >
The exception is: Cannot assign to an immutable value in method slurp at SETTING::src/core/IO/Handle.pm line 698 in method slurp at SETTING::src/core/IO/Path.pm line 603 in block at ./concurrency-test.p6 line 40 in block at SETTING::src/core/Promise.pm line 217 in block at SETTING::src/core/ThreadPoolScheduler.pm line 284 in block at SETTING::src/core/ThreadPoolScheduler.pm line 173 in block at SETTING::src/core/ThreadPoolScheduler.pm line 166 in block at SETTING::src/core/ThreadPoolScheduler.pm line 163 I've observed this error on both Linux and Windows 10, on the September and October Rakudo releases. It's intermittent, so I use a shell loop to run my test case repeatedly until the problem occurs: while perl6 ./concurrency-test.p6 $DIR; do :; done (where $DIR is any directory that contains several thousand files.) This problem only occurs with slurp. When I instead open a file handle, read its full contents with `.lines.cache`, then close the handle, there is no exception. The test case I used to show this issue is uploaded here: https://gist.github.com/lefth/6d71ca714ca2dc184220a91ceb41334d