This Week on perl5-porters - 3-9 November 2008

grinder on 2008-11-18T23:16:00

This Week on perl5-porters - 3-9 November 2008

"PS: Hi, guys. Been a while. How you been?" -- Chip Salzenberg, back on the chain gang.

Topics of Interest

version.pm synopsis thoughts and an additional version.pm affordance

David Golden made good on his promise to write a better synopsis for version.pm to help steer people out of trouble when dealing with version numbers and their comparisons.

Michael G. Schwern pointed out a couple of places where things weren't locked down, but said that he thought David's take was much clearer. But as usual in matters of versioning, counter examples popped up to muddy the waters.

  http://xrl.us/oxqwy 

Should [:upper:] match title case?

Karl Williamson read the documentation and saw that [:upper:] should match title case, except that it doesn't, and an undocumented \p{IsTitle} does. What to do?

Tom Christiansen noted that there is still a lot of POSIXy stuff that Perl doesn't do, but that part of the reason for that is that it's full of subtlety and traps for the unwary. He would really like to see a decent collation infrastructure in Perl, but Jarkko Hietaniemi said that the issues are insanely difficult to resolve.

  http://xrl.us/oxqw2 

Perl 5.8.8 34711 on AIX 5.3

Rainer Tammer sent in the information he had gleaned from building what will be 5.8.9 on AIX 5.3. He wondered whether it was worth the effort to continue to deal with 5.1 since it is no longer supported. H.Merijn Brand explained that the porters have a long traditional of continuing to support Perl on orphaned architectures; all that's really needed is shell access.

H.Merijn and Andy Dougherty offered some suggestions and insights to help Rainer move forward.

  http://xrl.us/oxqw4 

In a 64-bit build, Rainer had exactly one failure in lib/ExtUtils/t/Embed.t.

  http://xrl.us/oxqw6 

$Config{archname} on AMD64 Windows

Sisyphus had trouble keeping track of the differences between 32-bit and 64-bit builds on his Vista box. Jan Dubois and Steve Hay provided the vital clues to help him figure out what he should be doing.

  http://xrl.us/oxqw8 

Future maintenance plans for 5.8.x

Nicholas Clark added a paragraph to perl589delta explaining that this release (perl 5.8.9) was likely to be the last of the 5.8 series.

Jan Dubois pointed out that 5.10.0 has a "testing" feel to it, to which Dave Mitchell stated that his plan was to have 5.10.1 out by the end of the year as well.

Matt S. Trout mentioned that he had found that users of DBIx::Class do pay attention to EXPERIMENTAL labels, and don't mind as much when things break. But he'd love to figure out how to get them to take development snapshots for a spin on a regular basis.

  this is the end my friend
  http://xrl.us/oxqxa 

Change PREFIX to INSTALL_BASE in perlfaq8 and perlmodinstall

Michael G. Schwern noticed a dead meme still doing the round, on stackoverflow.com. So went through the documentation and excised PREFIX and replaced it with INSTALL_BASE, which is the officially anointed new way of installing modules.

  http://xrl.us/oxqxc 

That reminded John Siracusa about the problem of sequestered perl installs.

  http://xrl.us/oxqxe 

Syntax for macros / function composition at compile time

Erwan Lemonnier asked for some general syntax advice on implementing Python-style function decorators to Perl. Michael G. Schwern pointed him at Method::Signatures and subroutine attributes.

Matt S. Trout mentioned a secret IRC channel and mailing list where meddling with syntax takes place.

  http://xrl.us/oxqxg 

Perl 5.10.x + Tk-804.028-501-12048

The recent tweaks to constant/mutable SV pointers caused Tk to fail (Tk being the poster child for unexpected consequences from low-level changes). Marcus Holland-Moritz tweaked thing around to get Tk passing again.

  http://xrl.us/oxqxi 

Questions about regcomp.c

Karl Williamson had some very detailed, precise questions to ask regarding regcomp.c, from which we can conclude that Karl already knows more about the regular expression than 94% of all Perl 5 Porters. Yves Orton provided the answers and saw that there was a bug that he needed to fix.

  http://xrl.us/oxqxk 

