Vincent Pit
2010-07-29 17:25:31 UTC
In perl.git, the branch maint-5.12 has been updated
<http://perl5.git.perl.org/perl.git/commitdiff/5c6cdfc10df435a14a49c02c67e889583fd139e1?hp=f92e1718523b52f975efb93ca562725b1c2cbd28>
- Log -----------------------------------------------------------------
commit 5c6cdfc10df435a14a49c02c67e889583fd139e1
Author: Florian Ragwitz <***@debian.org>
Date: Fri Jul 23 15:56:08 2010 +0200
Clarify core module directories for UPSTREAM => undef modules
M pod/perlhack.pod
commit 2546efdb27e9a2a4000f5445fc7ca07e60fb1a32
Author: Florian Ragwitz <***@debian.org>
Date: Fri Jul 23 04:46:13 2010 +0200
Fix POD formatting in perlrepository.pod
=for is just for one paragraph, not until the next command or anything like
that.
M pod/perlrepository.pod
commit e3f53aa047803fe2f99d2c058251f2a1975370bc
Author: Florian Ragwitz <***@debian.org>
Date: Thu Jul 22 06:27:04 2010 +0200
Fix leaks in XS_VERSION_BOOTCHECK
The SV holding XS_VERSION, and the version object created from it were
leaked. Also, if the version from perl space wasn't a version object already,
the one that got created leaked.
Additionally, in case of an error, the two SVs returned by vstringify were
leaked.
M XSUB.h
commit aee71fbaa96ef1ff54a852be9278fb03b5b54e9f
Author: Jan Dubois <***@activestate.com>
Date: Tue Jul 20 18:48:59 2010 -0700
alarm() on Windows cannot interrupt blocking I/O
M pod/perlport.pod
commit d0e81a6a3f6f393a6c3e421ca7975e3c1cd15392
Author: Brian Phillips <***@cpan.org>
Date: Wed Jun 30 10:31:25 2010 -0500
Add additional notes regarding srand and forking
perldoc -f srand states that typical use requires no srand() to be
called. This is true with the exception of forking where you may not
want the same seed across various child processes (i.e. mod_perl).
This patch simply adds a note reminding the reader of this fact and
more specifically states that srand should only be called once per
*process* (instead of the previous language of once per *script*).
Signed-off-by: Brian Phillips <***@cpan.org>
M pod/perlfunc.pod
-----------------------------------------------------------------------
Summary of changes:
XSUB.h | 34 +++++++++++++++++++++++-----------
pod/perlfunc.pod | 8 +++++---
pod/perlhack.pod | 4 ++++
pod/perlport.pod | 6 ++++++
pod/perlrepository.pod | 1 -
5 files changed, 38 insertions(+), 15 deletions(-)
diff --git a/XSUB.h b/XSUB.h
index 06cb1c3..5d976b4 100644
--- a/XSUB.h
+++ b/XSUB.h
@@ -294,7 +294,7 @@ Rethrows a previously caught exception. See L<perlguts/"Exception Handling">.
#define newXSproto(a,b,c,d) newXS_flags(a,b,c,d,0)
#ifdef XS_VERSION
-# define XS_VERSION_BOOTCHECK \
+# define XS_VERSION_BOOTCHECK \
STMT_START { \
SV *_sv; \
const char *vn = NULL, *module = SvPV_nolen_const(ST(0)); \
@@ -305,19 +305,31 @@ Rethrows a previously caught exception. See L<perlguts/"Exception Handling">.
_sv = get_sv(Perl_form(aTHX_ "%s::%s", module, \
vn = "XS_VERSION"), FALSE); \
if (!_sv || !SvOK(_sv)) \
- _sv = get_sv(Perl_form(aTHX_ "%s::%s", module, \
+ _sv = get_sv(Perl_form(aTHX_ "%s::%s", module, \
vn = "VERSION"), FALSE); \
} \
if (_sv) { \
- SV *xssv = Perl_newSVpv(aTHX_ XS_VERSION, 0); \
- xssv = new_version(xssv); \
- if ( !sv_derived_from(_sv, "version") ) \
- _sv = new_version(_sv); \
- if ( vcmp(_sv,xssv) ) \
- Perl_croak(aTHX_ "%s object version %"SVf" does not match %s%s%s%s %"SVf,\
- module, SVfARG(vstringify(xssv)), \
- vn ? "$" : "", vn ? module : "", vn ? "::" : "", \
- vn ? vn : "bootstrap parameter", SVfARG(vstringify(_sv)));\
+ SV *xpt = NULL; \
+ SV *xssv = Perl_newSVpvn(aTHX_ STR_WITH_LEN(XS_VERSION)); \
+ SV *pmsv = sv_derived_from(_sv, "version") \
+ ? SvREFCNT_inc_simple_NN(_sv) \
+ : new_version(_sv); \
+ xssv = upg_version(xssv, 0); \
+ if ( vcmp(pmsv,xssv) ) { \
+ xpt = Perl_newSVpvf(aTHX_ "%s object version %"SVf \
+ " does not match %s%s%s%s %"SVf, \
+ module, \
+ SVfARG(Perl_sv_2mortal(aTHX_ vstringify(xssv))), \
+ vn ? "$" : "", vn ? module : "", \
+ vn ? "::" : "", \
+ vn ? vn : "bootstrap parameter", \
+ SVfARG(Perl_sv_2mortal(aTHX_ vstringify(pmsv)))); \
+ Perl_sv_2mortal(aTHX_ xpt); \
+ } \
+ SvREFCNT_dec(xssv); \
+ SvREFCNT_dec(pmsv); \
+ if (xpt) \
+ Perl_croak_sv(aTHX_ xpt); \
} \
} STMT_END
#else
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 5da10ac..cc3c341 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -6152,15 +6152,17 @@ Most programs won't even call srand() at all, except those that
need a cryptographically-strong starting point rather than the
generally acceptable default, which is based on time of day,
process ID, and memory allocation, or the F</dev/urandom> device
-if available.
+if available. You may also want to call srand() after a fork() to
+avoid child processes sharing the same seed value as the parent (and
+consequently each other).
You can call srand($seed) with the same $seed to reproduce the
I<same> sequence from rand(), but this is usually reserved for
generating predictable results for testing or debugging.
Otherwise, don't call srand() more than once in your program.
-Do B<not> call srand() (i.e., without an argument) more than once in
-a script. The internal state of the random number generator should
+Do B<not> call srand() (i.e., without an argument) more than once per
+process. The internal state of the random number generator should
contain more entropy than can be provided by any seed, so calling
srand() again actually I<loses> randomness.
diff --git a/pod/perlhack.pod b/pod/perlhack.pod
index 45ac395..f4dac2c 100644
--- a/pod/perlhack.pod
+++ b/pod/perlhack.pod
@@ -381,6 +381,10 @@ core:
dist/ is for dual-life modules, where the blead source is canonical.
+For some dual-life modules it has not been discussed if the CPAN version or the
+blead source is canonical. Until that is done, those modules should be in
+F<cpan/>.
+
=item Tests
There are tests for nearly all the modules, built-ins and major bits
diff --git a/pod/perlport.pod b/pod/perlport.pod
index 6439bf8..e79c677 100644
--- a/pod/perlport.pod
+++ b/pod/perlport.pod
@@ -1514,6 +1514,12 @@ suffixes. C<-S> is meaningless. (Win32)
C<-x> (or C<-X>) determine if a file has an executable file type.
(S<RISC OS>)
+=item alarm
+
+Emulated using timers that must be explicitly polled whenever Perl
+wants to dispatch "safe signals" and therefore cannot interrupt
+blocking system calls. (Win32)
+
=item atan2
Due to issues with various CPUs, math libraries, compilers, and standards,
diff --git a/pod/perlrepository.pod b/pod/perlrepository.pod
index 879049b..0206fbd 100644
--- a/pod/perlrepository.pod
+++ b/pod/perlrepository.pod
@@ -427,7 +427,6 @@ immediately after the source-changes that caused them, so as to have
as little effect as possible on the bisectability of your patchset.
=for XXX
-
What should we recommend about binary files now? Do we need anything?
=head2 Getting your patch accepted
--
Perl5 Master Repository
<http://perl5.git.perl.org/perl.git/commitdiff/5c6cdfc10df435a14a49c02c67e889583fd139e1?hp=f92e1718523b52f975efb93ca562725b1c2cbd28>
- Log -----------------------------------------------------------------
commit 5c6cdfc10df435a14a49c02c67e889583fd139e1
Author: Florian Ragwitz <***@debian.org>
Date: Fri Jul 23 15:56:08 2010 +0200
Clarify core module directories for UPSTREAM => undef modules
M pod/perlhack.pod
commit 2546efdb27e9a2a4000f5445fc7ca07e60fb1a32
Author: Florian Ragwitz <***@debian.org>
Date: Fri Jul 23 04:46:13 2010 +0200
Fix POD formatting in perlrepository.pod
=for is just for one paragraph, not until the next command or anything like
that.
M pod/perlrepository.pod
commit e3f53aa047803fe2f99d2c058251f2a1975370bc
Author: Florian Ragwitz <***@debian.org>
Date: Thu Jul 22 06:27:04 2010 +0200
Fix leaks in XS_VERSION_BOOTCHECK
The SV holding XS_VERSION, and the version object created from it were
leaked. Also, if the version from perl space wasn't a version object already,
the one that got created leaked.
Additionally, in case of an error, the two SVs returned by vstringify were
leaked.
M XSUB.h
commit aee71fbaa96ef1ff54a852be9278fb03b5b54e9f
Author: Jan Dubois <***@activestate.com>
Date: Tue Jul 20 18:48:59 2010 -0700
alarm() on Windows cannot interrupt blocking I/O
M pod/perlport.pod
commit d0e81a6a3f6f393a6c3e421ca7975e3c1cd15392
Author: Brian Phillips <***@cpan.org>
Date: Wed Jun 30 10:31:25 2010 -0500
Add additional notes regarding srand and forking
perldoc -f srand states that typical use requires no srand() to be
called. This is true with the exception of forking where you may not
want the same seed across various child processes (i.e. mod_perl).
This patch simply adds a note reminding the reader of this fact and
more specifically states that srand should only be called once per
*process* (instead of the previous language of once per *script*).
Signed-off-by: Brian Phillips <***@cpan.org>
M pod/perlfunc.pod
-----------------------------------------------------------------------
Summary of changes:
XSUB.h | 34 +++++++++++++++++++++++-----------
pod/perlfunc.pod | 8 +++++---
pod/perlhack.pod | 4 ++++
pod/perlport.pod | 6 ++++++
pod/perlrepository.pod | 1 -
5 files changed, 38 insertions(+), 15 deletions(-)
diff --git a/XSUB.h b/XSUB.h
index 06cb1c3..5d976b4 100644
--- a/XSUB.h
+++ b/XSUB.h
@@ -294,7 +294,7 @@ Rethrows a previously caught exception. See L<perlguts/"Exception Handling">.
#define newXSproto(a,b,c,d) newXS_flags(a,b,c,d,0)
#ifdef XS_VERSION
-# define XS_VERSION_BOOTCHECK \
+# define XS_VERSION_BOOTCHECK \
STMT_START { \
SV *_sv; \
const char *vn = NULL, *module = SvPV_nolen_const(ST(0)); \
@@ -305,19 +305,31 @@ Rethrows a previously caught exception. See L<perlguts/"Exception Handling">.
_sv = get_sv(Perl_form(aTHX_ "%s::%s", module, \
vn = "XS_VERSION"), FALSE); \
if (!_sv || !SvOK(_sv)) \
- _sv = get_sv(Perl_form(aTHX_ "%s::%s", module, \
+ _sv = get_sv(Perl_form(aTHX_ "%s::%s", module, \
vn = "VERSION"), FALSE); \
} \
if (_sv) { \
- SV *xssv = Perl_newSVpv(aTHX_ XS_VERSION, 0); \
- xssv = new_version(xssv); \
- if ( !sv_derived_from(_sv, "version") ) \
- _sv = new_version(_sv); \
- if ( vcmp(_sv,xssv) ) \
- Perl_croak(aTHX_ "%s object version %"SVf" does not match %s%s%s%s %"SVf,\
- module, SVfARG(vstringify(xssv)), \
- vn ? "$" : "", vn ? module : "", vn ? "::" : "", \
- vn ? vn : "bootstrap parameter", SVfARG(vstringify(_sv)));\
+ SV *xpt = NULL; \
+ SV *xssv = Perl_newSVpvn(aTHX_ STR_WITH_LEN(XS_VERSION)); \
+ SV *pmsv = sv_derived_from(_sv, "version") \
+ ? SvREFCNT_inc_simple_NN(_sv) \
+ : new_version(_sv); \
+ xssv = upg_version(xssv, 0); \
+ if ( vcmp(pmsv,xssv) ) { \
+ xpt = Perl_newSVpvf(aTHX_ "%s object version %"SVf \
+ " does not match %s%s%s%s %"SVf, \
+ module, \
+ SVfARG(Perl_sv_2mortal(aTHX_ vstringify(xssv))), \
+ vn ? "$" : "", vn ? module : "", \
+ vn ? "::" : "", \
+ vn ? vn : "bootstrap parameter", \
+ SVfARG(Perl_sv_2mortal(aTHX_ vstringify(pmsv)))); \
+ Perl_sv_2mortal(aTHX_ xpt); \
+ } \
+ SvREFCNT_dec(xssv); \
+ SvREFCNT_dec(pmsv); \
+ if (xpt) \
+ Perl_croak_sv(aTHX_ xpt); \
} \
} STMT_END
#else
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 5da10ac..cc3c341 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -6152,15 +6152,17 @@ Most programs won't even call srand() at all, except those that
need a cryptographically-strong starting point rather than the
generally acceptable default, which is based on time of day,
process ID, and memory allocation, or the F</dev/urandom> device
-if available.
+if available. You may also want to call srand() after a fork() to
+avoid child processes sharing the same seed value as the parent (and
+consequently each other).
You can call srand($seed) with the same $seed to reproduce the
I<same> sequence from rand(), but this is usually reserved for
generating predictable results for testing or debugging.
Otherwise, don't call srand() more than once in your program.
-Do B<not> call srand() (i.e., without an argument) more than once in
-a script. The internal state of the random number generator should
+Do B<not> call srand() (i.e., without an argument) more than once per
+process. The internal state of the random number generator should
contain more entropy than can be provided by any seed, so calling
srand() again actually I<loses> randomness.
diff --git a/pod/perlhack.pod b/pod/perlhack.pod
index 45ac395..f4dac2c 100644
--- a/pod/perlhack.pod
+++ b/pod/perlhack.pod
@@ -381,6 +381,10 @@ core:
dist/ is for dual-life modules, where the blead source is canonical.
+For some dual-life modules it has not been discussed if the CPAN version or the
+blead source is canonical. Until that is done, those modules should be in
+F<cpan/>.
+
=item Tests
There are tests for nearly all the modules, built-ins and major bits
diff --git a/pod/perlport.pod b/pod/perlport.pod
index 6439bf8..e79c677 100644
--- a/pod/perlport.pod
+++ b/pod/perlport.pod
@@ -1514,6 +1514,12 @@ suffixes. C<-S> is meaningless. (Win32)
C<-x> (or C<-X>) determine if a file has an executable file type.
(S<RISC OS>)
+=item alarm
+
+Emulated using timers that must be explicitly polled whenever Perl
+wants to dispatch "safe signals" and therefore cannot interrupt
+blocking system calls. (Win32)
+
=item atan2
Due to issues with various CPUs, math libraries, compilers, and standards,
diff --git a/pod/perlrepository.pod b/pod/perlrepository.pod
index 879049b..0206fbd 100644
--- a/pod/perlrepository.pod
+++ b/pod/perlrepository.pod
@@ -427,7 +427,6 @@ immediately after the source-changes that caused them, so as to have
as little effect as possible on the bisectability of your patchset.
=for XXX
-
What should we recommend about binary files now? Do we need anything?
=head2 Getting your patch accepted
--
Perl5 Master Repository