This Week on perl5-porters - 7-13 November 2005

This Week on perl5-porters - 7-13 November 2005

This week was really, like David Landgren uses to say, a business week. Many short threads, many bug fixes, not all particularly earth-shattering, but Perl is even more solid.

Feedback from Last Week's Summary

About the sort/multicall patch, Robin Houston hushed to say that the ability to empty the array while you sort it and still retrieve the results has never worked. The point was that Robin added a test for this feature, which slipped into the patch sent to the list.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00195.html

Steven Schubiger may stop assuming his patch on POD estetics was overlooked: Rafael applied it seamlessly.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00319.html

See perl say() (continued)

Robin Houston argued about a possible implementation of pp_say, in a followup to last week's discussion. Rafael Garcia-Suarez made a few points and admitted himself not enthusiastic about adding a new keyword to perl, mainly a weak keyword. And things stand still in this matter.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00169.html

print FILEHANDLE

Steve Peters hitted the undocumented behavior of print FILEHANDLE which DWIM outputting $_ to the specified filehandle. He also noticed some inconsistencies like print {STDERR} being a syntax error and B::Deparse being unprepared for this kind of expressions. Rafael Garcia-Suarez said it doesn't look easy to fix without weird side-effects.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00170.html

&= and m// Misbehavior

Anno Siegel reported the bug #37616 in the last week, about a malfunction of &= operator on strings combined with some pattern match (mentioned in the previous summary). There ensued some discussion where Abigail brought the confirmation that &= is working as documented in perlop.pod, section "Bitwise String Operators". In turn, Sadahiro Tomoyuki showed how the issues with simple regexes exposed some trouble with handling NUL-terminated strings which sometimes are visible at the Perl level and sometimes are just an internals thingy. Rafael Garcia-Suarez and Nicholas Clark confessed to be bothered by such limitations, which Nicholas thought it could be a nice bug to fix and which may lead us to a nice bug fix real soon.

    The discussion of the ticket enters this week
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00172.html

Bad Locales in Mac OS X

On a followup to ticket #36061, Steve Peters added a change to README.macosx about yet another broken locale file, namely eu_ES (Basque-Spain). This shows up as test failures in ../lib/locale.t. Dominic Dunlop explained these test failures now are being suppressed, by skipping the offending locales, avoiding worries to perl builds on Mac OS X. Dominic also proposed a throrough update of README.macosx which was applied. With the change, Steve Peters also closed ticket #35895 which concerned this same locale.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00180.html

Dying in map, grep, sort

On RT ticket #24354, Chris Heath provided a rather detailed description of how the test cases below cause attempts to free unreferenced scalars.

    perl -e 'map die,4 for 3'
    perl -e 'grep die,4 for 3'
    perl -e 'for $a (3) {@b=sort {die} 4,5}'

The bug had to do with the interaction between how map, grep, sort automatically localize certain variables and an odd behavior when unwinding context and save stacks due to an exception. Rafael Garcia-Suarez applied Chris' patch as change #26027 to bleadperl.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00189.html

Behave Yourself, ucfirst

Nicholas Clark opened ticket #37628 to tell about his finding ucfirst can malform UTF-8. Nicholas' inspection of the code revealed some bad assumptions about lengths (in UTF-8) and exposed the ill-behaved code. He then noticed lcfirst had its own bug as well. And then he patched the issue(s) with change 26034 and closed the ticket, setting a model for a most productive monologue in RT.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00197.html

Perl on Symbian

Jarkko Hietaniemi brought the latest of his work on the Symbian port of Perl, reaching release 0.4.0 with a lot done on the UI side (including improved support to S60 and S80 devices and UIQ).

    First patch
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00199.html
    Second patch
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00306.html

List::Util issues

DProf breaks shuffle Ticket #32383 was opened by Jarkko Hietaniemi to report problems while using DProf together with List::Util::shuffle. Even though the error message has been changing, it was still there. Robin Houston proposed a patch and was advised by Graham Barr about the use of Perl_seed which was not refactored until 5.8.1. Robin pulled together changes in Graham's svn repository more PUSH_MULTICALL changes, and after some tweaks, the patches were applied, hopefully fixing the issue.

    Rafael shows the actual message by bleadperl
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00204.html

Memory Leaks in first Tassilo von Parseval opened ticket #37643 to say about memory leaks in List::Util::first. Dave Mitchell remembered this issue is already fixed in blead by now.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00301.html

Code Unification for Cygwin, Win32 and WinCE

Yitzchak Scott-Thoennes wondered about the forked code originally from win32/win32.c duplicated in Cygwin module Win32CORE and the status of Win32 module, core for Win32 but available for Cygwin only as part of the libwin32 distribution. Yitzchak planned to see these converging to a common code, where synchronicity will not be lost again. Jan Dubois gave a full account of the differences to be found between blead and libwin32 and noticed that the wince branch also copied some of this Win32 code.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00166.html

To Jan, the starting point of this unification was the elimination of USING_WIDE codebranches that have been unused since the introduction of internal UTF8 support for PVs. And, indeed, Jan assembled a patch towards this goal of improving maintainability and the sharing with Cygwin.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00240.html

Cygwin Configure

Yitzchak Scott-Thoennes and H.Merijn Brand exchanged a rather long series of messages while tighting up issues with Configure on Cygwin. In the end, it looks more stable now.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00284.html

Perl on WinCE

WinCE port of Perl received a little love this week. Vadim Konovalov posted a patch to make 5.8.7 compilable for WinCE platform. H.Merijn Brand called for a patch against blead first and Vadim promised to do just that during this week. Later, he sent in the revised patch and Steve Hay explained how some issues that apply to build configuration on Win32 and AIX may be needed as well for WinCE.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00214.html

DB_File 1.814

Dominic Dunlop observed which an old warning on Darwin from ext/DB_File/t/db-btree.t could go away for the recent revisions of the OS and posted a patch to do that. Paul Marquess took the change to the official DB_File with the release of 1.814 and a corresponding patch to blead.

    Dominic gets rid of old Darwin warning
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00320.html
    Paul Marquess announces DB_File 1.814
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00352.html

CPAN 1.76_65

Andreas Koenig brought CPAN.pm up to version 1.76_65.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00224.html

Time::HiRes 1.82

Jarkko Hietaniemi has had a busy time with many, many releases of Time::HiRes, eluding porters, smokes and summarizer. I guess by now Time::HiRes in blead must have reached version 1.82 as the CPAN release.

Nuking Globals and Stashes

Robin Houston remembered April 2001 when people talked about nice ways to make perl dump by nuking important globals. For example,

    perl -e 'delete $::{"@"}; warn'
    perl -e 'delete $::{"_"}; sub{}->()'

Back then, Benjamin Sugars proposed a fix still working against blead and dying to be applied. Steve Peters had a look, found the related ticket #5851, made some changes and got us rid of these core dumps.

    Benjamin Sugars' long-forgotten patch
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-04/msg01101.html
    Robin Houston ressurects the issue
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00148.html
    Steve Peters closes RT ticket #5851
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00252.html

Perl on EBCDIC

pack('E', $arg) on perl-5.8.7 Rajarshi Das posted a notice on how pack('E', $arg) worked on EBCDIC platforms in perl-5.005_03 and it is not supported anymore on perl-5.8.7 and called for an alternative. Dave Mitchell and Sadahiro Tomoyuki observed Radarshi's perl must be a non-standard modification, since the "E" option is not present in the official 5.005_03 distribution. Rajarshi explained the 'E' is meant to turn ascii string inputs into EBCDIC results. He also agreed the extra option was locally introduced and was not available as part of the general source. Sadahiro suggested two alternative methods: one using the undocumented utf8::unicode_to_native() and other using pack('U', $arg) but warned about issues that may arise between the new UTF8 behavior and old scripts.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00326.html

