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

v1.9.32.2-beta doesn't compile with Tengine #839

Closed
crowell opened this Issue Oct 29, 2014 · 5 comments

Comments

Projects
None yet
3 participants
@crowell
Copy link
Contributor

crowell commented Oct 29, 2014

discussion here https://groups.google.com/forum/#!topic/ngx-pagespeed-discuss/UAoxZUzsAr8

Basically, nginx defines ngx_resolver_ctx_s differently from tengine.

Tengine uses type in_addr_t* for addrs whereas nginx uses ngx_addr_t* for addrs.

ngx_addr_t is a struct which contains the data we are trying to access, in_addr_t is an unsigned int.

jeff@jeff:/usr/local/nginx/sbin$ ./dso_tool --add-module=/home/jeff/ngx_pagespeed-release-1.9.32.2-beta
configuring additional modules
adding module in /home/jeff/ngx_pagespeed-release-1.9.32.2-beta
mod_pagespeed_dir=/home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include
build_from_source=false
checking for psol ...
 found
sed: -e expression #1, char 0: no previous regular expression
sed: -e expression #1, char 0: no previous regular expression
List of modules (in reverse order of applicability): 
./dso_tool: 6: auto/have: cannot create objs/ngx_shared_config.h: Directory nonexistent
/home/jeff/ngx_pagespeed-release-1.9.32.2-beta
 + ngx_pagespeed will be compiled
clang -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -fPIC  -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/chromium/src -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/google-sparsehash/src -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/google-sparsehash/gen/arch/linux/x64/include -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/protobuf/src -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/re2/src -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/out/Release/obj/gen -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/out/Release/obj/gen/protoc_out/instaweb -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/apr/src/include -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/aprutil/src/include -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/apr/gen/arch/linux/x64/include -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/aprutil/gen/arch/linux/x64/include  \
        -Iobjs -I/usr/local/nginx/include \
        -o objs/src/src/log_message_handler.o \
        /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/src/log_message_handler.cc
clang -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -fPIC  -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/chromium/src -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/google-sparsehash/src -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/google-sparsehash/gen/arch/linux/x64/include -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/protobuf/src -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/re2/src -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/out/Release/obj/gen -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/out/Release/obj/gen/protoc_out/instaweb -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/apr/src/include -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/aprutil/src/include -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/apr/gen/arch/linux/x64/include -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/aprutil/gen/arch/linux/x64/include  \
        -Iobjs -I/usr/local/nginx/include \
        -o objs/src/src/ngx_base_fetch.o \
        /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/src/ngx_base_fetch.cc
clang -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -fPIC  -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/chromium/src -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/google-sparsehash/src -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/google-sparsehash/gen/arch/linux/x64/include -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/protobuf/src -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/re2/src -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/out/Release/obj/gen -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/out/Release/obj/gen/protoc_out/instaweb -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/apr/src/include -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/aprutil/src/include -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/apr/gen/arch/linux/x64/include -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/aprutil/gen/arch/linux/x64/include  \
        -Iobjs -I/usr/local/nginx/include \
        -o objs/src/src/ngx_caching_headers.o \
        /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/src/ngx_caching_headers.cc
clang -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -fPIC  -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/chromium/src -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/google-sparsehash/src -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/google-sparsehash/gen/arch/linux/x64/include -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/protobuf/src -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/re2/src -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/out/Release/obj/gen -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/out/Release/obj/gen/protoc_out/instaweb -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/apr/src/include -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/aprutil/src/include -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/apr/gen/arch/linux/x64/include -I /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/psol/include/third_party/aprutil/gen/arch/linux/x64/include  \
        -Iobjs -I/usr/local/nginx/include \
        -o objs/src/src/ngx_fetch.o \
        /home/jeff/ngx_pagespeed-release-1.9.32.2-beta/src/ngx_fetch.cc
/home/jeff/ngx_pagespeed-release-1.9.32.2-beta/src/ngx_fetch.cc:574:35: error: member reference base type 'in_addr_t' (aka 'unsigned int') is not a structure or union
            resolver_ctx->addrs[i].sockaddr)->sin_family == AF_INET) {
            ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
1 error generated.
make: *** [objs/src/src/ngx_fetch.o] Error 1

@crowell crowell self-assigned this Oct 29, 2014

@crowell

This comment has been minimized.

Copy link
Contributor

crowell commented Oct 29, 2014

This inconsistency is fixed by tengine as of commit alibaba/tengine@16a0d84

New versions of tengine will use ngx_addr_t* for addrs.

However, the current stable, as of Oct 29, 2014 is still using the old definition of the struct.

@crowell

This comment has been minimized.

Copy link
Contributor

crowell commented Oct 29, 2014

latest git checkout of tengine at alibaba/tengine@16a0d84
does build and work with v1.9.32.2-beta

@chromafunk

This comment has been minimized.

Copy link

chromafunk commented Oct 29, 2014

Thanks for letting us know :)

2014-10-29 15:57 GMT+01:00 Jeffrey Crowell notifications@github.com:

latest git checkout of tengine at alibaba/tengine@16a0d84
alibaba/tengine@16a0d84
does build and work with v1.9.32.2-beta


Reply to this email directly or view it on GitHub
#839 (comment)
.

crowell added a commit that referenced this issue Oct 29, 2014

Check type of resolver_ctx->addrs.
Check the type of resolver_ctx->addrs and make sure that it is
ngx_addr_t* instead of in_addr_t*. addresses issue #839

crowell added a commit that referenced this issue Oct 29, 2014

Check type of resolver_ctx->addrs.
Check the type of resolver_ctx->addrs and make sure that it is
ngx_addr_t* instead of in_addr_t*. addresses issue #839

crowell added a commit that referenced this issue Oct 29, 2014

Check type of resolver_ctx->addrs.
Check the type of resolver_ctx->addrs and make sure that it is
ngx_addr_t* instead of in_addr_t*. addresses issue #839
@crowell

This comment has been minimized.

Copy link
Contributor

crowell commented Oct 29, 2014

Should be fixed by 1b3ca08
@oschaaf any opinions as to if this change should be merged into master?

@oschaaf

This comment has been minimized.

Copy link
Member

oschaaf commented Oct 29, 2014

@crowell Merging this to master might help people that want to run ngx_pagespeed 1.9.32.2 over Tengine (but can't upgrade their Tengine version). So I think that makes sense.

crowell added a commit that referenced this issue Oct 29, 2014

Check type of resolver_ctx->addrs.
Check the type of resolver_ctx->addrs and make sure that it is
ngx_addr_t* instead of in_addr_t*. addresses issue #839

@crowell crowell closed this Oct 29, 2014

@jeffkaufman jeffkaufman referenced this issue Nov 28, 2014

Closed

make error #853

crowell added a commit that referenced this issue May 13, 2015

Check type of resolver_ctx->addrs.
Check the type of resolver_ctx->addrs and make sure that it is
ngx_addr_t* instead of in_addr_t*. addresses issue #839
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment