Skip Menu |
Report information
Id: 127974
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: smls75 [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: testneeded
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: sprintf() not threadsafe/reentrant if the format tokens use explicit indices
Download (untitled) / with headers
text/plain 623b
The following works fine: say sprintf '%1$s %2$s', 5, 42; But the following fails: await do for ^100 { start { say sprintf '%1$s %2$s', 5, 42 } } ## Camelia-friendly version: # for (^100).race(batch=>1) { sprintf '%1$s %2$s', 5, 42 } It prints a few successful iterations, but at some point dies with «Your printf-style directives specify 0 arguments, but 2 arguments were supplied». The error only occurs if the format directives specify explicit argument indices. If the '%1$s %2$s' format is replaced with '%s %s' in the example above, it completes without error.
Download (untitled) / with headers
text/plain 762b
Still present in 959cd3 <Zoffix> m: for (^100).race(batch=>1) { sprintf '%1$s %2$s', 5, 42 } <camelia> rakudo-moar 959cd3: OUTPUT«(signal ABRT)*** Error in `/home/camelia/rakudo-m-inst-1/bin/moar': double free or corruption (fasttop): 0x0000000004383d80 ***␤======= Backtrace: =========␤/lib64/libc.so.6(+0x730bf)[0x7f2af7fb40bf]␤/lib64/libc.so.6(+0x7892e)[0x7f2af7fb992e]␤/lib6…» <Zoffix> m: for (^100).race(batch=>1) { sprintf '%1$s %2$s', 5, 42 } <camelia> rakudo-moar 959cd3: OUTPUT«Your printf-style directives specify 0 arguments, but 2 arguments were supplied␤ in any at /home/camelia/rakudo-m-inst-1/share/perl6/runtime/CORE.setting.moarvm line 1␤ in any panic at /home/camelia/rakudo-m-inst-1/share/nqp/lib/NQPHLL.moarvm line 1…»
Download (untitled) / with headers
text/plain 131b
Still present in Rakudo version 2017.05-272-gfa7aa1c36 built on MoarVM version 2017.05-25-g62bc54e9 implementing Perl 6.c.
Download (untitled) / with headers
text/plain 785b
On Sun, 28 May 2017 02:34:13 -0700, smls75@gmail.com wrote: Show quoted text
> Still present in > > Rakudo version 2017.05-272-gfa7aa1c36 built on MoarVM version 2017.05- > 25-g62bc54e9 > implementing Perl 6.c.
Fixed, probably by one or more of the following commits: 7c18112c59d20413b82356e5c48b38d8a66fc7ea c285b489c6629ccdf0c4cb11d2d695b9ef1f890c 7fcab1067de4757bfdf2fdd1c66893ce4ab06e1b 89b9ac7830bdc195cb303f5241641e0dbe0ebbde 683037be698d0bdc21b3c23588085b2d076d7a0a b5605c2dd6d361b705a59136c8ad641f245a5da5 c50d35a90e66346157b31cd92643c2a64e801c24 de311f46a98f13a5b0211d2585fbd9b17ce1bf2c 340d8ed3bb4b45af85708771bea396cf862a7330 3b98fb9e396d040a8cb2c32d23cee54a5e88f878 596611c8fdc3baf119bc94a8ea30efc0a12cf673 80b49320cf854ac68a17cdd216575ee26e380325 61a77e60a7d936415503d8916fcc7546569e9135


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org