logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 



Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.



nghttp2.dll share Makefile.msvc ?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Apache Forum Index -> Apache Building & Member Downloads



View previous topic :: View next topic  
Author Message
Jan-E



Joined: 09 Mar 2012
Posts: 780
Location: Amsterdam, NL, EU

PostPosted: Sun 08 Nov '15 21:02    Post subject: nghttp2.dll share Makefile.msvc ? Reply with quote

I see you still build the nghttp2.dll with cygwin in C:\cygwin32\home\Administrator\nghttp2-1.4.0\lib

Can you share the Makefile.msvc?
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 2536
Location: Hilversum, NL, EU

PostPosted: Mon 09 Nov '15 0:49    Post subject: Reply with quote

Yes still, and you ?

Only change:

USE_CYTHON := 0

When you run the first time make -f Makefile.msvc,
it gives an error.

Remove in nghttp2.rc all below #include <winver.h>

Run again make -f Makefile.msvc and all is build.
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 780
Location: Amsterdam, NL, EU

PostPosted: Mon 09 Nov '15 11:58    Post subject: Reply with quote

Most of the times I am compiling outside of Cygwin, because the only thing you need is a Gnu make. But for the sake of argument I went into Cygwin again.

There is a curious difference between your nghttp2.dll and mine, if I follow you build procedure literally. Somehow you seem to have an anonymized entry point. When I run dumpbin /headers on the DLL I get this:
Code:
Jan@X220 /cygdrive/n/php-sdk/prebuilt/nghttp2-1.4.0/lib
$ dumpbin -headers MSVC_obj/nghttp2.dll | grep "entry point"
           15C79 entry point (10015C79) __DllMainCRTStartup@12

On your DLL this reports:
Code:
C:\httpd-2.4.18-dev-win32-VC14\Apache24\bin>dumpbin /headers nghttp2.dll | grep "entry point"
           15C79 entry point (10015C79)

I ran into this difference because I had stability issues with nghttp2.dll under VC9 and tried to recreate Gregg's VC9 1.3.4 DLL exactly. I even added this to the httpd.rc, to make them completely comparable:
Code:
        VALUE "Comments",         "Win32 binary by The Apache Haus"

But the __DllMainCRTStartup@12 entry point remains included in my dumpbin/headers, while it is only anonymized present in any other nghttp2.dll.

Any idea what could be causing this difference?

BTW, you can correct the error in httpd.rc by changing one line in the Makefile.rc:
Code:
_VERSION    := $(shell grep AC_INIT ../configure.ac | cut -d'[' -f3 | sed -e 's/], //g')

Note the removal of '-DEV'.


Last edited by Jan-E on Mon 09 Nov '15 13:51; edited 1 time in total
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 780
Location: Amsterdam, NL, EU

PostPosted: Mon 09 Nov '15 13:03    Post subject: Reply with quote

Found it: the nghttp2.pdb provides the description for the function at address 10015C79. But I am still wondering why Gregg's VC9 1.3.4 DLL is stable and mine is not.
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 2536
Location: Hilversum, NL, EU

PostPosted: Mon 09 Nov '15 13:09    Post subject: Reply with quote

When I do dumpbin under Cygwin with my dll, I get also : 15C79 entry point (10015C79) __DllMainCRTStartup@12

Thanks for the tip.
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 2536
Location: Hilversum, NL, EU

PostPosted: Mon 09 Nov '15 13:12    Post subject: Reply with quote

What issues are you dealing ?
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 780
Location: Amsterdam, NL, EU

PostPosted: Mon 09 Nov '15 13:50    Post subject: Reply with quote

I was running the VC9 Apache from Apachehaus. With my nghttp2.dll I get this message in Chrome:
Quote:
Deze webpagina is niet beschikbaar

ERR_CONNECTION_CLOSED

Firefox will not even try to connect. Stopping Apache, replacing my nghttp2.dll with Gregg's solves the issue. There are no error messages in the logs or the event viewer.

I upgraded to Apache 2.4.18-dev, compiled it with VC9 and have the same experience.

I know you do not support Apache on VC9 anymore, but it is really intriguing why Gregg's DLL is stable and mine is not. Could you (or Gregg) build a VC9 1.4.0 DLL, so I can check if the same issue is present with Nghttp2 1.4.0?
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 780
Location: Amsterdam, NL, EU

PostPosted: Mon 09 Nov '15 14:13    Post subject: Reply with quote

Error message in sslerror.log when I tried to access the site with Firefox (Apache 2.4.18-dev VC9, nghttp2.dll 1.4.0):
Quote:
[Mon Nov 09 12:58:07.449102 2015] [http2:warn] [pid 5980:tid 2612] [client 127.0.0.1:51788] AH02952: h2_mplx(63): join attempts exhausted, refs=1

With nghttp2.dll 1.3.4 I sometimes get:
Quote:
[Sat Nov 07 22:37:24.171306 2015] [http2:warn] [pid 6232:tid 2640] (70015)Could not find specified socket in poll list.: [client 127.0.0.1:51005] AH02953: h2_mplx(39): stream for response 69

So it probably is something in the threading (see h2_mplx.c).
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2101
Location: Sun Diego, USA

PostPosted: Mon 09 Nov '15 19:48    Post subject: Reply with quote

I have but have not tested it much. I built trunk about a week ago with it but did not test it thoroughly.
https://www.apachehaus.net/test/nghttp2-1.4.0-vc9.zip
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 780
Location: Amsterdam, NL, EU

PostPosted: Tue 10 Nov '15 17:43    Post subject: Reply with quote

The effect is the same. With your nghttp2.dll it works OK, with mine Chrome and Firefox will not connect.

I pulled trunk and checked out around the time of your build and then did a build with this Makefile.msvc:

https://gist.github.com/Jan-E/cb9ed221e83ac40c450f

There are some tricks in it:

https://gist.github.com/Jan-E/cb9ed221e83ac40c450f#file-makefile-msvc-L25 and https://gist.github.com/Jan-E/cb9ed221e83ac40c450f#file-makefile-msvc-L207 make sure that nghttp2ver.h contains 0x010400 in stead of the expression.

I moved https://gist.github.com/Jan-E/cb9ed221e83ac40c450f#file-makefile-msvc-L105 from 'install:' to 'all:' so nghttp2ver.h will be created at compile time

https://gist.github.com/Jan-E/cb9ed221e83ac40c450f#file-makefile-msvc-L269 and above make sure that the nghttp2.rc is created exactly as the one in your zip.

https://gist.github.com/Jan-E/cb9ed221e83ac40c450f#file-makefile-msvc-L19 is a temp fix because trunk has the version 1.4.1DEV now.

The only thing that might differ from your Makefile is https://gist.github.com/Jan-E/cb9ed221e83ac40c450f#file-makefile-msvc-L197
Code:
$(RC) -D_RELEASE -Fo $@ $<

I removed the -nologo because that is an invalid option in VC9's rc.exe. How did you build r_nghttp2.res?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2101
Location: Sun Diego, USA

PostPosted: Wed 11 Nov '15 10:33    Post subject: Reply with quote

Yes, versions of rc.exe below 6.1.7600.16385 (SDK7)
do not have /nologo so it's best to remove it. That it causes a fatal seems rediculus.
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 780
Location: Amsterdam, NL, EU

PostPosted: Wed 11 Nov '15 14:51    Post subject: Reply with quote

I finally found the solution. I had a Windows 2008R2 test server with a fresh VC9 install. Building there gave the hint to the solution: VC9 does not have a stdint.h, which is mandatory for NGhttp2. I was using a portable stdint.h by Paul Hsieh on my development machine. The Win2k8 box did not yet have any stdint.h.

Installing msinttypes r26 on both machines gave me a DLL without the connection problems. Phewww.

@Gregg: thanks for the PM. Intriguing to see how you are using Perl for the build process.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2101
Location: Sun Diego, USA

PostPosted: Wed 11 Nov '15 19:20    Post subject: Reply with quote

Huh, I wonder how mine got in there since it's not the one I carry around for vc6 when it's needed.

Glad you figured it out, but it seems the compiler would complain if you didn't have what was needed.
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 780
Location: Amsterdam, NL, EU

PostPosted: Wed 11 Nov '15 19:48    Post subject: Reply with quote

Check the header of C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdint.h and you'll know where you got it from. Maybe you borrowed it from VC10. VC10 and onwards had a sdtint.h once again.

Maybe the compiler gave a warning about possible loss of data. If you compile a lot, you get used to ignoring those warnings. It might have been a genuine loss of data this time.
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 780
Location: Amsterdam, NL, EU

PostPosted: Wed 11 Nov '15 19:59    Post subject: Reply with quote

Error messages with the faulty stdint.h and nghttp2 1.3.4:
Quote:
cl -nologo -MD -W3 -Z7 -DBUILDING_NGHTTP2 -I./includes -Dssize_t=long -D_U_="" -FoMSVC_obj/r_nghttp2_session.obj -c nghttp2_session.c
nghttp2_session.c
c:\php-sdk\prebuilt\nghttp2-1.3.4\lib\nghttp2_session.c(6370) : warning C4715: 'nghttp2_session_get_remote_settings' : not all control paths return a value

