Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH] fix NO_HASH_SEED build #14956

Closed
p5pRT opened this issue Oct 1, 2015 · 7 comments
Closed

[PATCH] fix NO_HASH_SEED build #14956

p5pRT opened this issue Oct 1, 2015 · 7 comments

Comments

@p5pRT
Copy link

p5pRT commented Oct 1, 2015

Migrated from rt.perl.org#126242 (status was 'resolved')

Searchable as RT126242$

@p5pRT
Copy link
Author

p5pRT commented Oct 1, 2015

From @bulk88

Created by @bulk88

See attached patch. I also request backporting to 5.18/5.20/5.22. Note
RJBS did not close 5.18 maint
https://rt-archive.perl.org/perl5/Ticket/Display.html?id=123362#txn-1361200 so I
include 5.18.

Criteria "Patches that fix regressions in perl's behavior relative to
previous releases, no matter how old the regression, since some people
may upgrade from very old versions of perl to the latest version." and
"Patches that fix anything which prevents or seriously impacts the build
or installation of perl."

Perl Info

Flags:
              category=core
              severity=low

Site configuration information for perl 5.23.0:

Configured by Owner at Mon Jun 29 03:16:56 2015.

Summary of my perl5 (revision 5 version 23 subversion 0) configuration:
            Derived from: 63602a3fc27a417daf3c532b6a11ae6eba2a072a
            Platform:
              osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
              uname=''
              config_args='undef'
              hint=recommended, useposix=true, d_sigaction=undef
              useithreads=define, usemultiplicity=define
              use64bitint=undef, use64bitall=undef, uselongdouble=undef
              usemymalloc=n, bincompat5005=undef
            Compiler:
              cc='cl', ccflags ='-nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -GL
-DWIN32
-D_CONSOLE -DNO_STRICT  -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT
-DPERL_IMPLICIT_SYS -D_USE_32BIT_TIME_T',
              optimize='-O1 -MD -Zi -DNDEBUG -GL',
              cppflags='-DWIN32'
              ccversion='13.10.6030', gccversion='', gccosandvers=''
              intsize=4, longsize=4, ptrsize=4, doublesize=8, 
byteorder=1234,
doublekind=3
              d_longlong=undef, longlongsize=8, d_longdbl=define,
longdblsize=8,
longdblkind=0
              ivtype='long', ivsize=4, nvtype='double', nvsize=8,
Off_t='__int64', lseeksize=8
              alignbytes=8, prototype=define
            Linker and Libraries:
              ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf
-ltcg 		-libpath:"c:\perl\lib\CORE" 		-machine:x86'
              libpth=\lib
              libs=oldnames.lib kernel32.lib user32.lib gdi32.lib
winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib
odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib
              perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib
version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib
              libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl523.lib
              gnulibc_version=''
            Dynamic Linking:
              dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
              cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug
-opt:ref,icf -ltcg 		-libpath:"c:\perl\lib\CORE" 		-machine:x86'

Locally applied patches:
              uncommitted-changes


@INC for perl 5.23.0:
              C:/perl521/srcnewb4opt/lib
              .


Environment for perl 5.23.0:
              HOME (unset)
              LANG (unset)
              LANGUAGE (unset)
              LD_LIBRARY_PATH (unset)
              LOGDIR (unset)
              PATH=C:\sperl\c\bin;C:\WINDOWS\system32;C:\Program
Files\Microsoft
Visual Studio .NET 2003\Vc7\bin;C:\Program Files\Microsoft Visual Studio
.NET 2003\Common7\IDE;C:\WINDOWS;C:\Program Files\Git\cmd;C:\Program
Files\Microsoft Visual Studio .NET 2003\Common7\Tools\bin;C:\perl\bin
              PERL_BADLANG (unset)
              PERL_JSON_BACKEND=Cpanel::JSON::XS
              PERL_YAML_BACKEND=YAML
              SHELL (unset)













@p5pRT
Copy link
Author

p5pRT commented Oct 1, 2015

From @bulk88

0001-fix-NO_HASH_SEED-build.patch
From c703dc3cda63554a97a0f0223fe1835651e57ca8 Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Thu, 1 Oct 2015 15:04:29 -0400
Subject: [PATCH] fix NO_HASH_SEED build