#34775 causes run/cloexec.t to hang

Marcus Holland-Moritz uncovered a smoke failure regarding the recent bug fixes for leaks in PerlIO layers.

Steve Peters confirmed the failure and reverted the change. For Goro, it's back to the drawing board.

  http://xrl.us/oxqxn 

"Perl_newSVpvf("%lld")" is broken

Hugo van der Sanden picked up the gauntlet thrown down by Michael G. Schwern regarding the weird results with printf formats, traced it down through a dense thicket of #ifdefs, and proposed a patch to tidy it up.

A long discussion about printf format specifiers and error messages ensued.

  http://xrl.us/oxqxp 

Regular expression character classes and unicode.

Yves Orton kicked of a request for comments regarding the rewrite/revamp of character classes and the breakage that has crept in since Unicode. He received many comments.

  http://xrl.us/oxqxr 

Add UPSTREAM flag to Maintainers.pl

Dave Mitchell wanted to gauge the interest in adding some metadata for dual-lifed modules, to track whether changes to blead should be pushed upstream to the maintainer first, or whether they were happy to fold changes back at their own speed. Those who replied were in favour.

Steffen Müller patched all that was necessary in order to implement the idea.

  http://xrl.us/oxqxt 

Clone fails to build with blead@34780

Michael G. Schwern reported a failure with Clone, that Marcus explained was due to the slightly naughty use of an lvalue macro. But he fixed things anyway.

  http://xrl.us/oxqxv 


TODO of the week

Here's a biggie for the bored. This task needs C knowledge, and knowledge of how the interpreter works, or a willingness to learn.

optimize tail-calls

Tail-calls present an opportunity for broadly applicable optimization; anywhere that return foo(...) is called, the outer return can be replaced by a goto, and foo will return directly to the outer caller, saving (conservatively) 25% of perl's call&return cost, which is relatively higher than in C. The scheme language is known to do this heavily. B::Concise provides good insight into where this optimization is possible, ie anywhere entersub,leavesub op-sequence occurs.


  perl -MO=Concise,-exec,a,b,-main -e 'sub a{ 1 }; sub b {a()}; b(2)'

Bottom line on this is probably a new pp_tailcall function which combines the code in pp_entersub, pp_leavesub. This should probably be done 1st in XS, and using B::Generate to patch the new OP into the optrees.


Patches of Interest

v5.10.0 Pod/Text.pm Can't call method pod2text without a package or object

Jari Aalto had a problem using pod2text in 5.10 and offered a patch to reinstate the previous behaviour.

Michael G. Schwern had a closer look at what was going on and concluded that the real problem was the fact that Pod::Text was using Pod::Simple incorrectly. He also pointed out that pod2text as a function has been deprecated for nearly half of Perl 5's lifetime.


  http://xrl.us/oxqxx 

Configure/NDBM_File Add prototype detection for NDBM header files

Marcus Holland-Moritz offered a couple of patches to sort out the problems that have been observed recently with respect to determining the availability of NDBM. He and H.Merijn Brand had everything settled down by the end of the week.

  http://xrl.us/oxqxz 

threads Changes

Nicholas Clark is busy wrapping up 5.8.9, and he noted the fact that 5.8.8 shipped with threads 1.07, but 5.8.9 will ship with 1.71. An amazing amount of work was done, mostly by Jerry D. Hedden, and Nicholas wanted to know if it was possible to summarise the main changes in three or fours points.

Jerry responded with a patch that contained what he thought were the most important improvements, which Nicholas applied with thanks.

  http://xrl.us/oxqx3 


New and old bugs from RT

B::Xref seems to be broken (#18306)

Steve Peters applied a patch from Renée Bäcker, thus closing the oldest bug closed this week.

  ding dong the bug is dead
  http://xrl.us/oxqx5 

Need to change Cygwin built-in Cwd::cwd (#38628)

Steve was able to close this ticket as well, since Jerry D. Hedden confirmed that its patches have been applied to blead, 5.10 and 5.8.

  second verse same as the first
  http://xrl.us/oxqx7 

filetests sometimes do not set _ (#46463)

Steve said this bug was resolved as well, but Mark Overmeer thought that documenting sub-optimal behaviour was not the same improving the behaviour.

  http://xrl.us/oxqx9 

map leaks memory (#53038)

Marcus Holland-Moritz suggests that this has been fixed by change #34776 and that bug #48004 is something else altogether (a question of maps within maps not freeing intermediate temporaries and thus consuming 300Mb when 9Mb should suffice).

  http://xrl.us/oxqyb 

perlio.c has a problem (both 5.8 and 5.10) (#54828)

Steve Peters cleared up the question of not all parts of a patch being applied.

  http://xrl.us/oxqyd 

h2xs does not handle properly enum constants (#55896)

Back in June, Steve Peters said that he thought fixes applied to h2xs in the meantime should have resolved the problems encountered in the bug report. Jeremy Ratcliffe replied this week, saying that only one bug had been fixed in 5.10, all the others remained.

  http://blogs.sun.com/akolb/entry/pitfals_of_the_perl_xs

  http://xrl.us/oxqyf 

Unary minus on 'numeric' inputs like '-1' (#57706)

Renée Bäcker suggested a change to how strings with a leading minus character are interpreted in the presence of a unary minus.

  but the patch has whitespace issues
  http://xrl.us/oxqyh 

Permission denied when building as non-root user on FreeBSD 6.2+ (#58180)

On FreeBSD (and possibly other Unix variants), you cannot build Perl if the directory containing your home directory does not have the read bit set (in order to prevent you from snooping the names of the other accounts in a shared environment -- which seems pretty dumb if /etc/passwd is readable, but who am I to argue with an ISP?)

  http://xrl.us/oxqyj 

PerlIO::via leaks memory at a high rate (#59268)

Marcus Holland-Moritz resolved this problem to his satisfaction. If it summons no black smoke, then a CPAN release of PerlIO::via will fix older Perls as well.

  http://xrl.us/oxqym 

In regular expressions, \N{U+...} doesn't match for ... > 256 (#59328)

Karl Williamson dashed off a quick patch for this, and Yves Orton applied it.

  http://xrl.us/oxqyo 

PATCH chr(0400) =~ /\400/ fails for >= 400 (#59342)

Rafaël Garcia-Suarez replied to Yves Orton's comment from last week where he suggested that octal escapes in regular expression be outlawed. He agreed that they should be put on board the deprecation train, but could be retained inside character classes. He also noted some marvellous inconsistencies in error messages.

Glenn Linderman suggested stealing Python's OoNNN octal notation.

It will take considerable effort on the part of the porters to convince Tom Christiansen of the need to deprecate octal in regular expressions. His main argument is that today, the \g escape can be used to disambiguate backreferences from octal. Chip Salzenberg waltzed in to say that he threw his lot in with Tom.

Undaunted, Glenn replied that there is a definite problem in that certain octal numbers may not be expressed in a pattern, depending on the number of backreferences. And when patterns are created by qr// composition, which was Yves Orton's point, this may not even be evident by casual inspection).

Tom subsequently posed to Andrew Hume, one of the original authors along with Ken Thompson and Dennis Ritchie, of C, Unix and regular expression, the question of how they dealt with the octal notation backreference ambiguity at the very beginning. And provided a whole pile of links for people who want to know more about the history of the matter.

  http://xrl.us/oxqyq 

Inconsistent math with large numbers (#60318)

Andreas König reported on a number of 64-bit perls out in the wild that consider some ferociously large numbers that end in 89.2 being larger than the same number ending in 90. Appending a .0 to the latter makes things work, but is considered distasteful.

  http://xrl.us/oxqys 

utf8+locale substitution cause the Perl interpreter to hang. (#60326)

Shlomi Fish showed how an s/// expression containing a particular UTF-8 character could fall into an endless loop.

  http://xrl.us/oxqyu
  http://xrl.us/oxqyw 

Regexp lookbehind failure after an (if)then|else in perl 5.10 (#60344)

Someone named Adam reported a bug that was introduced at around the time that Dave Mitchell derecursified the regular expression engine. Yves Orton took a crack at fixing it and Dave thought his solution was fine.

  http://xrl.us/oxqyy 

local $SIG{FOO} = sub {...} sets signal handler to SIG_DFL (#60360)

Ian Goodacre posted a problem about localising signal handlers, and the fact that the default handler is loaded transiently in the switch from the old handler to the new.

Chip Salzenberg brought the house down with an awesome patch to solve the problem, which he thought would probably fix up some sub-optimal behaviour that has probably been around ever since 5.000.

Amid the general applause, Marcus Holland-Moritz expressed concern Chip's patch alters the signature of a public API. Chip took Marcus's concerns on board and wanted to know what the current policy was regarding the modification of a public call.

In a side note, Chip noted why companies like IBM et al invest on Linux but not FreeBSD, in a sub-thread relating to how difficult it is to get companies interested in supporting Perl.

Chip came back afterwards with a second iteration of the patch that Marcus applied with a minor tweak or two.

  http://xrl.us/oxqy2 

Safe.pm sort {} bug with -Dusethreads (#60374)

Alex Hunsaker filed a bug regarding a problem with custom sort routines in a Safe compartment on a threaded perl. He mentioned that Andrew Gierth had tracked the problem down to a difference in the implementation of stashes. In a non-threaded perl, a cop points to the stash, but in a threaded-perl a level of indirection is introduced and it points to the name of the stash.

  http://xrl.us/oxqy4 

pos() does not get stored for tainted variables (#60378)

Renée Bäcker, who appears to have memorised the entire set of unresolved bugs in the RT queue, was quick to point out that the person submitting this bug submitted the same bug about four years ago as bug #27344.

  but it's still a bug
  http://xrl.us/oxqy6 

Perl5 Bug Summary

  1332 (+7 -20)
  http://xrl.us/oxqy8
  http://rt.perl.org/rt3/NoAuth/perl5/Overview.html 


New Core Modules

Test::More/Builder/Simple 0.86
  http://xrl.us/oxqza 
Attribute-Handlers 0.81
  http://xrl.us/oxqzc 

In Brief

Tom Christiansen wondered about strange permissions on files, such as executable bits of files that would never be executed.

  http://xrl.us/oxqze 

He'd also like to see a useful ctags target in Makefile , which would probably require some Configure probes.

  http://xrl.us/oxqzg 

Joshua Hobbit wondered whether replacing Time::Local by Time::Y2038 (that is, a notorious bug) was particularly wise in terms of names.

  http://xrl.us/oxqzi 

Jerry D. Hedden saw that change #34653 breaks DBM functionality, but Marcus was quick to make a change that he thought would repair it.

  http://xrl.us/oxqzk 

Yves Orton added some files to .gitignore .

  http://xrl.us/oxqzn 

PerlIO resource leaks on open() and then :pop in :unix and :stdio (bug #56644). Leaks no longer, thanks to GFUJI's patches, applied by Steve Peters.

  http://xrl.us/oxqzp 

And another: ungetc() to :scalar might cause problems (bug #57322). I suspect Steve went through Renée Bäcker's list of bug reports containing patches.

  http://xrl.us/oxqzr 

John E. Malmberg began to get POSIX exit mode working/tested on VMS. Applied by Craig A. Berry.

  http://xrl.us/oxqzt 

Karl Williamson wanted to use charnames in Test::More like tests, and was told to use qr// to minimise the pain.

  http://xrl.us/oxqzv 

And File::Find (bug #57926)

  http://xrl.us/oxqzx 

Last week's summary

  This Week on perl5-porters - 20-26 October 2008
  http://xrl.us/oxqzz 

About this summary

This summary was written by David Landgren.

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.


That's the sound of a Chip ...

pudge on 2008-11-20T19:57:00

... working on the chain ga-eee-ang ...