cond_timedwait Issues Mohammad Yaseen found some errors while playing with cond_timedwait on EBCDIC platform. Yaseen showed the issues with an extended test adapted from cond.t and hinted on possible causes.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00362.html

Storable Updates

Gisle Aas posted a patch to restore Storable compatibility allowing the newer versions to read files written by Storable-0.1. Then Gisle sent in another patch with a now documented read_magic() function to decode image headers and also a file_magic() function. Steve Peters applied both patches with these new features that come handy for dealing with Storable on any platform.

    Gisle restores Storable compatibility
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00354.html
    Gisle brings read_magic() to the foreground
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00366.html

Handling Security Advisories

"Jack" opened bug #37662 to ask what address a security advisory regarding perl could be send to. H.Merijn Brand and Abigail advised to use the perl5-porters mailing list, discussing here in the open. Nicholas Clark, Dave Mitchell, and Andreas Koenig appreciated the point of keeping safe sensitive information from end-users, at least by the time necessary to fix the problem. Rafael Garcia-Suarez and Michael Cummings compared this to the infrastructure for handling security advisories by OS vendors.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00364.html

Playing Games with gcc

Brendan O'Dea noticed gcc 4 no longer emits "Reading specs from ..." but rather "Using built-in specs." and posted an alternate mechanism to locate the gcc include directory. H.Merijn Brand wondered in which version of gcc the option --print-libgcc-file-name used by Brendan was introduced, for which Brendan and Abe Timmerman supplied some answers. Jason Vas Dias pointed he raised bug #37582 about this with a patch accepted as change #26074.

    Steve Peters applies Jason's patch
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00322.html
    Brendan's post
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00385.html

Perl5 Bug Summary

The open tickets count was at 1528 in Nov 7 14:00 GMT. But this had been a frantic week at bug's front: in a rough counting, perl5-porters received around 240 messages, in about 100 threads, and only Steve Peters closed at least 18 tickets. The next week should inevitably start with a lower score at the bugs count.

    Robert Spier and the Bug summary
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00208.html
    Perl RT just now
    http://rt.perl.org/rt3/NoAuth/perl5/Overview.html

In Brief

Fixing gmtime Docs In RT ticket #35840, Michael Schwern reported gmtime under 5.8.6, unlike documented, returns 9 rather than 8 values. perlfunc was fixed with change #26024 by Steve Peters.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00177.html

File::Glob and Its Origins On a followup to bug #37597, Steve Peters observed "there have been some changes between the Perl bsd_glob() and the original OpenBSD glob function where it came from." He'll look into merging the OpenBSD changes in soon.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00178.html

perldiag issues Steve Peters closed RT tickets #3190 and #7543 about minor perldiag issues.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00232.html
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00237.html

Redefining Sort Subs via goto Steve Peters reported on the solution of bug #7579, which concerned core dumps when redefining comparison routines via goto &NAME. After a recent change to bleadperl, the behavior we get from now on is saner. And another ticked closed.

    ./perl -wle 'sub s1 { goto &s2 } sub s2 { $a cmp $b } print sort s1 (3, 2, 1)' 
    Can't goto subroutine from a sort sub (or similar callback) at -e line 1.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00238.html

A Surprising Segfault (continued) In a followup to last week's thread, Dave Mitchell added that, like Rafael Garcia-Suarez, he believed the nature of the tests being applied to various pp_* functions may be dubious, which calls for more assertions in code and better tests.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00265.html

5.8.7 on AIX failing make test Sujeet Kulkarni asked for help to resolve problems while running make test on AIX. Dominic Dunlop provided some guesswork and H.Merijn Brand added a few hints regarding AIX oddities.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00299.html

Panic with Multiple Encodings Steve Peters noticed the reported bug was gone with bleadperl. The above command does not panic anymore.

    perl -Ilib -Mencoding=iso-8859-1 -wle'binmode STDOUT,
        ":encoding(iso-8859-1)" or die "binmode:$!"; 
        print "\xe1", "\n";'
    "\x{128a}" does not map to iso-8859-1 at -e line 1.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00302.html