commit b1300a738f added PERL_HASH_FUNC_ONE_AT_A_TIME_HARD algo, which was
the first one to introduce 8 byte seeds, previously all the algos used 4
or 16 byte seeds. No case was added to the CPP tree for 8 byte const
seeds, so add one now. Otherwise the #error at the end of the tree runs
and breaks the build. NO_HASH_SEED define was public API in the past and
could be considered to still be public API, see commit f36626324a.
My use for NO_HASH_SEED is reducing entropy for tracking down memory
corruption.
---
 hv_func.h         |    2 ++
 pod/perldelta.pod |    4 +++-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/hv_func.h b/hv_func.h
index b0e50e3..ce60e53 100644
--- a/hv_func.h
+++ b/hv_func.h
@@ -84,6 +84,8 @@
 #       define PERL_HASH_SEED PL_hash_seed
 #   elif PERL_HASH_SEED_BYTES == 4
 #       define PERL_HASH_SEED "PeRl"
+#   elif PERL_HASH_SEED_BYTES == 8
+#       define PERL_HASH_SEED "PeRlHaSh"
 #   elif PERL_HASH_SEED_BYTES == 16
 #       define PERL_HASH_SEED "PeRlHaShhAcKpErl"
 #   else
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index a5e7055..caa6067 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -240,7 +240,9 @@ L</Platform Support> section, instead.
 
 =item *
 
-XXX
+Using the C<NO_HASH_SEED> define in combination with the default hash algorithm
+C<PERL_HASH_FUNC_ONE_AT_A_TIME_HARD> resulted in a fatal error while compiling
+the interpreter, since 5.17.10. This has been fixed.
 
 =back
 
-- 
1.7.9.msysgit.0

@p5pRT
Copy link
Author

p5pRT commented Oct 12, 2015

From @tonycoz

On Thu Oct 01 12​:13​:53 2015, bulk88 wrote​:

See attached patch.

Thanks, this patch doesn't fix another problem with the -DNO_HASH_SEED build - the hash functions expect an unsigned char *, but C/C++ strings have type const char *, so we see a large number of warnings on C[1], and build failures on C++.

Would you like to produce an updated patch, or leave it to me to fix?

Tony

[1] it's incorrect in C too, many compilers forgive it though

@p5pRT
Copy link
Author

p5pRT commented Oct 12, 2015

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Oct 13, 2015

From @bulk88

On Mon Oct 12 15​:43​:21 2015, tonyc wrote​:

On Thu Oct 01 12​:13​:53 2015, bulk88 wrote​:

See attached patch.

Thanks, this patch doesn't fix another problem with the -DNO_HASH_SEED
build - the hash functions expect an unsigned char *, but C/C++
strings have type const char *, so we see a large number of warnings
on C[1], and build failures on C++.

Would you like to produce an updated patch, or leave it to me to fix?

You fix it. It will take a week or a couple weeks for me to get the opportunity to revise the patch and it is easier if you fix it and close this ticket.

--
bulk88 ~ bulk88 at hotmail.com

@p5pRT
Copy link
Author

p5pRT commented Oct 14, 2015

From @tonycoz

On Thu Oct 01 12​:13​:53 2015, bulk88 wrote​:

See attached patch.

Thanks, applied as c2d4ebc, with the char * vs unsigned char * fix in 25c1b13.

I also request backporting to 5.18/5.20/5.22. Note
RJBS did not close 5.18 maint
https://rt-archive.perl.org/perl5/Ticket/Display.html?id=123362#txn-1361200 so I
include 5.18.

I haven't seen a volunteer though.

Criteria "Patches that fix regressions in perl's behavior relative to
previous releases, no matter how old the regression, since some people
may upgrade from very old versions of perl to the latest version." and
"Patches that fix anything which prevents or seriously impacts the build
or installation of perl."

I'd added a note to #123362 and added both patches to the 5.20 and 5.22 votes files.

Tony

@p5pRT p5pRT closed this as completed Oct 14, 2015
@p5pRT
Copy link
Author

p5pRT commented Oct 14, 2015

@tonycoz - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant