Author |
|
Jan-E
Joined: 09 Mar 2012 Posts: 1265 Location: Amsterdam, NL, EU
|
Posted: Wed 03 May '17 12:18 Post subject: abs.exe is not working with build with 1.1.0 |
|
|
Split from https://www.apachelounge.com/viewtopic.php?t=7621
Steffen wrote: | ASF is in the process to get it final, no crucial changes are expected.
Next month final I expect.
But abs.exe is not working with 1.1.0, that is maybe not a big deal. Hope it is fixed before final. |
This does not feel OK, as it is using the exported OpenSSL functions. When I tested what it did, I noticed that (1) it did not make any call to the webserver and (2) it occupies 100% of 1 of my 4 cores. It just sits there, until you hit Ctrl-C
BTW: I compiled Apache with CMake and noticed I had to copy applink.c from openssl/ms to openssl/include/openssl, where the generated vcxproj expected it to be.
Edit This was caused by line 178 in support/ab.c:
Code: | #if defined(_MSC_VER)
/* The following logic ensures we correctly glue FILE* within one CRT used
* by the OpenSSL library build to another CRT used by the ab.exe build.
* This became especially problematic with Visual Studio 2015.
*/
#include <openssl/applink.c>
#endif |
Only abs.exe expected applink.c to be in that place.
There was a warning as well:
Code: | openssl\include\openssl/lhash.h(198): warning C4090: 'function': different 'const' qualifiers |
|
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Wed 03 May '17 17:40 Post subject: |
|
|
Jan-E wrote: | BTW: I compiled Apache with CMake and noticed I had to copy applink.c from openssl/ms to openssl/include/openssl, where the generated vcxproj expected it to be. |
The deal with this is install openssl (nmake install), you get /bin, /include and /lib and guess where applink.c is installed ... /include/openssl/applink.c
The location is tied to the prefix= when building but may (did not try) be able to be overridden when you actually do the install (nmake prefix=/some/location install).
When I originally dealt with this problem in the retro build it quickly got shot down and I had to revert the change to ab.c. The dissenting voice told me that it breaks the cmake build when openssl gets installed. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Wed 03 May '17 17:59 Post subject: |
|
|
Steffen wrote: | But abs.exe is not working with 1.1.0, that is maybe not a big deal. Hope it is fixed before final. |
Rainer posted a patch to the list back on 4/21.
I believe this worked for me and I thought I posted to the list that it did but cannot find my mail.
Try:
Code: | Index: support/ab.c
===================================================================
--- support/ab.c (revision 1792155)
+++ support/ab.c (working copy)
@@ -2576,8 +2576,6 @@
#else
#if OPENSSL_VERSION_NUMBER < 0x10100000L
CRYPTO_malloc_init();
-#else
- OPENSSL_malloc_init();
#endif
#endif
SSL_load_error_strings();
|
There's a glitch elsewhere not affecting SSL (or the hang) and it's patch is;
Code: | Index: support/ab.c
===================================================================
--- support/ab.c (revision 1792155)
+++ support/ab.c (working copy)
@@ -2465,14 +2465,14 @@
case 'B':
myhost = apr_pstrdup(cntxt, opt_arg);
break;
+ case 'm':
+ method = CUSTOM_METHOD;
+ method_str[CUSTOM_METHOD] = strdup(opt_arg);
+ break;
#ifdef USE_SSL
case 'Z':
ssl_cipher = strdup(opt_arg);
break;
- case 'm':
- method = CUSTOM_METHOD;
- method_str[CUSTOM_METHOD] = strdup(opt_arg);
- break;
case 'f':
#if OPENSSL_VERSION_NUMBER < 0x10100000L
if (strncasecmp(opt_arg, "ALL", 3) == 0) {
|
Anyone care to confirm? Extra confirmation is a good thing. |
|
Back to top |
|
Jan-E
Joined: 09 Mar 2012 Posts: 1265 Location: Amsterdam, NL, EU
|
Posted: Wed 03 May '17 21:43 Post subject: |
|
|
Fix confirmed, also on the list. I asked Rainer to backport it to the 2.4.x branch.
Was a too quick message in the train from Rotterdam to Amsterdam. Some spelling errors, but who cares. Almost near the Arena, where Ajax played 4-1 against Olympique Lyon. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Thu 04 May '17 3:36 Post subject: |
|
|
Thanks Jan |
|
Back to top |
|
Jan-E
Joined: 09 Mar 2012 Posts: 1265 Location: Amsterdam, NL, EU
|
Posted: Thu 04 May '17 10:14 Post subject: |
|
|
glsmith wrote: | Jan-E wrote: | BTW: I compiled Apache with CMake and noticed I had to copy applink.c from openssl/ms to openssl/include/openssl, where the generated vcxproj expected it to be. |
The deal with this is install openssl (nmake install), you get /bin, /include and /lib and guess where applink.c is installed ... /include/openssl/applink.c
The location is tied to the prefix= when building but may (did not try) be able to be overridden when you actually do the install (nmake prefix=/some/location install).
When I originally dealt with this problem in the retro build it quickly got shot down and I had to revert the change to ab.c. The dissenting voice told me that it breaks the cmake build when openssl gets installed. |
nmake install fails when building OpenSSL 1.1.0e:
Code: | N:\Openssl110VC14.x64\openssl>nmake install
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
ACKNOWLEDGEMENTS AUTHORS CHANGES CONTRIBUTING Configurations Configure FAQ INSTALL LICENSE
Makefile.shared NEWS NOTES.DJGPP NOTES.PERL NOTES.VMS NOTES.WIN README README.ECC README.EN
GINE README.FIPS VMS app.pdb apps appveyor.yml bin build.info config config.com configdata.
pm crypto demos doc dso.pdb e_os.h engines external fuzz html include lib libcrypto-1_1-x64
.def libcrypto-1_1-x64.dll libcrypto-1_1-x64.ilk libcrypto-1_1-x64.pdb libcrypto-1_1-x64.rc
libcrypto-1_1-x64.res libcrypto.exp libcrypto.lib libssl-1_1-x64.def libssl-1_1-x64.dll li
bssl-1_1-x64.ilk libssl-1_1-x64.pdb libssl-1_1-x64.rc libssl-1_1-x64.res libssl.exp libssl.
lib makefile ms os-dep ossl_static.pdb pod2htmd.tmp pod2htmi.tmp ssl test tools util Instal
ling development files
Can't Open "./ms/applink.c" at .\util\copy.pl line 61.
NMAKE : fatal error U1077: 'C:\Perl64\bin\perl.exe' : return code '0x16'
Stop.
N:\Openssl110VC14.x64\openssl>dir .\ms\app*
Volume in drive N is N4B
Volume Serial Number is EC6C-A330
Directory of N:\Openssl110VC14.x64\openssl\ms
16/02/17 13:58 3.508 applink.c
04/05/17 09:50 12.830 applink.obj
|
I tried this with and without --prefix in the configure line:
Code: | perl Configure VC-WIN64A
perl Configure VC-WIN64A --prefix=/Openssl110VC14.x64/install
perl Configure VC-WIN64A --prefix=N:\Openssl110VC14.x64\install
|
You'd better re-apply the change in ab.c. It never was needed to install OpenSSL to use it in the httpd build. |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Thu 04 May '17 10:50 Post subject: |
|
|
nmake install works here:
PERL Configure VC-WIN64A --prefix=c:/openssl-1.1.0e-win64
nmake
nmake test
C:\VC15\Win64\openssl-1.1.0e>nmake install
Microsoft (R) Program Maintenance Utility Version 14.10.25019.0
Copyright (C) Microsoft Corporation. All rights reserved.
*** Installing development files
created directory `c:/openssl-1.1.0e-win64'
created directory `c:/openssl-1.1.0e-win64/include'
created directory `c:/openssl-1.1.0e-win64/include/openssl'
Copying: ./ms/applink.c to c:/openssl-1.1.0e-win64/include/openssl/applink.c
Copying: ./include/openssl/__DECC_INCLUDE_EPILOGUE.H to c:/openssl-1.1.0e-win64/include/openssl/__DECC_INCLUDE_EPILOGUE.H
...
...
... |
|
Back to top |
|
Jan-E
Joined: 09 Mar 2012 Posts: 1265 Location: Amsterdam, NL, EU
|
Posted: Thu 04 May '17 11:40 Post subject: |
|
|
No dice:
Code: | N:\Openssl110VC14.x64\openssl>nmake install
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
ACKNOWLEDGEMENTS AUTHORS CHANGES CONTRIBUTING Configurations Configure FAQ INSTALL LICENSE
Makefile.shared NEWS NOTES.DJGPP NOTES.PERL NOTES.VMS NOTES.WIN README README.ECC README.EN
GINE README.FIPS VMS app.pdb apps appveyor.yml bin build.info config config.com configdata.
pm crypto demos doc dso.pdb e_os.h engines external fuzz html include lib libcrypto-1_1-x64
.def libcrypto-1_1-x64.dll libcrypto-1_1-x64.ilk libcrypto-1_1-x64.pdb libcrypto-1_1-x64.rc
libcrypto-1_1-x64.res libcrypto.exp libcrypto.lib libssl-1_1-x64.def libssl-1_1-x64.dll li
bssl-1_1-x64.ilk libssl-1_1-x64.pdb libssl-1_1-x64.rc libssl-1_1-x64.res libssl.exp libssl.
lib makefile ms os-dep ossl_static.pdb pod2htmd.tmp pod2htmi.tmp ssl test tools util Instal
ling development files
created directory `c:/openssl-1.1.0e-win64'
created directory `c:/openssl-1.1.0e-win64/include'
created directory `c:/openssl-1.1.0e-win64/include/openssl'
Can't Open "./ms/applink.c" at .\util\copy.pl line 61.
NMAKE : fatal error U1077: 'C:\Perl64\bin\perl.exe' : return code '0x16'
Stop. |
Neither in a VC14 x64 nor in a VC15 x64 prompt. Anyway, as far as I know there is no need to install OpenSSL to use it for building Apache httpd. As you can see by the applink.obj above, a CMake build of httpd already compiles ms/applink.c. It is illogical to compile it also at openssl/include/openssl. '#include <ms/applink.c>' will work in any build system as long as you add the openssl root dir as include dir (-DEXTRA_INCLUDES in the CMake build). |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Thu 04 May '17 17:36 Post subject: |
|
|
That's bizarre, since it did it for me and as we can see, for Steffen also.
---------------------------------------------------------------------------
Yes it's compiled by Openssl build because it's linked in to the client. But that doesn't concern us.
For Legacy (1.0.2) reasons this has to remain as is
Code: | #if defined(_MSC_VER)
/* The following logic ensures we correctly glue FILE* within one CRT used
* by the OpenSSL library build to another CRT used by the ab.exe build.
* This became especially problematic with Visual Studio 2015.
*/
#include <openssl/applink.c>
#endif |
For our Retro/Legacy/whatever-you-want-to-call-it build, we have a prebuild step that copies the file from /ms to /include/openssl
If cmake can modify files (like config.h on PCRE) then it should be able to copy the applink.c to
/include/openssl if it exists in /ms. That's a little beyond my cmake knowledge at this time.
Now beyond this, if you cannot get the cmake build to work with openssl's install, I guess you can battle this out with Bill. |
|
Back to top |
|
Jan-E
Joined: 09 Mar 2012 Posts: 1265 Location: Amsterdam, NL, EU
|
Posted: Thu 04 May '17 20:58 Post subject: |
|
|
glsmith wrote: | That's bizarre, since it did it for me and as we can see, for Steffen also. |
It is certainly bizarre. I analysed it and there is a very subtle requirement for 'nmake install' to work: perl has to be on the same drive as the OpenSSL sources and as the install location. Consider the following:
Quote: | C:\VC15\Win64\openssl-1.1.0e>c:\cygwin\bin\perl C:\VC15\Win64\openssl-1.1.0e\util\copy.pl C:\VC15\Win64\openssl-1.1.0e\ms\applink.c c:\openssl-1.1.0e-win64\include\openssl
Copying: C:/VC15/Win64/openssl-1.1.0e/ms/applink.c to c:/openssl-1.1.0e-win64/include/openssl/applink.c
C:\VC15\Win64\openssl-1.1.0e>c:\perl64\bin\perl C:\VC15\Win64\openssl-1.1.0e\util\copy.pl C:\VC15\Win64\openssl-1.1.0e\ms\applink.c c:\openssl-1.1.0e-win64\include\openssl
Copying: C:/VC15/Win64/openssl-1.1.0e/ms/applink.c to c:/openssl-1.1.0e-win64/include/openssl/applink.c
C:\VC15\Win64\openssl-1.1.0e>n:\perl64\bin\perl C:\VC15\Win64\openssl-1.1.0e\util\copy.pl C:\VC15\Win64\openssl-1.1.0e\ms\applink.c c:\openssl-1.1.0e-win64\include\openssl
Can't Open "C:/VC15/Win64/openssl-1.1.0e/ms/applink.c" at C:\VC15\Win64\openssl-1.1.0e\util\copy.pl line 61. |
It does not matter, whether I use absolute or relative paths. And as a BTW: n:\perl64 and c:\perl64 are symlinked. |
|
Back to top |
|
Jan-E
Joined: 09 Mar 2012 Posts: 1265 Location: Amsterdam, NL, EU
|
Posted: Thu 04 May '17 22:51 Post subject: |
|
|
And even that is not the whole story:
Code: | C:\Openssl110VC14.x64\openssl>dir C:\Openssl110VC14.x64\openssl\ms\applink.c
Volume in drive C is Windows7_OS
Volume Serial Number is D13A-4B50
Directory of C:\Openssl110VC14.x64\openssl\ms
16/02/17 13:58 3.508 applink.c
1 File(s) 3.508 bytes
C:\Openssl110VC14.x64\openssl>C:\Perl64\bin\perl \
C:\Openssl110VC14.x64\openssl\util\copy.pl \
C:\Openssl110VC14.x64\openssl\ms\applink.c \
C:/Openssl110VC14.x64/install/include/openssl
Can't Open "C:/Openssl110VC14.x64/openssl/ms/applink.c" at C:\Openssl110VC14.x64\openssl\util\copy.pl line 61. |
It is a prompt with Administrator rights and Administrators have full control over ms/applink.c. nmake install for OpenSSL 1.1.0e is a PITA, to put it mildly. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Fri 05 May '17 3:18 Post subject: |
|
|
Well, we should NOT need administrator rights.
Mine failed, but this is the fail;
Cannot create directory C:/Program Files/Common Files/SSL: No such file or directory
NMAKE : fatal error U1077: 'C:\Perl64\bin\perl.exe' : return code '0x2'
Stop.
WTF were they (OpenSSL) thinking here?
Other than that, the only difference I see is that it looks like you do not have perl in your path.
I will send you a link in email to the complete buildlog (I skipped test) and you can see if worked sweetly up until it tried to do something requiring admin rights.
Try adding it to you path temporarily
set path=%PATH%;C:\Perl64
My perl as you will see is in C:\Perl64, I built in F: as you will also see.
The reason I'm sending link is I don't want Google et al trying to index it for eternity and spitting up 404s daily in my access log after I delete it. |
|
Back to top |
|
Jan-E
Joined: 09 Mar 2012 Posts: 1265 Location: Amsterdam, NL, EU
|
Posted: Fri 05 May '17 5:42 Post subject: |
|
|
Actually there was a Perl in my path, but it happened to be an old one. I replaced it with ActiveState v5.24.1 and did not have the ms\applink.c problem anymore.
With respect to the Common Files problem, try this configure line:
Code: | perl Configure VC-WIN64A --prefix=/testme --openssldir=/testme/ssl |
And, to be sure, do a 'if exist makefile nmake distclean' before every perl Configure. |
|
Back to top |
|
Jan-E
Joined: 09 Mar 2012 Posts: 1265 Location: Amsterdam, NL, EU
|
Posted: Sun 28 May '17 10:47 Post subject: |
|
|
glsmith wrote: | Steffen wrote: | But abs.exe is not working with 1.1.0, that is maybe not a big deal. Hope it is fixed before final. |
Try:
Code: | Index: support/ab.c
===================================================================
--- support/ab.c (revision 1792155)
+++ support/ab.c (working copy)
@@ -2576,8 +2576,6 @@
#else
#if OPENSSL_VERSION_NUMBER < 0x10100000L
CRYPTO_malloc_init();
-#else
- OPENSSL_malloc_init();
#endif
#endif
SSL_load_error_strings();
|
|
This patch has been backported to the 2.4.x branch:
http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/support/ab.c?r1=1791061&r2=1795907&diff_format=h
glsmith wrote: | There's a glitch elsewhere not affecting SSL (or the hang) and it's patch is;
Code: | Index: support/ab.c
===================================================================
--- support/ab.c (revision 1792155)
+++ support/ab.c (working copy)
@@ -2465,14 +2465,14 @@
case 'B':
myhost = apr_pstrdup(cntxt, opt_arg);
break;
+ case 'm':
+ method = CUSTOM_METHOD;
+ method_str[CUSTOM_METHOD] = strdup(opt_arg);
+ break;
#ifdef USE_SSL
case 'Z':
ssl_cipher = strdup(opt_arg);
break;
- case 'm':
- method = CUSTOM_METHOD;
- method_str[CUSTOM_METHOD] = strdup(opt_arg);
- break;
case 'f':
#if OPENSSL_VERSION_NUMBER < 0x10100000L
if (strncasecmp(opt_arg, "ALL", 3) == 0) {
|
|
This one did not make it yet to the 2.4.x branch. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sun 28 May '17 17:29 Post subject: |
|
|
No, the latter is not critical but I just gave the proposal for it (proposed about 75 minuts ago) the 3rd needed vote so it will be in soon. |
|
Back to top |
|