This Week on perl5-porters - 6-12 April 2008

grinder on 2008-04-15T22:41:00

This Week on perl5-porters - 6-12 April 2008

David Nicol: I have no idea what NaN(Q) is by the way; Google suggests it is a furniture store in Japan.

Jarkko Hietaniemi: It's the strong, silent type of NaN. As opposed to the hysteric, screaming type of NaN (aka NaNS).

-- David N. and Jarkko H., arcing tangents.

Topics of Interest

Make built-in list functions continuous

David Nicol continued the "unroll map into pushy for loops" thread with a decent stab at an implementation using his Macrame macro processing module.

Aristotle Pagaltzis stressed the usefulness of having a map block producing n elements for each input element, where n could be a fixed number greater than 1, an arbitrary number greater than 1, sometimes 0, and anything in between.

Some map blocks that use such behaviours lead to remarkably concise code that would be very cumbersome to write in any other way.

  http://xrl.us/bje2q 

Perl @ 33536

The perl 5.8.9-tobe thread continued to attract traffic this week. Jan Dubois reported back on the problems that the Vista platform was causing.

It boils down to the tradeoff between keeping the binary interface stable while preventing people from outside the core build from reaching directly into the guts. All you have to do is define PERL_CORE and you can do whatever you want.

Jan suggested that one way to do this would be to reorder the struct members, on purpose, on each maintenance release. That would quickly smoke out poorly-behaved modules and make them play by the rules.

Not so unsurprisingly, this met with a certain amount of favour with the porters; at least, it wasn't dismissed out of hand.

  keep your mits off
  http://xrl.us/bje2u 

Saving a pointer in every COP?

Nicholas Clark had a brainwave, realising that it should be feasible to shave off a whole pointer from each COP struct. Sixteen hours later, he delivered the patch to do just that.

He did leave us something to do, though: prove or disprove that it made things go faster.

  something to do^W^Wdone
  http://xrl.us/bje2w 

Jerry D. Hedden managed to spot a minor compiler warning, which Nicholas promptly fixed.

  but no benchmarks
  http://xrl.us/bje2y 

using -Wall in modules generate tons of warnings in core files

Gábor Szabó set about trying to build Prima with the 5.10 Strawberry Perl distribution, and ran into grief over poorly nested comments (as in /* foo /* bar */).

Andy Dougherty explained that this problem also arose with fussy compilers on Unix platforms, and there the issue was addressed by substituting / * (with a space) for the inner opening comment marker. It was therefore a simple matter of inspection to figure out how config.h was generated by Strawberry.

Jan Dubois took a look at win32/config_h.PL and found a substitution operator that looked like it was to blame. Andy showed how the Configure process used a sed one-liner to work around the damage.

  http://xrl.us/bje22 


TODO of the week

Last week's TODO caught James Bence's attention, so much so that he outlined an approach he wanted to try and wondered if it would be acceptable. Rafael Garcia-Suarez explained why it wouldn't (as it would add to the burden of the pumpking). The primary design consideration is that it must be able to go about its business in a completely autonomous manner. That is, no sneaky command-line switches to spoon-feed it what needs to be done.

  figure out what it should do, then make it do it
  http://xrl.us/bje24 

(I should also mention that this whole TODO idea of the week is not my own, bla^Wcredit must be given to Nicholas Clark).

Compressed man pages

Be able to install them. This would probably need a configure test to see how the system does compressed man pages (same directory/different directory? Same filename/different filename), as well as tweaking the installman script to compress as necessary.

(I suspect even getting this working for two common platforms, such as Linux, *BSD or Solaris, would be a fine start. Other local experts on other platforms could piggy-back the work done to hit other targets).


Patches of Interest

Double magic with '\&$x'

Rafael Garcia-Suarez applied Vincent Pit's patch. Vincent had also questioned the wisdom of allowing magic to be triggered merely by the gathering of information to produce an error message.

Rafael commented that while in essence Vincent was correct, the unresolved problem about what to do about code in the wild that may depend of the precise text of an error message meant that it was probably wiser just to let sleeping dogs lie.

  so won't fix
  http://xrl.us/bje26 

Make PL_AMG_names and PL_AMG_namelens static

Nicholas Clark wrapped up the discussion explaining why these symbols that had leaked out accidentally in 5.10 had to stay: some linkers might blow up in their subsequent disappearance, even if the client code makes no reference to them.

  lazy lazy dynamic loading
  http://xrl.us/bje28 

is_gv_magical correctly checks "ISA"

Gerard Goossen, going through the code with a fine-toothed comb for his ongoing Kurila project, spotted a mistake due to incorrect aliasing of a C array. It could never have worked, but then again no-one ever had problems with it. In any event, Rafael applied the change since the test suite appears to remain satisfied.


  and it does the right thing
  http://xrl.us/bje3a 

changes to perlsec.pod and call for removal of quicksort

John P. Lindeman offered a patch to clean some of the more glaring documentation errors regarding sort in perlsec, and this was applied by Rafael. He also suggested that the sort subsystem based on the Quicksort algorithm be removed, since these days the default mergesort has much better worst-case characteristics for any pathological set of data you care to throw at it.

Tom Horsley, who wrote the original implementation of quicksort for perl, made no impassioned claim to keep it in, admitting that in fact he thought the code had been axed years ago.

  out of sorts
  http://xrl.us/bje3c 


New and old bugs from RT