if.pm vs Other Long-Forgotten Patches Rafael applied a patch by Ilya Zakharevich to give more meaningful error messages from if.pm when invoked with a condition in list context. Ilya greeted the change, as he was afraid of that taking the route of tens of other patches waiting forever.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00333.html

Silencing ExtUtils Tests Dominic Dunlop posted a patch to supress some leaked warnings in ExtUtils tests which was applied by Rafael Garcia-Suarez. It seemed like these tests waited long enough for Schwern's touch after behavior change of cmp_ok in Test::More.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00334.html

5.6.1 Install/Compile on Solaris 8 Steve Peters urged for more information in diagnosing bug #9727. Andy Dougherty explained it had to with the output by newer gcc's, mentioned a short-term fix and confirmed perl 5.8.x handles this just fine. To Andy, it is a ticket to be closed.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00337.html

Crashes in Multithreaded Server Zefram opened ticket #37652 to tell about crashes in a multithreaded server which may result in terminating or locking up the application. He posted a test program to reproduce the issue and stack traces obtained with gdb. Currently Warnocked.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00338.html

English.pm and $COMPILING Dan Tierra noticed the English name for $^C, namely $COMPILING, does not get exported when doing use English qw(-no_match_vars);. Steve Peters added the variable to the list of exports with change #26080.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00339.html

OTHERLDFLAGS in ExtUtils::MakeMaker Steve Peters replied bug #37433 which concerns a patch to MakeMaker. Fearful of accidental breaking ExtUtils::MakeMaker, he announced the patch was sent off to rt.cpan.org queue.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00343.html

PERLIO_DEBUG Patch Peter Dintelmann found that setting the environment variable PERLIO_DEBUG as described in perlapio.pod could result in segfaults and proposed a patch, applied to blead as change #26075.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00321.html

binmode H, ":pop" Patch Peter 'Segfault-Killer' Dintelmann, in ticket #37557, showed how calling binmode() after popping the last IO layer results in a segfault and proposed a patch, applied as change 26101.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00355.html

Andy's Const & Local Mission Andy Lester went on with his tireless mission of bringing consting and localizing goodness to Perl source code.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00346.html

mathoms on VMS John E. Malmberg posted a patch to add a compile rule which is needed for VMS to compile mathoms.c. He also inquired on a few things that need to be resolved in order to allow blead to build on VMS.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00283.html

Mathoms with Proper Prototypes Andy Lester noticed the mathoms functions weren't using proper prototypes, causing gcc to complain. Steve Peters applied Andy's fix as change #26099.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00360.html

blead@26091 on VMS Abe Timmerman posted the results of blead snapshot @26091 on VMS. No feedback yet.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00395.html

abs2rel("/foo/bar", "/foo/bar") David Golden recently reported problems in Path::Class which Ken Williams traced to an odd behavior in File::Spec: abs2rel("/foo/bar", "/foo/bar") returns the empty string rather than "." or something sensible. Before fixing it, Ken asked what are the likely issues.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00389.html

Extending the stack inside ops Nicholas Clark found an apparent problem which could mean that extending the stack while inside ops would be a bad thing. Dave Mitchell explained the applicable rule, namely, it's the responsibility of the things doing the call to push a new stack. So Nicholas made the appropriate change for the case in question and called for feedback on the way he did it.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00377.html

Localizing Shared Variables "dean" noticed that localizing variables bound to shared variables can cause the shared variable to become undefined and provided tests to make his point. No one answered so far.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-11/msg00401.html

About this summary

This summary was written by Adriano Ferreira.

Information concerning bugs referenced in this summary (as #nnnnn) may be viewed at http://rt.perl.org/rt3/Ticket/Display.html?id=nnnnn

Information concerning patches to maint or blead referenced in this summary (as #nnnnn) may be viewed at http://public.activestate.com/cgi-bin/perlbrowse?patch=nnnnn

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 or enjoyable, please consider contributing to the Perl Foundation to help support the development of Perl.