Subject: | Incorrect use of apply causes sort to segfault in XS |
Date: | Fri, 20 Jun 2014 19:25:48 +0200 |
To: | bug-List-MoreUtils [...] rt.cpan.org |
From: | Sven Schöling <s.schoeling [...] linet-services.de> |
The following code segfaults:
perl -MList::MoreUtils=apply -le '@a = sort apply 1,2'
Only the XS version segfaults, the pure perl version works fine. I tested it on the following (sparse) list of versions I have available:
5.12.[24] - works
5.14.2 - works
5.15.5 - segfault
5.16.0 - segfault
5.18.0 - segfault
5.19.11 - segfault
Both 0.33 and 0.400_009 are affected.
I tried to reproduce it with List::Util::reduce, but can seem to convince sort to use it as a compare function.
--
Sven Schöling