cl -nologo -MD -W3 -Z7 -DBUILDING_NGHTTP2 -I./includes -Dssize_t=long -D_U_="" -FoMSVC_obj/r_nghttp2_submit.obj -c nghttp2_submit.c
nghttp2_submit.c
nghttp2_submit.c(160) : warning C4142: benign redefinition of type

cl -nologo -MD -W3 -Z7 -DBUILDING_NGHTTP2 -I./includes -Dssize_t=long -D_U_="" -FoMSVC_obj/r_nghttp2_helper.obj -c nghttp2_helper.c
nghttp2_helper.c
nghttp2_helper.c(215) : warning C4018: '<' : signed/unsigned mismatch

I do not get the second and third warning with the right stdint.h.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2101
Location: Sun Diego, USA

PostPosted: Wed 11 Nov '15 20:12    Post subject: Reply with quote

The first is most troublesome. I have never seen the second on anything. On mismatch warnings I often make sure it's unsigned -> signed since that rarely hurts anything unlike the other way around.
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 780
Location: Amsterdam, NL, EU

PostPosted: Thu 12 Nov '15 1:14    Post subject: Reply with quote

The first is happening on all platforms, even for VC14 x64 with the 1.4.0 release. Plus some more warnings:
Quote:
cl -nologo -MD -W3 -Z7 -DBUILDING_NGHTTP2 -I./includes -Dssize_t=long -D_U_="" -FoMSVC_obj/r_nghttp2_session.obj -c nghttp2_session.c
nghttp2_session.c
nghttp2_session.c(4870): warning C4244: 'return': conversion from '__int64' to 'long', possible loss of data
nghttp2_session.c(4900): warning C4244: 'return': conversion from '__int64' to 'long', possible loss of data
nghttp2_session.c(5245): warning C4244: 'return': conversion from '__int64' to 'long', possible loss of data
nghttp2_session.c(5472): warning C4244: 'return': conversion from '__int64' to 'long', possible loss of data
nghttp2_session.c(5654): warning C4244: 'return': conversion from '__int64' to 'long', possible loss of data
nghttp2_session.c(5718): warning C4244: 'return': conversion from '__int64' to 'long', possible loss of data
nghttp2_session.c(5848): warning C4244: 'return': conversion from '__int64' to 'long', possible loss of data
nghttp2_session.c(5919): warning C4244: 'return': conversion from '__int64' to 'long', possible loss of data
c:\php-sdk\prebuilt\nghttp2-1.4.0\lib\nghttp2_session.c(6495) : warning C4715: 'nghttp2_session_get_remote_settings': not all control paths return a value

It must have been something else that caused my troubles with VC9.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2101
Location: Sun Diego, USA

PostPosted: Thu 12 Nov '15 4:38    Post subject: Reply with quote

Jan-E wrote:
conversion from '__int64' to 'long', possible loss of data


You will often see this when compiling x64, well _int64 to int(32) is more likely. You could maybe get rid of these by changing -Dssize_t=long in the makefile from "long" to "_int64" since many functions in nghttp2 are declared as ssize_t, but then others might blow up. VC14 being C99 I would have thought already had ssize_t but I guess not.

L4870: return in - first;

both in and first are defined as uint8_t (unsigned char) and are 1 byte
ssize_t being long is 4 bytes
How it's returning a 8 byte (_int64) seems strange, but that is what it's warning you about. The actual return value can only be 1 byte (0-255) so it's a bogus warning in reality.
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 780
Location: Amsterdam, NL, EU

PostPosted: Thu 26 Nov '15 19:02    Post subject: Reply with quote

nghttp2 1.5.0 has been released.
https://github.com/tatsuhiro-t/nghttp2/releases

I am using this Makefile-static.msvc to compile a static nghttp2.lib now. It works equally well on releases as on dev versions:

https://gist.github.com/Jan-E/66a1e0adb4e4ec9a0364

The trick for compiling a static lib with no undefined externals is in this line of the makefile and the following:

https://gist.github.com/Jan-E/66a1e0adb4e4ec9a0364#file-makefile-static-msvc-L205

Those 2 lines add a line in nghttp2ver.h:

Code:
#define NGHTTP2_STATICLIB 1
Back to top
elav83



Joined: 10 Nov 2014
Posts: 16
Location: India

PostPosted: Wed 06 Jul '16 13:42    Post subject: Building libnghttp2 in windows x64 for Apache Reply with quote

Apache is dependent on nghttp2. I want to build nghttp2 in windows x64 machine. Apache requires nghttp2.lib. Please tell me how we can compile nghttp2 in windows x64.
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Apache Building & Member Downloads Goto page 1, 2  Next
Page 1 of 2