Re: [perl #37117] Math::Complex atan2 bug

2005-09-10 Thread Jarkko Hietaniemi
While I certainly agree that a runtime divide-by-zero is not the right
thing to do, I cannot quite bring myself to agree on the proposed fix.

In my books atan2() is not well-defined for complex arguments at all,
and even if in some special cases it might have a reasonable definition,
I still don't think it makes sense.

See e.g. http://mathworld.wolfram.com/InverseTangent.html



Re: [perl #37117] Math::Complex atan2 bug

2005-09-10 Thread Jarkko Hietaniemi
Jarkko Hietaniemi wrote:
 While I certainly agree that a runtime divide-by-zero is not the right
 thing to do, I cannot quite bring myself to agree on the proposed fix.
 
 In my books atan2() is not well-defined for complex arguments at all,
 and even if in some special cases it might have a reasonable definition,
 I still don't think it makes sense.

This bit:

: This is not correct. Obviously, 0/i is the same as 0/1
: which is 0. Thus atan2(0,i) == atan2(0,1) == atan(0) == 0

seems to be incorrect... if one believes the Mathematica definition
atan2(0, i) is pi/2, not zero.

Another good reference on these matters, MATLAB ignores the complex
parts of atan2() arguments.

 See e.g. http://mathworld.wolfram.com/InverseTangent.html
 
 



Smoke [5.9.0] 25366 FAIL(m) openbsd 3.6 (i386/1 cpu)

2005-09-10 Thread Steven P. Schubiger
Automated smoke report for 5.9.0 patch 25366
accognoscere.homeunix.org: AMD Athlon(TM) XP 1800+ (AuthenticAMD 686-class) 
(i386/1 cpu)
onopenbsd - 3.6
using cc version 2.95.3 20010125 (prerelease, propolice)
smoketime 3 minutes 1 seconds (average 22.625 seconds)

Summary: FAIL(m)

O = OK  F = Failure(s), extended report at the bottom
X = Failure(s) under TEST but not under harness
? = still running or test results not (yet) available
Build failures during:   - = unknown or N/A
c = Configure, m = make, M = make (after miniperl), t = make test-prep

   25366 Configuration (common) none
--- -
m - m - 
m - m - -Duse64bitint
m - m - -Duseithreads
m - m - -Duseithreads -Duse64bitint
| | | +- PERLIO = perlio -DDEBUGGING
| | +--- PERLIO = stdio  -DDEBUGGING
| +- PERLIO = perlio
+--- PERLIO = stdio


-- 
Report by Test::Smoke v1.19#716 running on perl 5.8.5
(Reporter v0.016 / Smoker v0.015)



[perl #37128] undefing *foo{CODE} does not fully work

2005-09-10 Thread via RT
# New Ticket Created by  Ben Tilly 
# Please include the string:  [perl #37128]
# in the subject line of all future correspondence about this issue. 
# URL: https://rt.perl.org/rt3/Ticket/Display.html?id=37128 



This is a bug report for perl from [EMAIL PROTECTED],
generated with the help of perlbug 1.34 running under perl v5.8.3.


-
[Please enter your report here]

This problem has been seen on Perl 5.8.3 and 5.8.7.  I assume that
it happens under other versions as well.

If you try to undef the CODE slot of a glob, it only halfway works.
ref(*foo{CODE}) will still show that it is a code reference, and
UNIVERSAL::can still shows that it is a code reference.

This bug causes problems when Apache::Reload and Class::DBI are
used together.

The following code sample demonstrates what I am talking about


#! /usr/bin/perl -l
print Originally foo() is a  . ref(*foo{CODE});
print Initializing foo();
*foo = sub {print hello};
print foo() is now a  . ref(*foo{CODE});
print According to can, foo is  . main-can(foo);
print Calling foo();
foo();

print Undefining foo();
$x = *foo;
undef $x;
print foo() is now a  . ref(*foo{CODE});
print According to can, foo is  . main-can(foo);
print Calling foo();
foo();

__END__
Originally foo() is a 
Initializing foo()
foo() is now a CODE
According to can, foo is CODE(0x8175b24)
Calling foo()
hello
Undefining foo()
foo() is now a CODE
According to can, foo is CODE(0x8175b24)
Calling foo()


The way that this comes into play in the case that I mention is
that Apache::Reload attempts to undefine subroutines that have
been defined, but when Class::DBI tries to check whether they
are there it is told that they are, with disasterous results.

[Please do not change anything below this line]
-
---
Flags:
category=core
severity=medium
---
Site configuration information for perl v5.8.3:

Configured by Debian Project at Sun Feb 15 17:22:09 EST 2004.

Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration:
  Platform:
osname=linux, osvers=2.4.22-xfs+ti1211, archname=i386-linux-thread-multi
uname='linux kosh 2.4.22-xfs+ti1211 #1 sat oct 25 10:11:37 est 2003 i686 
gnulinux '
config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN 
-Dcccdlflags=-fPIC -Darchname=i386-linux -Dprefix=/usr 
-Dprivlib=/usr/share/perl/5.8 -Darchlib=/usr/lib/perl/5.8 -Dvendorprefix=/usr 
-Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 
-Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.8.3 
-Dsitearch=/usr/local/lib/perl/5.8.3 -Dman1dir=/usr/share/man/man1 
-Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 
-Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl 
-Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Uusenm -Duseshrplib 
-Dlibperl=libperl.so.5.8.3 -Dd_dosuid -des'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define 
usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
  Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN 
-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64',
optimize='-O3',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN 
-fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='3.3.3 20040125 (prerelease) (Debian)', 
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=8
alignbytes=4, prototype=define
  Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
perllibs=-ldl -lm -lpthread -lc -lcrypt
libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libperl.so.5.8.3
gnulibc_version='2.3.2'
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:


---
@INC for perl v5.8.3:
/etc/perl
/usr/local/lib/perl/5.8.3
/usr/local/share/perl/5.8.3
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.8
/usr/share/perl/5.8
/usr/local/lib/site_perl
/usr/local/lib/perl/5.8.2
/usr/local/share/perl/5.8.2
/usr/local/lib/perl/5.8.1
/usr/local/share/perl/5.8.1
/usr/local/lib/perl/5.8.0
/usr/local/share/perl/5.8.0
.

---
Environment for perl v5.8.3:
HOME=/home/btilly
LANG (unset)
LANGUAGE (unset)
LD_LIBRARY_PATH=/usr/local/oracle/lib
LOGDIR (unset)


Smoke [5.9.3] 25366 FAIL(F) bsd/os 4.1 (i386/1 cpu)

2005-09-10 Thread kane
Automated smoke report for 5.9.3 patch 25366
fixit.xs4all.nl: Pentium II (i386/1 cpu)
onbsd/os - 4.1
using cc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
smoketime 3 hours 56 minutes (average 1 hour 58 minutes)

Summary: FAIL(F)

O = OK  F = Failure(s), extended report at the bottom
X = Failure(s) under TEST but not under harness
? = still running or test results not (yet) available
Build failures during:   - = unknown or N/A
c = Configure, m = make, M = make (after miniperl), t = make test-prep

   25366 Configuration (common) none
--- -
F F - - -Duse64bitint
F O - - 
| | | +- PERLIO = perlio -DDEBUGGING
| | +--- PERLIO = stdio  -DDEBUGGING
| +- PERLIO = perlio
+--- PERLIO = stdio


Failures: (common-args) none
[stdio] -Duse64bitint
../t/op/int.t...FAILED 11

[perlio] -Duse64bitint
../lib/Net/hostent.tFAILED 4-7
../t/op/int.t...FAILED 11

[stdio] 
../lib/Net/hostent.tFAILED 4-7

-- 
Report by Test::Smoke v1.19_67 build 842 running on perl 5.00503
(Reporter v0.019 / Smoker v0.023)



Re: [perl #37128] undefing *foo{CODE} does not fully work

2005-09-10 Thread Dave Mitchell
On Fri, Sep 09, 2005 at 06:11:49PM -0700, Ben Tilly wrote:
 If you try to undef the CODE slot of a glob, it only halfway works.
 ref(*foo{CODE}) will still show that it is a code reference, and
 UNIVERSAL::can still shows that it is a code reference.

Undefing a sub is not the same as deleting a sub. Internally, the CV
continues to exist, but its pad and op tree are freed. cf:

$ perl587 -le 'my $x = []; undef @$x; print $x'
ARRAY(0x9c7d180)
$ perl587 -le 'my $x = sub {}; undef $x; print $x'
CODE(0x8e40bac)

In both cases the thing continues to exist, but has no useful 'value'.

-- 
My get-up-and-go just got up and went.


Re: [EMAIL PROTECTED] VMS fixes for cbuilder

2005-09-10 Thread John E. Malmberg

Ken Williams wrote:

Hi John,

After my last email I reworked the patch so that all the modifications  
are in Platform/VMS.pm.  Could you confirm that it still works for you  
and I haven't broken it?


First I discovered that I had a bug in my patch to base.pm that was 
causing a diagnostic to be displayed.  I did not notice it until running 
the tests under the harness and it flagged it.


Then when I backed out my patch and applied yours, I discovered that it 
does not work.


In particular, the value of @temp_files is only filled in by 
$self-_do_link after VMS.


I have fixed it locally in VMS.PM, but I do not have time to submit a 
patch now.


Obviously my previous patch needs to be backed out of blead.

-John
[EMAIL PROTECTED]
Personal Opinion Only


Thanks,

 -Ken

Index: lib/ExtUtils/CBuilder/Platform/VMS.pm
===
RCS file:  
/Users/ken/src/CVS-repository/modules/ExtUtils-CBuilder/lib/ExtUtils/ 
CBuilder/Platform/VMS.pm,v

retrieving revision 1.7
diff -u -r1.7 VMS.pm
--- VMS.pm2005/05/20 00:50:041.7
+++ VMS.pm2005/09/08 12:17:04
@@ -7,11 +7,40 @@
 $VERSION = '0.12';
 @ISA = qw(ExtUtils::CBuilder::Base);

-sub need_prelink { 0 }
+sub need_prelink { 1 }

 sub arg_include_dirs {
-  my $self = shift;
-  return '/include=(' . join(',', @_) . ')';
+  my ($self, @dirs) = @_;
+
+  # VMS can only have one include list, remove the one from config.
+  if ($self-{config}{ccflags} =~ s{/include=\(([^\)]*)\)} {}i) {
+unshift @dirs, $1;
+  }
+  return unless @dirs;
+
+  return ('/include=(' . join(',', @dirs) . ')');
+}
+
+sub _do_link {
+  my ($self, $type, %args) = @_;
+
+  my $objects = delete $args{objects};
+  $objects = [$objects] unless ref $objects;
+
+  # VMS has two option files, the external symbol, and to pull in  PerlShr
+  $objects-[-1] .= ',';
+  push @$objects, 'sys$disk:[]' . @temp_files[0] . '/opt,';


 $temp_files[0]


+  push @$objects, $self-perl_inc() . 'PerlShr.Opt/opt';
+
+  # Need to create with the same name as DynaLoader will load with.
+  if (defined DynaLoader::mod2fname) {
+my $out = $args{$type} || $self-$type($objects-[0]);
+my ($dev,$dir,$file) = File::Spec-splitpath($out);
+$file = DynaLoader::mod2fname([$file]);
+$args{$type} = File::Spec-catpath($dev,$dir,$file);
+  }
+
+  return $self-SUPER::_do_link($type, %args, objects = $objects);
 }

 sub arg_nolink { return; }
===


On Sep 7, 2005, at 6:59 PM, John E. Malmberg wrote:

This patch is needed for the lib/ExtUtils/ParseXS.t/basic.t test to  
pass on VMS.


In lib/ExtUtils/CBuilder/Platform/VMS.pm, VMS needs to have a 
pre-link  file generated.


In lib/ExtUtils/CBuilder/Base.pm:

VMS can only have one /include qualifier on the CC command, and the  
last one wins, so if one is present in @ccflags, remove it.


VMS needs to have the executable named the same way that dynaloader  
will look for it.


VMS needs to have two option files specified in the link, one to  
indicate the exported symbols, and one to locate the PERLSHR image.







re: [perl #37128] undefing *foo{CODE} does not fully work

2005-09-10 Thread Ben Tilly
When I looked at the way the message appeared on the list, I realized
that I forgot to include one line of output.  The one where it dies. 
Here is the program and output with that additional piece of
information.

And to clarify the Class::DBI/Apache::Reload conflict that this
causes, load up the page and look at it.  You see a web page.  Make a
trivial modification to the underlying code.  You get internal server
errors because it can't figure out that there aren't really accessors
there for it to go and call.

Cheers,
Ben

#! /usr/bin/perl -l
print Originally foo() is a  . ref(*foo{CODE});
print Initializing foo();
*foo = sub {print hello};
print foo() is now a  . ref(*foo{CODE});
print According to can, foo is  . main-can(foo);
print Calling foo();
foo();

print Undefining foo();
$x = *foo;
undef $x;
print foo() is now a  . ref(*foo{CODE});
print According to can, foo is  . main-can(foo);
print Calling foo();
foo();

__END__
Originally foo() is a
Initializing foo()
foo() is now a CODE
According to can, foo is CODE(0x8158f10)
Calling foo()
hello
Undefining foo()
foo() is now a CODE
According to can, foo is CODE(0x8158f10)
Calling foo()
Not a CODE reference at - line 16.


Re: [perl #7615] (if|unless) ( local ... ) not undone

2005-09-10 Thread Michael G Schwern
On Fri, Aug 26, 2005 at 09:06:50AM -0700, Steve Peters via RT wrote:
  $a = 10;
  if (local $a = 1){
  }
  print $a; # Should be 10, not 1

Still busted in 5.8.6 and blead.

$ bleadperl -wle '$a = 10;  if( local $a = 1 ) {}  print $a'
Found = in conditional, should be == at -e line 1.
1
$ bleadperl -wle '$a = 10;  if( my $a = 1 ) {}  print $a'
Found = in conditional, should be == at -e line 1.
10


-- 
Michael G Schwern [EMAIL PROTECTED] http://www.pobox.com/~schwern
'All anyone gets in a mirror is themselves,' she said. 'But what you
gets in a good gumbo is everything.'
-- Witches Abroad by Terry Prachett


Re: [perl #37128] undefing *foo{CODE} does not fully work

2005-09-10 Thread Rafael Garcia-Suarez
On 9/10/05, Dave Mitchell [EMAIL PROTECTED] wrote:
 Undefing a sub is not the same as deleting a sub. Internally, the CV
 continues to exist, but its pad and op tree are freed. cf:

One of the items on the todo list is to allow the construct

delete foo;

I could finish my patch to do it if I could figure out how to delete a
CV cleanly from all the stashes where it's referenced... (subs have
this tendency to be exported in other stashes.)


Encode 2.12 example from docs fails

2005-09-10 Thread Ruslan U. Zakirov
Hello.
Today I've tried utf-8-strict example from latest Encode:
 perl -w -Mstrict -MEncode -e 'my $str = encode(utf-8,
\x{_}, 1);'
Unicode character 0x is illegal at -e line 1.
\x{00fe} does not map to utf8 at
/usr/lib/perl5/5.8.7/x86_64-linux/Encode.pm line 150.
 perl -w -Mstrict -MEncode -e 'my $str = encode(utf8,
\x{_}, 1);'
Unicode character 0x is illegal at -e line 1.
Modification of a read-only value attempted at
/usr/lib/perl5/5.8.7/x86_64-linux/Encode.pm line 151.

As you can see second command fails, but shouldn't.
Tried 2.10 also fails.

--
Best regards, Ruslan.

 perl -V
Summary of my perl5 (revision 5 version 8 subversion 7) configuration:
  Platform:
osname=linux, osvers=2.6.11-gentoo-r10-c8, archname=x86_64-linux
uname='linux cubic-pc 2.6.11-gentoo-r10-c8 #7 wed jul 6 00:16:28 msd
2005 x86_64 amd athlon(tm) 64 processor 2800+ authenticamd gnulinux '
config_args='-des -Darchname=x86_64-linux -Dcccdlflags=-fPIC
-Dccdlflags=-rdynamic -Dcc=x86_64-pc-linux-gnu-gcc -Dprefix=/usr
-Dvendorprefix=/usr -Dsiteprefix=/usr -Dlocincpth=  -Doptimize=-march=k8
-pipe -O2 -Duselargefiles -Dd_semctl_semun -Dscriptdir=/usr/bin
-Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3
-Dinstallman1dir=/var/tmp/portage/perl-5.8.7/image//usr/share/man/man1
-Dinstallman3dir=/var/tmp/portage/perl-5.8.7/image//usr/share/man/man3
-Dman1ext=1 -Dman3ext=3pm -Dinc_version_list=5.8.0 5.8.0/x86_64-linux
5.8.2 5.8.2/x86_64-linux 5.8.4 5.8.4/x86_64-linux 5.8.5
5.8.5/x86_64-linux 5.8.6 5.8.6/x86_64-linux  -Dcf_by=Gentoo -Ud_csh
-Di_ndbm -Ui_gdbm -Di_db -Dusrinc=/usr/include/gentoo-multilib/amd64'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=define use64bitall=define uselongdouble=undef
usemymalloc=n, bincompat5005=undef
  Compiler:
cc='x86_64-pc-linux-gnu-gcc', ccflags ='-fno-strict-aliasing -pipe
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-march=k8 -pipe -O2',
cppflags='-fno-strict-aliasing -pipe'
ccversion='', gccversion='3.4.4 (Gentoo 3.4.4, ssp-3.4.4-1.0,
pie-8.7.8)', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
  Linker and Libraries:
ld='x86_64-pc-linux-gnu-gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lpthread -lnsl -lndbm -ldb -ldl -lm -lcrypt -lutil -lc
perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
libc=/lib/libc-2.3.5.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.3.5'
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: USE_64_BIT_INT USE_64_BIT_ALL USE_LARGE_FILES
  Built under linux
  Compiled at Jul 11 2005 23:18:25
  @INC:
/etc/perl
/usr/lib/perl5/site_perl/5.8.7/x86_64-linux
/usr/lib/perl5/site_perl/5.8.7
/usr/lib/perl5/site_perl/5.8.6
/usr/lib/perl5/site_perl/5.8.6/x86_64-linux
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.7/x86_64-linux
/usr/lib/perl5/vendor_perl/5.8.7
/usr/lib/perl5/vendor_perl/5.8.6
/usr/lib/perl5/vendor_perl/5.8.6/x86_64-linux
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.7/x86_64-linux
/usr/lib/perl5/5.8.7
/usr/local/lib/site_perl
/usr/lib/perl5/site_perl/5.8.6
/usr/lib/perl5/site_perl/5.8.6/x86_64-linux
.


[perl #37133] perl crash related to threads and lock()

2005-09-10 Thread via RT
# New Ticket Created by  [EMAIL PROTECTED] 
# Please include the string:  [perl #37133]
# in the subject line of all future correspondence about this issue. 
# URL: https://rt.perl.org/rt3/Ticket/Display.html?id=37133 



This is a bug report for perl from [EMAIL PROTECTED],
generated with the help of perlbug 1.35 running under perl v5.8.4.


-
[Please enter your report here]

The simple program below causes a crash in perl on the following platforms:
(5.8.7)  2.6.8-2-mckinley-smp #1 SMP ia64 GNU/Linux
(5.8.4)  2.6.8.1.20040829 #1 SMP i686 GNU/Linux
(5.8.4)  2.4.25 #6 SMP i686 GNU/Linux
(5.8.4)  2.4.27.20040829 #5 SMP i686 GNU/Linux 

(perlbug was run on the 2.4.25 machine, but sent from another machine)

the same program does not appear to crash on the following platforms:
(5.8.4)  2.6.10-5-386 #1 i686 GNU/Linux
(5.8.0)  2.4.21-4.ELsmp #1 SMP i686 i686 i386 GNU/Linux

When perl crashes it gives one of the following errors, depending on the
platform:

== 
panic: destruct destroyed thread [EMAIL PROTECTED]@l0@ during global
destruction.
Segmentation fault
== 
(in cleanup) panic: destruct destroyed thread 828c0e8 (no reference) at
./test.pl line 23.
panic: MUTEX_DESTROY (16) [threads.xs:152] during global destruction.
Segmentation fault
==

the program also sometimes generates a segmentation fault (but no error) when
CTRL-C is pressed while it is running.

Sometimes the thread reference is a valid number, but sometimes it is printed
out as random ascii characters (as in the first message above).  the program
usually crashes within a minute or two.  on the 2.6.10 machine where it did not
crash, i let the program run for 20 minutes or more.


Here is the program:


#!/usr/bin/perl -w

use warnings;
use strict;
use threads;
use threads::shared;

my $var : shared = 0;

sub go
{
  lock($var);
}

while(1) {
  my $thr1 = threads-new(\go);
  $thr1-detach;
} 


[please do not change anything below this line]
-
---
flags:
category=core
severity=high
---
site configuration information for perl v5.8.4:

configured by debian project at thu feb  3 01:11:27 est 2005.

summary of my perl5 (revision 5 version 8 subversion 4) configuration:
  platform:
osname=linux, osvers=2.4.27-ti1211, archname=i386-linux-thread-multi
uname='linux kosh 2.4.27-ti1211 #1 sun sep 19 18:17:45 est 2004 i686 
gnulinux '
config_args='-dusethreads -duselargefiles -dccflags=-ddebian 
-dcccdlflags=-fpic -darchname=i386-linux -dprefix=/usr 
-dprivlib=/usr/share/perl/5.8 -darchlib=/usr/lib/perl/5.8 -dvendorprefix=/usr 
-dvendorlib=/usr/share/perl5 -dvendorarch=/usr/lib/perl5 
-dsiteprefix=/usr/local -dsitelib=/usr/local/share/perl/5.8.4 
-dsitearch=/usr/local/lib/perl/5.8.4 -dman1dir=/usr/share/man/man1 
-dman3dir=/usr/share/man/man3 -dsiteman1dir=/usr/local/man/man1 
-dsiteman3dir=/usr/local/man/man3 -dman1ext=1 -dman3ext=3perl 
-dpager=/usr/bin/sensible-pager -uafs -ud_csh -uusesfio -uusenm -duseshrplib 
-dlibperl=libperl.so.5.8.4 -dd_dosuid -des'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define 
usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
  compiler:
cc='cc', ccflags ='-d_reentrant -d_gnu_source -dthreads_have_pids -ddebian 
-fno-strict-aliasing -i/usr/local/include -d_largefile_source 
-d_file_offset_bits=64',
optimize='-o2',
cppflags='-d_reentrant -d_gnu_source -dthreads_have_pids -ddebian 
-fno-strict-aliasing -i/usr/local/include'
ccversion='', gccversion='3.3.5 (debian 1:3.3.5-8)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, off_t='off_t', 
lseeksize=8
alignbytes=4, prototype=define
  linker and libraries:
ld='cc', ldflags =' -l/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
perllibs=-ldl -lm -lpthread -lc -lcrypt
libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libperl.so.5.8.4
gnulibc_version='2.3.2'
  dynamic linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-wl,-e'
cccdlflags='-fpic', lddlflags='-shared -l/usr/local/lib'

locally applied patches:


---
@inc for perl v5.8.4:
/usr/local/sw/perl
/etc/perl
/usr/local/lib/perl/5.8.4
/usr/local/share/perl/5.8.4
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.8
/usr/share/perl/5.8
/usr/local/lib/site_perl
.

---
environment for perl v5.8.4:
home=/home/stefan
lang (unset)
language (unset)


Re: [perl #37029] Perl bug - help

2005-09-10 Thread Michael G Schwern
On Tue, Aug 30, 2005 at 06:51:22AM -0700, Yeoman, Dave wrote:
 I'm by no means an expert with perl, but I need some Perl help.  We have one
 x440 server with RH 3.0.5 and perl v5.8.0 built for
 i386-linux-thread-multiand and another server x445 upgraded with RH 4.0 perl
 v5.8.5 built for i386-linux-thread-multi.  The server with Perl v5.8.5
 produces different results from the pop (line 458 below) and I'm not sure
 why.  Can you help answer my question?

RedHat seriously mangled its release of 5.8.0.  Amongst other things, its
not really 5.8.0 but 5.8.0 + a pile of Unicode patches from the development
branch of Perl at the time.  There are many, many problems with it.  I don't
know if your pop() issue is due to this but I would suggest you save yourself
some future pain and not use it at all.


-- 
Michael G Schwern [EMAIL PROTECTED] http://www.pobox.com/~schwern
Reality is that which, when you stop believing in it, doesn't go away.
-- Phillip K. Dick


[perl #36075] Adding malloc_size/malloc_good_size to Configure

2005-09-10 Thread Steve Peters via RT
 [nicholas - Wed Jun 01 08:09:31 2005]:
 
 This is a bug report for perl from [EMAIL PROTECTED],
 generated with the help of perlbug 1.35 running under perl v5.9.3.
 
 
 -
 [Please enter your report here]
 
 Darwin provides 2 extra malloc() functions:
 
  The malloc_size() function returns the size of the memory block
that
  backs the allocation pointed to by ptr.  The memory block size is
always
  at least as large as the allocation it backs, and may be larger.
 
  The malloc_good_size() function rounds size up to a value that
the allo-
  cator implementation can allocate without adding any padding and
returns
  that rounded up value.
 
 It's not clear if any other malloc implementations provide these
functions, or
 the same functionality with another name, apart from Perl's own
malloc's
 malloced_size
 
 It would be useful to probe for them, because if they either are found
it would
 allow efficiency savings in various places. Specifically when buffers
allocated
 for SvPVX() we could set SvLEN() to the true maximum length, and AV
storage
 extension could be tuned to use all the memory malloc() actually gave
us.
 

Adding the detection for these function is pretty simple, and Configure doesn't 
need to do 
anything more that standard libc scanning.  I'm guessing it would be easy to 
add to 
Metaconfig to check.  The following patches can do it for playing with, but 
don't apply to p4.

Merijn, do you need any more information for the Metaconfig changes?

--- Configure.old   Tue Sep  6 09:38:43 2005
+++ Configure   Sat Sep 10 19:44:50 2005
@@ -550,6 +550,8 @@
 d_lseekproto=''
 d_lstat=''
 d_madvise=''
+d_malloc_size=''
+d_malloc_good_size=''
 d_mblen=''
 d_mbstowcs=''
 d_mbtowc=''
@@ -14247,6 +14249,14 @@
 set madvise d_madvise
 eval $inlibc
 
+: see if malloc_size exists
+set malloc_size d_malloc_size
+eval $inlibc
+
+: see if malloc_size_good exists
+set malloc_good_size d_malloc_good_size
+eval $inlibc
+
 : see if mblen exists
 set mblen d_mblen
 eval $inlibc
@@ -21112,6 +21122,8 @@
 d_lseekproto='$d_lseekproto'
 d_lstat='$d_lstat'
 d_madvise='$d_madvise'
+d_malloc_size='$d_malloc_size'
+d_malloc_size_good='$d_malloc_size_good'
 d_mblen='$d_mblen'
 d_mbstowcs='$d_mbstowcs'
 d_mbtowc='$d_mbtowc'

--- config_h.SH.old Tue Jun 21 14:56:18 2005
+++ config_h.SH Sat Sep 10 19:22:05 2005
@@ -3889,6 +3889,18 @@
  */
 #$d_libm_lib_version LIBM_LIB_VERSION  /**/
 
+/* HAS_MALLOC_SIZE
+ *  This symbol, if defined, indicates that the malloc_size
+ *  routine is available for use.
+ */
+#$d_malloc_size HAS_MALLOC_SIZE /**/
+
+/* HAS_MALLOC_GOOD_SIZE
+ *  This symbol, if defined, indicates that the malloc_good_size
+ *  routine is available for use.
+ */
+#$d_malloc_good_size HAS_MALLOC_GOOD_SIZE /**/
+
 /* HAS_NL_LANGINFO:
  * This symbol, if defined, indicates that the nl_langinfo routine is
  * available to return local data.  You will also need langinfo.h



[perl #32884] API doc for SvUTF8

2005-09-10 Thread Steve Peters via RT
 [EMAIL PROTECTED] - Sun Dec 05 18:25:51 2004]:
 
 
 This is a bug report for perl from [EMAIL PROTECTED],
 generated with the help of perlbug 1.35 running under perl v5.8.4.
 
 
 -
 [Please enter your report here]
 
 The doc for SvUTF8 says:
 
SvUTF8  Returns a boolean indicating whether the SV contains
UTF-8
encoded data.
 
boolSvUTF8(SV* sv)
 
 The code however does:
 
 #define SvUTF8(sv) (SvFLAGS(sv)  SVf_UTF8)
 
 which results in an U32
 
 That is of course no problem in constructs like:
 
 if (SvUTF8(sv)) { ... }
 
 but if you do:
 
bool utf8 = SvUTF8(sv);
...
if (utf8) { ... }
 
 things fail badly because (at least on my system) the bool enum
becomes a
 char, and since SVf_UTF8 is 0x2000, utf8 will always be 0 after
truncate.
 
 Either the docs or the macro should be updated I think
 
 Several other things that are called bool in the api doc have the
same
 problem (e.g. SvIOK, SvIOKp, SvPOK, etc)
 


Acutally, everything looking a return value from SvFLAGS(sv) should be
looking for a U32.  Since I'd like to automate these changes as much
as possible, how does the following look?  

--- sv.h.oldSat Sep 10 20:30:54 2005
+++ sv.hSat Sep 10 20:30:47 2005
@@ -703,8 +703,8 @@
SvFLAGS(sv) |= (SVf_NOK|SVp_NOK))
 
 /*
-=for apidoc Am|bool|SvUTF8|SV* sv
-Returns a boolean indicating whether the SV contains UTF-8 encoded data.
+=for apidoc Am|U32l|SvUTF8|SV* sv
+Returns a U32 value indicating whether the SV contains UTF-8 encoded data.
 
 =for apidoc Am|void|SvUTF8_on|SV *sv
 Turn on the UTF-8 status of an SV (the data is not changed, just the flag).


There will probably need to be some changes in the core as well where
any of Sv*OK-like macros are on the right side of an assignment.


Re: Transliteration operator(tr//)on EBCDIC platform

2005-09-10 Thread SADAHIRO Tomoyuki

On Wed, 31 Aug 2005 19:53:37 +0530, Sastry [EMAIL PROTECTED] wrote

 Hi Sadahiro
   The patch has resolved four tests that were failing previously but one 
 more test is stilling failing(which was failing even before applying the 
 patch).
  Here is the test case
  
 ($a = v300.196.172.302.197.172) =~ tr/\x{12c}-\x{130}/\xc0-\xc4/;
 is($a, v192.196.172.194.197.172, 'UTF range');
  # got 'DÐDEÐ'
 # expected '{DÐBEÐ'
  Can you suggest some pointers towards fixing this?
  -Sastry

This EBCDIC-specific problem is based on how to treat with code values
including Unicode (\x{12c}-\x{130} is surely Unicode) on EBCDIC platform.
Native code values in EBCDIC (for example 'A' == 193) almost differs
from the range of 0..255 in Unicode (for example 'A' == 65) which
coincides with ASCII/Latin1.

Thus the middle part of a character range is gererally different
between EBCDIC and Unicode.

For example consider a character range \xc0-\xc4. Since the mappings
\xc0 to '{' (an open curly) and \xc4 to D in EBCDIC are definite,
the range \xc0-\xc4 is equivalent to {-D on EBCDIC platform.

In EBCDIC {-D (\xc0-\xc4) can be expanded to \xc0\xc1\xc2\xc3\xc4,
but in Unicode {-D cannot be expanded, as the Unicode scalar values
of the endpoints are reverse ('{' = U+007B, D = U+0044).

Actually the current perl implementation is confused:
in the parse time (see toke.c#scan_const) perl treats the range
in EBCDIC order and then does not catch as Invalid range,
though in the compile time (see op.c#pmtrans) and the run time
(see doop.c#do_trans_simple_utf8 and its friends) perl treats
the range in Unicode order and then generates a strange result.

In my opinion it is necessary to determine how to expand character
ranges with Unicode (whether the native EBCDIC order or Unicode order).
I'm not sure using the native encoding (ASCII/Latin1/EBCDIC) everytime
(that is same as no Unicode within 0..255) makes people happy.

Regards,
SADAHIRO Tomoyuki




Re: [EMAIL PROTECTED] VMS fixes for cbuilder

2005-09-10 Thread John E. Malmberg

John E. Malmberg wrote:

Ken Williams wrote:


Hi John,

After my last email I reworked the patch so that all the 
modifications  are in Platform/VMS.pm.  Could you confirm that it 
still works for you  and I haven't broken it?


Hello Ken,

As I previously wrote to you, both my patch and this patch do not work.

While my patch fixed the ParseXS/t/basic that I was working on, it broke 
three other tests.


I have requested that Change 25364 be regressed from blead.

I have rerun all the lib/Extutils/ tests with this latest patched 
version of CBuilder/Platform/VMS.pm and the original CBuilder/base.pm.



In this patch:

sub need_prelink is left to return 0, because the VMS specific sub 
do_link has to set up the pre-link option file when needed.



In sub arg_include_dirs, I think I have fixed the it to properly extract 
the include directories from the $self-{config}{ccflags}.


I am still quite a novice in Perl programming.

Not only is the '/inc' case insensitive as you noted, it can be any 
thing from: '/inc=[]' to '/include_directory=([],[foo])'.


Next is that I needed to create a VMS specific sub lib_file and put the 
Dynaloader::mod2fname() code into it to set the name of the shared image.



The VMS specific sub _do_link that you provided needed to have the name 
changing code removed from it and put into lib_file as I mentioned 
above, so that test CBuilder/t/02-link will pass.


I also had to make the addition of the link option files conditional on 
if you are building a loadable image.


-John
[EMAIL PROTECTED]
Personal Opinion Only
--- lib/ExtUtils/CBuilder/Platform/VMS.pm_old   Sat Sep 10 22:28:04 2005
+++ lib/ExtUtils/CBuilder/Platform/VMS.pm   Sat Sep 10 23:45:10 2005
@@ -9,11 +9,20 @@
 
 sub need_prelink { 0 }
 
+
+
 sub arg_include_dirs {
-  my $self = shift;
-  return '/include=(' . join(',', @_) . ')';
+  my ($self, @dirs) = @_;
+
+  # VMS can only have one include list, add the one from config.
+  if ($self-{config}{ccflags} =~ s{/inc[^=]+(?:=)+(?:\()?([^\/\)]*)} {}i) {
+unshift @dirs, $1;
+  }
+  return unless @dirs;
+  return ('/include=(' . join(',', @dirs) . ')');
 }
 
+
 sub arg_nolink { return; }
 
 sub arg_object_file {
@@ -31,4 +40,43 @@
   return ($self-{config}{lddlflags}=$file);
 }
 
-1;
+
+sub lib_file {
+  my ($self, $dl_file) = @_;
+  $dl_file =~ s/\.[^.]+$//;
+  $dl_file =~ tr///d;
+  $dl_file = $dl_file .= '.' . $self-{config}{dlext};
+
+  # Need to create with the same name as DynaLoader will load with.
+  if (defined DynaLoader::mod2fname) {
+my ($dev,$dir,$file) = File::Spec-splitpath($dl_file);
+$file = DynaLoader::mod2fname([$file]);
+$dl_file = File::Spec-catpath($dev,$dir,$file);
+  }
+  return $dl_file;
+}
+
+sub _do_link {
+  my ($self, $type, %args) = @_;
+
+  my $objects = delete $args{objects};
+  $objects = [$objects] unless ref $objects;
+
+  my @temp_files;
+  @temp_files =
+$self-prelink(%args,
+  dl_name = $args{module_name}) if $args{lddl};
+
+  # VMS has two option files, the external symbol, and to pull in  PerlShr
+  if ($args{lddl}) {
+$objects-[-1] .= ',';
+
+# If creating a loadable library, the link option file is needed.
+push @$objects, 'sys$disk:[]' . $temp_files[0] . '/opt,';
+
+# VMS always needs the option file for the Perl shared image.
+push @$objects, $self-perl_inc() . 'PerlShr.Opt/opt';
+  }
+
+  return $self-SUPER::_do_link($type, %args, objects = $objects);
+}


Re: PathTools 3.10 released

2005-09-10 Thread Michael G Schwern
On Thu, Aug 25, 2005 at 10:31:03PM -0500, Ken Williams wrote:
 I finally found time to implement the code for the prospective tests 
 that Schwern added to File::Spec, so I uploaded 3.10 to CPAN.  Should 
 be hitting mirrors now.

Which prospective tests were those?


-- 
Michael G Schwern [EMAIL PROTECTED] http://www.pobox.com/~schwern



[perl #36448] [PATCH] configuring ranlib for perl on osx with xcode 2.1

2005-09-10 Thread Steve Peters via RT
 [EMAIL PROTECTED] - Fri Jul 01 14:56:29 2005]:
 
 Hello,
 
 It looks like Apple has changed how ar works in xcode 2.1.  As a
 result, Configure thinks that ar can generate random libraries.
 
 This breaks linking libperl.a, for instance when building PerlApp.
 
 Configure doesn't currently allow overriding ranlib when Configure
 detects that ranlib isn't necessary.  My patch fixes this, and sets
 ranlib for darwin.
 
 Note that this patch is for ActivePerl 5.6.1 (it doesn't appear to be
 fixed in 5.9.2), so it probably needs to be manually applied...
 
  Configure 
 13888c13888,13890
ranlib=:
 ---
  if [ X$ranlib = X ]; then
  ranlib=:
  fi
 
  hints/darwin.sh 
 179a180,183
  # Configure doesn't detect ranlib on Tiger properly.
  # NeilW says this should be acceptable on all darwin versions.
  ranlib='ranlib'
 
 Luke
 
 
 

Has anyone looked at this patch yet?  I'm assuming that since it was
written against 5.6.1 rather than the current bleadperl and it isn't in
diff -u format, a new patch might be needed.

One question comes to mind when I look at it, though.  Have you tested
the patch on a non-Tiger system?