Change 18525 by jhi@lyta on 2003/01/20 17:54:12
Integrate:
[ 18516]
microperl update.
[ 18519]
Encode MANIFEST update.
[ 18521]
Retract #18154 (integrate of perlio #18507), not enough
threadsafety.
[ 18522]
Subject: [perl #20408] SV's SvPVX get freed even when its SvLEN is zero
From: "[EMAIL PROTECTED] (via RT)" <[EMAIL PROTECTED]>
Date: 20 Jan 2003 01:54:07 -0000
Message-Id: <[EMAIL PROTECTED]>
[ 18523]
Upgrade to Digest 1.02.
[ 18524]
Integrate from perlio:
[ 18520]
Move #define printf out of perl.h into appropriate
PerlIO files.
Affected files ...
... //depot/maint-5.8/perl/Makefile.micro#2 integrate
... //depot/maint-5.8/perl/ext/Encode/MANIFEST#4 integrate
... //depot/maint-5.8/perl/fakesdio.h#2 integrate
... //depot/maint-5.8/perl/lib/Digest.pm#3 integrate
... //depot/maint-5.8/perl/lib/Digest.t#2 integrate
... //depot/maint-5.8/perl/nostdio.h#2 integrate
... //depot/maint-5.8/perl/perl.h#12 integrate
... //depot/maint-5.8/perl/perlio.c#6 integrate
... //depot/maint-5.8/perl/pp_hot.c#8 integrate
... //depot/maint-5.8/perl/uconfig.h#2 integrate
... //depot/maint-5.8/perl/uconfig.sh#2 integrate
Differences ...
==== //depot/maint-5.8/perl/Makefile.micro#2 (text) ====
Index: perl/Makefile.micro
--- perl/Makefile.micro#1~17645~ Fri Jul 19 12:29:57 2002
+++ perl/Makefile.micro Mon Jan 20 09:54:12 2003
@@ -10,7 +10,7 @@
O = uav$(_O) udeb$(_O) udoio$(_O) udoop$(_O) udump$(_O) \
uglobals$(_O) ugv$(_O) uhv$(_O) \
umg$(_O) uperlmain$(_O) uop$(_O) ureentr$(_O) \
- uperl$(_O) uperlio$(_O) uperly$(_O) upp$(_O) \
+ upad$(_O) uperl$(_O) uperlio$(_O) uperly$(_O) upp$(_O) \
upp_ctl$(_O) upp_hot$(_O) upp_sys$(_O) upp_pack$(_O) upp_sort$(_O) \
uregcomp$(_O) uregexec$(_O) urun$(_O) \
uscope$(_O) usv$(_O) utaint$(_O) utoke$(_O) \
@@ -21,10 +21,10 @@
$(LD) -o $@ $(O) $(LIBS)
H = av.h uconfig.h cop.h cv.h embed.h embedvar.h form.h gv.h handy.h \
- hv.h intrpvar.h iperlsys.h mg.h op.h opcode.h opnames.h patchlevel.h \
- perl.h perlsdio.h perlvars.h perly.h pp.h pp_proto.h proto.h reentr.h \
- regexp.h scope.h sv.h thrdvar.h thread.h unixish.h utf8.h util.h \
- warnings.h
+ hv.h intrpvar.h iperlsys.h mg.h op.h opcode.h opnames.h pad.h \
+ patchlevel.h perl.h perlsdio.h perlvars.h perly.h pp.h \
+ pp_proto.h proto.h reentr.h regexp.h scope.h sv.h thrdvar.h \
+ thread.h unixish.h utf8.h util.h warnings.h
HE = $(H) EXTERN.h
@@ -84,6 +84,9 @@
ureentr$(_O): $(HE) reentr.c
$(CC) -c -o $@ $(CFLAGS) reentr.c
+
+upad$(_O): $(HE) pad.c
+ $(CC) -c -o $@ $(CFLAGS) pad.c
uperl$(_O): $(HE) perl.c
$(CC) -c -o $@ $(CFLAGS) perl.c
==== //depot/maint-5.8/perl/ext/Encode/MANIFEST#4 (text) ====
Index: perl/ext/Encode/MANIFEST
--- perl/ext/Encode/MANIFEST#3~18503~ Thu Jan 16 15:29:57 2003
+++ perl/ext/Encode/MANIFEST Mon Jan 20 09:54:12 2003
@@ -61,6 +61,7 @@
t/big5-eten.utf test data
t/big5-hkscs.enc test data
t/big5-hkscs.utf test data
+t/enc_eucjp.t test script
t/enc_utf8.t test script
t/encoding.t test script
t/fallback.t test script
==== //depot/maint-5.8/perl/fakesdio.h#2 (text) ====
Index: perl/fakesdio.h
--- perl/fakesdio.h#1~17645~ Fri Jul 19 12:29:57 2002
+++ perl/fakesdio.h Mon Jan 20 09:54:12 2003
@@ -55,6 +55,18 @@
#undef tmpfile
#undef ungetc
#undef vfprintf
+#undef printf
+
+/* printf used to live in perl.h like this - more sophisticated
+ than the rest
+ */
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && !defined(PERL_GCC_PEDANTIC)
+#define printf(fmt,args...) PerlIO_stdoutf(fmt,##args)
+#else
+#define printf PerlIO_stdoutf
+#endif
+#endif
+
#define fprintf PerlIO_printf
#define stdin PerlIO_stdin()
#define stdout PerlIO_stdout()
==== //depot/maint-5.8/perl/lib/Digest.pm#3 (text) ====
Index: perl/lib/Digest.pm
--- perl/lib/Digest.pm#2~18515~ Sat Jan 18 10:43:52 2003
+++ perl/lib/Digest.pm Mon Jan 20 09:54:12 2003
@@ -3,7 +3,7 @@
use strict;
use vars qw($VERSION %MMAP $AUTOLOAD);
-$VERSION = "1.01";
+$VERSION = "1.02";
%MMAP = (
"SHA-1" => "Digest::SHA1",
@@ -124,7 +124,7 @@
algorithm names which contains letters which are not legal perl
identifiers, e.g. "SHA-1".
-If new() is called as a instance method (i.e. $ctx->new) it will just
+If new() is called as an instance method (i.e. $ctx->new) it will just
reset the state the object to the state of a newly created object. No
new object is created in this case, and the return value is the
reference to the object (i.e. $ctx).
==== //depot/maint-5.8/perl/lib/Digest.t#2 (text) ====
Index: perl/lib/Digest.t
--- perl/lib/Digest.t#1~17645~ Fri Jul 19 12:29:57 2002
+++ perl/lib/Digest.t Mon Jan 20 09:54:12 2003
@@ -1,13 +1,9 @@
print "1..3\n";
-BEGIN {
- chdir 't' if -d 't';
- @INC = '../lib';
-}
-
use Digest;
-my $hexdigest = "900150983cd24fb0d6963f7d28e17f72";
+my $hexdigest = "900150983cd24fb0d6963f7d28e17f72"; # ASCII
+
if (ord('A') == 193) { # EBCDIC
$hexdigest = "fe4ea0d98f9cd8d1d27f102a93cb0bb0"; # IBM-1047
}
@@ -19,6 +15,7 @@
print "ok 2\n";
eval {
+ # Not yet EBCDICified.
print "not " unless Digest->new("HMAC-MD5" => "Jefe")->add("what do ya want for
nothing?")->hexdigest eq "750c783e6ab0b503eaa86e310a5db738";
print "ok 3\n";
};
==== //depot/maint-5.8/perl/nostdio.h#2 (text) ====
Index: perl/nostdio.h
--- perl/nostdio.h#1~17645~ Fri Jul 19 12:29:57 2002
+++ perl/nostdio.h Mon Jan 20 09:54:12 2003
@@ -68,8 +68,10 @@
#undef tmpfile
#undef ungetc
#undef vfprintf
+#undef printf
#define fprintf _CANNOT _fprintf_
+#define printf _CANNOT _printf_
#define stdin _CANNOT _stdin_
#define stdout _CANNOT _stdout_
#define stderr _CANNOT _stderr_
==== //depot/maint-5.8/perl/perl.h#12 (text) ====
Index: perl/perl.h
--- perl/perl.h#11~18387~ Wed Jan 1 17:39:31 2003
+++ perl/perl.h Mon Jan 20 09:54:12 2003
@@ -3897,17 +3897,6 @@
# define Atoul(s) Strtoul(s, (char **)NULL, 10)
#endif
-#if !defined(PERLIO_IS_STDIO)
-/*
- * Remap printf
- */
-#undef printf
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && !defined(PERL_GCC_PEDANTIC)
-#define printf(fmt,args...) PerlIO_stdoutf(fmt,##args)
-#else
-#define printf PerlIO_stdoutf
-#endif
-#endif
/* if these never got defined, they need defaults */
#ifndef PERL_SET_CONTEXT
==== //depot/maint-5.8/perl/perlio.c#6 (text) ====
Index: perl/perlio.c
--- perl/perlio.c#5~18515~ Sat Jan 18 10:43:52 2003
+++ perl/perlio.c Mon Jan 20 09:54:12 2003
@@ -2708,13 +2708,6 @@
}
else {
/* Tricky - must fclose(stdio) to free memory but not close(fd) */
-#ifdef USE_THREADS
- /* Sarathy pointed out that another thread could reuse
- fd after fclose() but before we dup2() below
- so take out a MUTEX to shut them out
- */
- MUTEX_LOCK(&PerlIO_mutex);
-#endif
dupfd = PerlLIO_dup(fd);
}
}
@@ -2732,14 +2725,12 @@
/* We need to restore fd from the saved copy */
if (PerlLIO_dup2(dupfd,fd) != fd)
result = -1;
-#ifdef USE_THREADS
- MUTEX_UNLOCK(&PerlIO_mutex);
-#endif
if (PerlLIO_close(dupfd) != 0)
result = -1;
}
return result;
}
+
}
==== //depot/maint-5.8/perl/pp_hot.c#8 (text) ====
Index: perl/pp_hot.c
--- perl/pp_hot.c#7~18445~ Sun Jan 5 06:46:32 2003
+++ perl/pp_hot.c Mon Jan 20 09:54:12 2003
@@ -2169,7 +2169,8 @@
sv_catpvn(dstr, s, strend - s);
(void)SvOOK_off(TARG);
- Safefree(SvPVX(TARG));
+ if (SvLEN(TARG))
+ Safefree(SvPVX(TARG));
SvPVX(TARG) = SvPVX(dstr);
SvCUR_set(TARG, SvCUR(dstr));
SvLEN_set(TARG, SvLEN(dstr));
==== //depot/maint-5.8/perl/uconfig.h#2 (text) ====
Index: perl/uconfig.h
--- perl/uconfig.h#1~17645~ Fri Jul 19 12:29:57 2002
+++ perl/uconfig.h Mon Jan 20 09:54:12 2003
@@ -1980,6 +1980,11 @@
* available to split a long double x into a fractional part f and
* an integer part i such that |f| < 1.0 and (f + i) = x.
*/
+/* HAS_MODFL_PROTO:
+ * This symbol, if defined, indicates that the system provides
+ * a prototype for the modfl() function. Otherwise, it is up
+ * to the program to supply one.
+ */
/* HAS_MODFL_POW32_BUG:
* This symbol, if defined, indicates that the modfl routine is
* broken for long doubles >= pow(2, 32).
@@ -1988,6 +1993,7 @@
* release 2.2.2 is known to be okay.
*/
/*#define HAS_MODFL / **/
+/*#define HAS_MODFL_PROTO / **/
/*#define HAS_MODFL_POW32_BUG / **/
/* HAS_MPROTECT:
@@ -2008,6 +2014,12 @@
*/
/*#define HAS_STRUCT_MSGHDR / **/
+/* HAS_NANOSLEEP:
+ * This symbol, if defined, indicates that the nanosleep
+ * system call is available to sleep with 1E-9 sec accuracy.
+ */
+/*#define HAS_NANOSLEEP / **/
+
/* HAS_OFF64_T:
* This symbol will be defined if the C compiler supports off64_t.
*/
@@ -2958,10 +2970,15 @@
* This symbol, if defined, indicates to the C program that
* the struct tm has a tm_zone field.
*/
+/* HAS_TM_TM_GMTOFF:
+ * This symbol, if defined, indicates to the C program that
+ * the struct tm has a tm_gmtoff field.
+ */
#define I_TIME /**/
/*#define I_SYS_TIME / **/
/*#define I_SYS_TIME_KERNEL / **/
/*#define HAS_TM_TM_ZONE / **/
+/*#define HAS_TM_TM_GMTOFF / **/
/* I_USTAT:
* This symbol, if defined, indicates that <ustat.h> exists and
==== //depot/maint-5.8/perl/uconfig.sh#2 (xtext) ====
Index: perl/uconfig.sh
--- perl/uconfig.sh#1~17645~ Fri Jul 19 12:29:57 2002
+++ perl/uconfig.sh Mon Jan 20 09:54:12 2003
@@ -218,6 +218,7 @@
d_mktime='undef'
d_mmap='undef'
d_modfl='undef'
+d_modflproto='undef'
d_modfl_pow32_bug='undef'
d_mprotect='undef'
d_msg='undef'
@@ -234,6 +235,7 @@
d_msync='undef'
d_munmap='undef'
d_mymalloc='undef'
+d_nanosleep='undef'
d_nice='undef'
d_nl_langinfo='undef'
d_nv_preserves_uv='undef'
End of Patch.