This Week on perl5-porters - 13-19 March 2006

dev.perl.org
 

This Week on perl5-porters - 13-19 March 2006

On the move -- Module::Build moving into core -- Perl core moving around the file system -- Threads moving onto CPAN -- plus the usual assortment of bug reports, patches and new ideas.

Topics of Interest

Support for relocating @INC

Nicholas Clark delivered the functionality to make @INC relocatable. This means you can now build Perl, install some modules from CPAN, take the whole directory tree and move it elsewhere and things continue to work. Andy Dougherty wondered how Nicholas had dealt with the shared libperl.so file.

The answer is that there isn't much that can be done in the general case, although some platforms, like Solaris, make the issues easier to deal with. In other words, Nicholas has done about as much as can be done. Now for testing and feedback.

  A movable feast
  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00482.html

Overridable filetest operators (continued)

Salvador Fandio continued to look at the problem of overriding stat, which was now a question of how to deal with the ;$ prototype correctly. Rafael didn't want anything to be changed at this late stage of the game, and instead suggested two new prototypes, ^$ and ^*.

In this scenario, stat would have the latter prototype. (The ^ is loosely based on a concept from the Perl TODO list, which is to allow prototypes to indicate that the routine defaults to using $_ if no argument is passed).

  Prototyping the prototype
  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00303.html

Module::Compile and the .pmc file extension

Audrey Tang wrote to explain her position on what .pmc means. Surprisingly, this elicited no discussion.

  Nothing to do with Parrot (yet)
  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00483.html

Advice for pack failure needed

H.Merijn Brand was trying to understand why gcc 4.0.3 works, but 4.1.x doesn't when producing a 64-bit perl for HP-UX 11.00 and 11.11. He had stripped a failing test file (pack.t) down to a bare minimum.

He had gone as far as literally unrolling the code from pp_pack.c into straight C using ints and doubles instead of I32s, NVs and SVs, but was well and truly stuck (since this resulting code worked identically on both compilers).

  What we have here is a failure to pack
  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00524.html

Move DynaLoader into libperl.so

Gisle Aas has problems with applications that wish to instantiate an embedded perl interpreter. This is due to the fact that Dynaloader is compiled statically into the perl stub executable. He wanted to move things around a bit so that part of DynaLoader is, well, loaded dynamically.

So far, no complaints.

  Pulling yourself up by the bootstraps
  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00575.html

Useless localization of substr warning messages

Hugo van der Sanden was puzzled by new useless localization of substr that blead was now issuing, and wondered what to do about it. Again, no takers.

  What's the use?
  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00611.html

Patches of Interest

Term::ReadKey/Term::ReadLine on Windows

Johnathon Stowe produced a patch to fix up the Term::ReadKey/Term::ReadLine bug on the Win32 platform.

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00464.html

VMS-specific arg_defines for ExtUtils::CBuilder

Craig A. Berry sent in a patch for ExtUtils::CBuilder to deal with the requirements of compiling extensions in C on VMS. Ken Williams, the maintainer, took the patch under his wing and asked if there was a test case that could expose this problem, should it ever arise in the future.

John E. Malmberg tweaked Craig's patch to work around a couple of other issues he encountered. In fact John sent in a steady stream of patches for VMS this week. See the In Brief section to catch them all.

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00440.html

A bit more Module::Build help for VMS

Craig then added a patch to help get more of Module::Build's test suite to pass. John received some strange errors that left him puzzled.

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00442.html

SPAGAIN in the poor-man's-multicall API

Robin Houston fixed up multicall.h (in List::Util) to deal with the problem that Tassilo von Parseval had encountered in bug #38644 (a missing SPAGAIN macro call). Rafael applied the patch to blead as change #27486, noting that Graham Barr will have to apply the change to his own repository of List::Util as well.

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00458.html

Sundry fixes from Jan Dubois for Win32

Jan Dubois realised that some of the work he did to make alarm work on Windows 2003 could cause perl go into an infinite loop. He sent in a patch to restore the correct behaviour, and in the process of investigating found another small problem that also needed fixing.

  win32_async_check() fixed
  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00551.html

  win32_plclose() fixed
  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00553.html

Allocating op-codes from arenas

Jim Cromie landed a first version of patch that would allow op-codes to be allocated from arenas (following on from the discussion last week with Nicholas Clark). There were, nonetheless, a number of issues that will have to be worked through. For instance, it has a nasty tendency to segfault. People were still digesting the patch at summary time.

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00601.html

The continuing story of Andy Lester's quest to const

  • Made S_looks_like_bool's argument const...
      http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00463.html
  • Taught some of the new MAD code preprocessor tricks to keep gcc quiet.
      http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00472.html
  • Redundant boolean checks removed, some goto's for speed and sundry consts in regexec.c. Dave Mitchell surfaced briefly to mention that he's in the middle of reworking S_regmatch (and the crowd goes wild) and asked for this patch to be kept on ice.

    Hugo noticed that Andy's work highlighted the underlying similarities in three sections of the code, and that all should be hoisted out into a subordinate function or macro.

      http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00582.html
  • Changed the semantics of S_isa_lookup. Andy noticed that this function (in universal.c) returned pointers to PL_sv_yes and PL_sv_no simply to indicate truth. So he changed it to return TRUE or FALSE.
      http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00594.html
  • Cleanups in op.c
      http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00603.html
  • Random consting in Data::Dumper.
      Not random, merely chaotic
      http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00605.html
  • And changed some @ISA definitions to work correctly under use strict, such as @ISA = (Exporter) becoming @ISA = qw(Exporter).
      http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00606.html

New and old bugs from RT

overload and rebless (#34925)

Nicholas Clark returned to a bug from last year (which I cannot find again on Xray) dealing with reblessing an object in an overloaded class, and proposed three ways of fixing it, One of them was probably only suitable for blead, and thus 5.10, but two other avenues showed more promise. This is apparently a big issue for Class::DBI.

Nicholas then wrote a patch to implement one of the safer approaches, and if the time it takes to run the test suite is any guide, the performance difference is pretty much lost in the noise.

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00511.html

  The original Perlbug (authentication required)
  http://rt.perl.org/rt3/Ticket/Display.html?id=34925

Debugger Loses Names for Anonymous Subroutines (#38673 update)

chromatic returned to his own bug report, and discovered that by deleting a swath of code in op.c he was able to make it work to his satisfaction, even though he felt slightly uneasy about doing do.

Rafael Garcia-Suarez didn't think much of the idea either and explained a better way of fixing it. He thought it should be feasible to patch the debugger only, the only trouble is that patching the debugger is even more scary.

Another important issue for Rafael is the poor state of $^P (a.k.a $PERLDB) in the perlvar documentation. Someone needs to explain why you would want to diddle the bits, and what happens when you do.

Nicholas Clark admitted to having seen weird thing occurring deep down in the depths of CVs, GVs and stashes, but had never been able to adequately explain why.

  Shades of Moria
  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00147.html

SvPOK breaks magic in 5.8.5 and beyond (#38707)

Zowie noted that SvPOK breaks code in PDL, specifically, when looking at things like $#$arrayref.

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00374.html

perl 5.8.8 make fails at dynaloader (#38687)

Dominic Dunlop reproduced the symptoms demonstrated by Andy Ford in the initial bug report by touch(1)ing the Makefile so that an empty file was created. He suggested that Andy delete the directory, make sure there was sufficient free disk space, and start the build again.

  If problems persist, consult your doctor in the morning
  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00259.html

localised stash slices are fixed (#38710)

To recap:

  local $::{"func"} = sub { "func" };

worked, but

  local @::{qw/ func1 func2 /} = (sub { "func1" }, sub { "func2" });

... did not. Now it does, thanks to a patch for pp.c from Rick Delaney.

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

Perl_utf8n_to_uvuni decodes illegal characters (#38722)

John Gardiner Myers uncovered a discrepancy between what Perl_utf8n_to_uvuni decodes (that is to say, Unicode characters) and what Perl_uvuni_to_utf8_flags considers illegal, and provides a short snippet of code to demonstrate the problem. No takers as yet.

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00473.html

Backticks don't work in Win32 multi-threaded perl (#38723)

Krzysztof Koczyjan filed a bug that showed how fork and backticks don't work on the Win32 platform. He traced the problem to the routine win32_popen, which is apparently not thread-safe. He then recompiled perl with -DUSE_RTL_POPEN and saw that that fixes the problem.

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00494.html

syslog-ng inappropriately expects \n (and \0?) in syslog messages (#28019)

Julian Mehnle was chasing down a bug in Debian-land concerning their libmail-spf-query-perl package, and stumbled over the changes made to Sys::Syslog after the Webmin flap. The issue was that the module no longer appended a \n to the logged message, and syslog-ng was running lines together.

Sébastien Aperghis-Tramoni, the maintainer of Sys::Syslog. explained that the current state of affairs was more due to work-arounds for broken commercial Unix syslog implementations, and that the RFCs surrounding these are sadly only informational, and do not mandate a specific way of doing things.

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00504.html

Poor example for $^V in perlvar (#38743)

Nicholas Clark thought that the documentation example in perlvar concerning $^V (perl version) was rather stupid, and hoped someone could come up with a better idea. Dave Mitchell came up with a very clever example that dealt with the hash key randomisation work that went into perl 5.8.1.

  Clues you can use
  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00546.html

Undetectable, incompatible API changes in POPpx, etc. (#38744)

John Gardiner Myers sent in a scathing bug report concerning changes to the POPpx macro, which broke his code when running on 5.8.8.

Nicholas Clark replied that no-one who watched the commit go past realised the subtle change in behaviour, nor did anyone pick it up in any of the maintenance snapshots in the three months that followed the change. Similarly, the bug was not caught by anyone who built the release candidate running up to the official 5.8.8 release.

  The importance of testing
  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00548.html

Segmentation fault in generating Config.pm (#38745)

Derek Chen was having trouble building perl on an embedded Linux system running on an ARM processor. Dominic Dunlop wondered whether this could be related to bug #38913, and wanted to know whether previous versions of perl had been built successfully on the platform, or if this was the first time. The next thing to try is to build an unoptimised miniperl.

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00555.html

  Follow-ups in a detached thread
  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00634.html

threads.xs broken under PERL_IMPLICIT_SYS; 5.8.8 regression

Jan Dubois sent a patch (for the third time) to free the perl interpreter structure after the threads structure. The latest changes to threads.xs broke this again.

Tels asked for better documentation in the code, and new tests in test suite to ensure that the problem doesn't come back a fourth time.

Jerry Hedden picked up the patch and reworked it slightly. His plan is to get some feedback from CPAN testers before getting it folded back into blead.

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00556.html

qx loses /dev/tty (#38748)

"ende" had a Tcl script hooked up to a perl program running as a daemon which wasn't working. But the equivalent daemon written in shell worked correctly. Dominic Dunlop thought that there might be problems with the program if it really was a daemon, because in that case it would have no controlling terminal and thus no /dev/tty.

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00568.html

Perl5 Bug Summary

  1556 tickets
  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00477.html

  Summarised here
  http://rt.perl.org/rt3/NoAuth/perl5/Overview.html

New Core Modules

  • ExtUtils::CBuilder version 0.17 uploaded Ken Williams (based on the thread concerning VMS. See above).
      http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00538.html
  • Module::Build version 0.27_09, also from Ken.
      http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00409.html
  • threads version 1.09 uploaded by Jerry D. Hedden.
      http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00474.html

    He also sent in a patch to sync blead with the current versions of threads and threads::shared.

      threads 1.12
      http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00613.html
    
      threads::shared 0.99
      http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00614.html

In Brief

John E. Malmberg reported at the beginning of the week that 13 test scripts (of 1140 total) were still generating failures on VMS.

  threads and VMS (redux)
  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00505.html

He tweaked thread.h to give threads on VMS a bit more stack space.

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00581.html

And some buffer size fixes for vms.c

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00616.html

And utime (I think I need a what "What John did" section).

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00627.html

Peter Prymmer filed a small patch to fix Pod::Simple on blead so that it works on VMS ODS-2. (Which I understand to be an older file-system for VMS, the current being ODS-5).

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00509.html

Paul Marquess sent in a patch to synch blead with the CPAN versions of Compress::Raw::Zlib, Compress::Zlib and IO::Compress::Zlib.

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00542.html

Someone noted (in bug #34981) that binding STDIN to scalar hides fd 0 forever. I'm not quite sure what they mean by that.

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00570.html

Randy W. Sims nailed an uninitialised value in Archive::Tar.

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00635.html

About this summary

There was some feedback from Marcus Holland-Moritz on last week's summary concerning the issue of DEBUG_LEAKING_SCALARS.

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-03/msg00638.html

This summary was written by David Landgren.

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

If you want a bookmarklet approach to viewing bugs and change reports, there are a couple of bookmarklets that you might find useful on my page of Perl stuff:

  http://www.landgren.net/perl/

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.