regexp: unicode char causes a 'double free corruption' (#48156)

Niko Tyni identified the changes which had fixed this bug, but noted that it is still present in the version of perl shipped with Debian stable (no sniggering up in the back row please). Don Armstrong, in the Debian bug report, believes that it may allow arbitrary code to be executed, which if true, would be very serious indeed.


  http://xrl.us/bje3r 

[[:print:]] versus \p{Print} (#49302)

David Landgren offered a couple of tweaks to Robin Barker's prose. Juerd Waalboer also identified a mistake.

  or at least, a counter-example
  http://xrl.us/bje3t 

pack 'A*' and pack 'a*' untaint data in 5.10.0 (#52552)

Christopher E. Stith was surprised by the fact that in 5.10, the pack formats 'a' and 'A' strip tainting off untrusted input, whereas 5.8 leaves it tainted. Andreas König identified change #24010 as the cause for the change in behaviour. Alas, that particular change touched over a dozen files (although 4 were POD files, and, surprise pp_pack.c was touched)...

  the monks have a go
  http://www.perlmonks.org/?node_id=678463 
  I blame Unicode
  http://xrl.us/bje3v 

Unwanted warning from XS BOOT (#52572)

  reading the fine documentation leads to resolution
  http://xrl.us/bje3x 

Bizarre copy of ARRAY in sassign at Carp/Heavy.pm (#52610)

Chris Heath reported a variation on the bizarre copy theme, seen regularly with Carp. Nicholas Clark thanked him for the report, which contained a snippet of code that he was able to shrink down even farther.

This led him to conclude that the heart of the matter is an unwanted interaction between Perl's internal stack and lexical pads, but had no insight as to what exactly was happening.

  http://xrl.us/bje3z 

Perl 5.10 regression bug in match and substitution evaluation in list context (#52658)

Wolf-Dietrich Möller spotted a regression between 5.8 and 5.10 concerning the use of an e modifier on a s/// operator. Nicholas Clark was dismayed to discover that the bug is also in 5.8.9-tobe, definitely not good.

Andreas König fired up his binary search bug finder, and discovered that not one, but two separate changes (#26332 and #26334) was at fault. The first patch dealt with accelerating s///e expressions by freeing intermediate temporaries, and the second dealt with s///e that die in the right hand side result in memory leaks.

  we got oursel's a show-stopper
  http://xrl.us/bje33 

regexp failure: (?=) turns into OPFAIL (#52672)

L. Mai reported another failure due to the 5.10 regexp engine overhaul: the "match always" (?=) idiom flipped over to mean "match never". Fortunately Ævar Arnfjörð Bjarmason came to the rescue with a short, sharp patch to engine to restore the previous behaviour.

  we do test for this now, right?
  http://xrl.us/bje35 

Consistent localization between foreach (...) and while (<fh>) (#52702)

Ed Avis wanted to have warnings issued when $_ was modified, due to differences in how while and for behave. Rafael Garcia-Suarez thought that using my $_ in 5.10 was a much better idea.

  http://xrl.us/bje37 

crash when localizing a symtab entry (#52740)

Niko Tyni reported a failure smoking mod_perl2 2.0.4rc1 on 5.10, due to the new implementation of constant subroutines, going so far as to identify change #29544 as being the (ir)responsible party. No takers.

  http://xrl.us/bje39 

Crash perl with binmode(STDOUT, ':encoding(wildybad)') (#52786)

Todd Olson that one can make perl crash and burn on a variety of platforms by giving it nothing more than a bogus I/O encoding name.

  http://xrl.us/bje4b 

Perl5 Bug Summary

  1811 (+8 -4)
  http://xrl.us/bje4d
  http://rt.perl.org/rt3/NoAuth/perl5/Overview.html 


New Core Modules

Math::BigRat version 0.22

Tels synched blead with CPAN, applied by Rafael.

  http://xrl.us/bje4f 


In Brief

Nicholas Clark committed change #33657 to split out S_refcounted_he_new_common() from Perl_refcounted_he_new_common() after having tested it out on four different machines. Alas, it still managed to break the build for Jerry D. Hedden. Fortunately, Nicholas was able to commit the subsequent change #33659 that fixed up the breakage.

  http://xrl.us/bje4h 

Sérgio Durigan Júnior wondered about the status of the -m32 flag that is planned for 5.12, which would allow a 32-bit perl to be built on a 64-bit platform. H.Merijn Brand said that for the moment it was a non-starter.

  imagine -Duse64bitall in reverse
  http://xrl.us/bje4j 

The atan2 thread kicked up far more than you would ever want to know about NaNs.

  http://xrl.us/bje4m 

Kurt Starsinic fixed up a long-standing perldata.pod typo.

  http://xrl.us/bje4o 

Alberto Simões took a shot at benchmarking the differences between say and print .

  take two
  http://xrl.us/bje4q 

How not to file a bug. (was: IO::Socket::accept() doesn't fill io_socket_proto information in sockets).

  http://xrl.us/bje4s 

Tels wanted to know if a delivery date for perl 5.8.9 had been fixed, as this would help him figure out what to do with warnings occurring in Math::BigInt. Yitzchak Scott-Thoennes suggested that it should warn at all during normal usage.

  http://xrl.us/bje4u 

Vincent Pit had some perlclib.pod tweaks applied.

  memset, strtod and friends
  http://xrl.us/bje4w 

He also made emacs users the world over insanely jealous with a cool patch to make autodoc generate a Vim XS syntax file. He admitted it was slightly frivolous and probably not worth taking, but Vim lovers should be happy to know it's out there.

  you also need to love XS
  http://xrl.us/bje4y 

Reini Urban offered an experimental work-in-progress patch for the upcoming cygwin-1.7 release with UTF-8 path support.

  oh the pain
  http://xrl.us/bje42 

Last week's summary

  30 March-5 April 2008
  http://xrl.us/bje44 

About this summary

This summary was written by David Landgren. I plan to be offline next week; there will be no summary for 13-19 April. The summary will return the following week, with a bumper fortnight issue.

Weekly summaries are published on http://use.perl.org/ and posted on a mailing list, (subscription: perl5-summary-subscribe@perl.org ). The archive is at http://dev.perl.org/perl5/list-summaries/ . Corrections and comments are welcome.

If you found this summary useful, please consider contributing to the Perl Foundation or attending a YAPC to help support the development of Perl.