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

CentOS 6: error: ‘F_SETPIPE_SZ’ was not declared in this scope #1503

Closed
centminmod opened this Issue Nov 21, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@centminmod
Copy link

centminmod commented Nov 21, 2017

Ran into unusual error during Nginx 1.13.7 compile with ngx_pagespeed 1.13.35.1-beta only when attempted on CentOS 6 (with GCC 5.3.1). But no problems with CentOS 7 systems with Nginx 1.13.7

Nginx 1.13.7 was just released http://nginx.org/en/CHANGES

                -o objs/addon/src/ngx_caching_headers.o \
                ../ngx_pagespeed-1.13.35.1-beta/src/ngx_caching_headers.cc
ccache gcc -c -fPIC -I/usr/local/include/luajit-2.1  -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -m64 -march=native -g -O3 -fstack-protector-strong -flto -fuse-ld=gold --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wno-deprecated-declarations -gsplit-dwarf -DNDK_SET_VAR -Wno-deprecated-declarations  -D_GLIBCXX_USE_CXX11_ABI=0 -DNDK_SET_VAR -DNDK_UPSTREAM_LIST --std=c++11 -I src/core -I src/event -I src/event/modules -I src/os/unix -I ../ngx_devel_kit-0.3.0/objs -I objs/addon/ndk -I ../lua-nginx-module-0.10.11/src/api -I ../ngx_brotli/deps/brotli/include -I ../ngx_pagespeed-1.13.35.1-beta/psol/include -I ../ngx_pagespeed-1.13.35.1-beta/psol/include/third_party/chromium/src -I ../ngx_pagespeed-1.13.35.1-beta/psol/include/third_party/google-sparsehash/src/src -I ../ngx_pagespeed-1.13.35.1-beta/psol/include/third_party/google-sparsehash/gen/arch/linux/x64/include -I ../ngx_pagespeed-1.13.35.1-beta/psol/include/third_party/grpc/src/include -I ../ngx_pagespeed-1.13.35.1-beta/psol/include/third_party/protobuf/src/src -I ../ngx_pagespeed-1.13.35.1-beta/psol/include/third_party/re2/src -I ../ngx_pagespeed-1.13.35.1-beta/psol/include/out/Release/obj/gen -I ../ngx_pagespeed-1.13.35.1-beta/psol/include/out/Release/obj/gen/protoc_out/instaweb -I ../ngx_pagespeed-1.13.35.1-beta/psol/include/third_party/apr/src/include -I ../ngx_pagespeed-1.13.35.1-beta/psol/include/third_party/aprutil/src/include -I ../ngx_pagespeed-1.13.35.1-beta/psol/include/third_party/apr/gen/arch/linux/x64/include -I ../ngx_pagespeed-1.13.35.1-beta/psol/include/third_party/aprutil/gen/arch/linux/x64/include -I ../ngx_pagespeed-1.13.35.1-beta/psol/include/url -I ../pcre-8.41 -I ../openssl-1.0.2m/.openssl/include -I ../zlib-1.2.11 -I objs -I src/http -I src/http/modules -I src/http/v2 -I ../ngx_devel_kit-0.3.0/src -I ../ngx_devel_kit-0.3.0/src -I ../ngx_devel_kit-0.3.0/objs -I objs/addon/ndk -I /usr/local/include/luajit-2.1 -I src/stream \
                -o objs/addon/src/ngx_event_connection.o \
                ../ngx_pagespeed-1.13.35.1-beta/src/ngx_event_connection.cc
../ngx_pagespeed-1.13.35.1-beta/src/ngx_event_connection.cc: In member function ‘bool net_instaweb::NgxEventConnection::Init(ngx_cycle_t*)’:
../ngx_pagespeed-1.13.35.1-beta/src/ngx_event_connection.cc:60:27: error: ‘F_SETPIPE_SZ’ was not declared in this scope
     fcntl(pipe_write_fd_, F_SETPIPE_SZ, 200*1024 /* minimal amount of bytes */);
                           ^
make[1]: *** [objs/addon/src/ngx_event_connection.o] Error 1
make[1]: Leaving directory `/svr-setup/nginx-1.13.7'
make: *** [build] Error 2

configure

./configure --with-ld-opt="-ljemalloc -lpcre -Wl,-z,relro -Wl,-rpath,/usr/local/lib" --with-cc-opt="-m64 -march=native -g -O3 -fstack-protector-strong -flto -fuse-ld=gold --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wno-deprecated-declarations -gsplit-dwarf" --sbin-path=/usr/local/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --with-compat --with-http_stub_status_module --with-http_secure_link_module --with-libatomic --with-http_gzip_static_module --add-dynamic-module=../ngx_brotli --add-dynamic-module=../ngx_pagespeed-1.13.35.1-beta --with-http_sub_module --with-http_addition_module --with-http_image_filter_module=dynamic --with-http_geoip_module --with-stream_geoip_module --with-stream_realip_module --with-stream_ssl_preread_module --with-threads --with-stream=dynamic --with-stream_ssl_module --with-http_realip_module --add-dynamic-module=../ngx-fancyindex-0.4.2 --add-module=../ngx_cache_purge-2.4.2 --add-module=../ngx_devel_kit-0.3.0 --add-dynamic-module=../set-misc-nginx-module-0.31 --add-dynamic-module=../echo-nginx-module-0.61 --add-module=../redis2-nginx-module-0.14 --add-module=../ngx_http_redis-0.3.7 --add-module=../lua-nginx-module-0.10.11 --add-module=../memc-nginx-module-0.18 --add-module=../srcache-nginx-module-0.31 --add-dynamic-module=../headers-more-nginx-module-0.33 --with-pcre=../pcre-8.41 --with-pcre-jit --with-zlib=../zlib-1.2.11 --with-http_ssl_module --with-http_v2_module --with-openssl=../openssl-1.0.2m --with-openssl-opt='enable-ec_nistp_64_gcc_128'

checking for OS
 + Linux 2.6.32-696.10.3.el6.x86_64 x86_64
checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 5.3.1 20160406 (Red Hat 5.3.1-6) (GCC) 
checking for gcc -pipe switch ... found
checking for --with-ld-opt="-ljemalloc -lpcre -Wl,-z,relro -Wl,-rpath,/usr/local/lib" ... found
checking for -Wl,-E switch ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for gcc builtin 64 bit byteswap ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
checking for epoll ... found
checking for EPOLLRDHUP ... found
checking for EPOLLEXCLUSIVE ... not found
checking for O_PATH ... not found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for crypt_r() ... found
checking for sys/vfs.h ... found
checking for nobody group ... found
checking for poll() ... found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... found
checking for F_READAHEAD ... not found
checking for posix_fadvise() ... found
checking for O_DIRECT ... found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for statfs() ... found
checking for statvfs() ... found
checking for dlopen() ... not found
checking for dlopen() in libdl ... found
checking for sched_yield() ... found
checking for sched_setaffinity() ... found
checking for SO_SETFIB ... not found
checking for SO_REUSEPORT ... found
checking for SO_ACCEPTFILTER ... not found
checking for SO_BINDANY ... not found
checking for IP_BIND_ADDRESS_NO_PORT ... not found
checking for IP_TRANSPARENT ... found
checking for IP_BINDANY ... not found
checking for IP_RECVDSTADDR ... not found
checking for IP_SENDSRCADDR ... not found
checking for IP_PKTINFO ... found
checking for IPV6_RECVPKTINFO ... found
checking for TCP_DEFER_ACCEPT ... found
checking for TCP_KEEPIDLE ... found
checking for TCP_FASTOPEN ... not found
checking for TCP_INFO ... found
checking for accept4() ... found
checking for eventfd() ... found
checking for int size ... 4 bytes
checking for long size ... 8 bytes
checking for long long size ... 8 bytes
checking for void * size ... 8 bytes
checking for uint32_t ... found
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... 4 bytes
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system byte ordering ... little endian
checking for size_t size ... 8 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 8 bytes
checking for AF_INET6 ... found
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for pwritev() ... found
checking for sys_nerr ... found
checking for localtime_r() ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... found
checking for POSIX semaphores ... not found
checking for POSIX semaphores in libpthread ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found
checking for struct dirent.d_namlen ... not found
checking for struct dirent.d_type ... found
checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for openat(), fstatat() ... found
checking for getaddrinfo() ... found
configuring additional modules
adding module in ../ngx_cache_purge-2.4.2
 + ngx_http_cache_purge_module was configured
adding module in ../ngx_devel_kit-0.3.0
 + ngx_devel_kit was configured
adding module in ../redis2-nginx-module-0.14
 + ngx_http_redis2_module was configured
adding module in ../ngx_http_redis-0.3.7
 + ngx_http_redis_module was configured
adding module in ../lua-nginx-module-0.10.11
checking for LuaJIT library in /usr/local/lib and /usr/local/include/luajit-2.1 (specified by the LUAJIT_LIB and LUAJIT_INC env, with -ldl) ... found
checking for export symbols by default (-E) ... found
checking for export symbols by default (--export-all-symbols) ... not found
checking for SO_PASSCRED ... found
checking for __attribute__(constructor) ... found
checking for malloc_trim ... found
 + ngx_http_lua_module was configured
adding module in ../memc-nginx-module-0.18
 + ngx_http_memc_module was configured
adding module in ../srcache-nginx-module-0.31
 + ngx_http_srcache_filter_module was configured
configuring additional dynamic modules
adding module in ../ngx_brotli
 + ngx_brotli was configured
adding module in ../ngx_pagespeed-1.13.35.1-beta
dirname: extra operand `gcc'
Try `dirname --help' for more information.
mod_pagespeed_dir=../ngx_pagespeed-1.13.35.1-beta/psol/include
build_from_source=false
checking for psol ... found
List of modules (in reverse order of applicability):  ngx_http_write_filter_module ngx_http_header_filter_module ngx_http_chunked_filter_module ngx_http_v2_filter_module ngx_http_range_header_filter_module ngx_http_gzip_filter_module ngx_http_postpone_filter_module ngx_http_ssi_filter_module ngx_http_charset_filter_module ngx_http_sub_filter_module ngx_http_addition_filter_module ngx_http_userid_filter_module ngx_http_headers_filter_module
checking for psol-compiler-compat ... found
 + ngx_pagespeed was configured
adding module in ../ngx-fancyindex-0.4.2
 + ngx_http_fancyindex_module was configured
adding module in ../set-misc-nginx-module-0.31
found ngx_devel_kit for ngx_set_misc; looks good.
 + ngx_http_set_misc_module was configured
adding module in ../echo-nginx-module-0.61
 + ngx_http_echo_module was configured
adding module in ../headers-more-nginx-module-0.33
 + ngx_http_headers_more_filter_module was configured
checking for GD library ... found
checking for GD WebP support ... not found
checking for GeoIP library ... found
checking for GeoIP IPv6 support ... found
checking for atomic_ops library ... found
creating objs/Makefile

Configuration summary
  + using threads
  + using PCRE library: ../pcre-8.41
  + using OpenSSL library: ../openssl-1.0.2m
  + using zlib library: ../zlib-1.2.11
  + using system libatomic_ops library

  nginx path prefix: "/usr/local/nginx"
  nginx binary file: "/usr/local/sbin/nginx"
  nginx modules path: "/usr/local/nginx/modules"
  nginx configuration prefix: "/usr/local/nginx/conf"
  nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
  nginx pid file: "/usr/local/nginx/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx/logs/error.log"
  nginx http access log file: "/usr/local/nginx/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"


Tue Nov 21 19:18:59 UTC 2017
Success: Nginx configure ok

Working CentOS 7 + Nginx 1.13.7 + ngx_pagespeed 1.13.35.1-beta

compared to working CentOS 7 installed nginx 1.13.7 + ngx_pagespeed 1.13.35.1-beta

nginx -V
nginx version: nginx/1.13.7
built by gcc 6.3.1 20170216 (Red Hat 6.3.1-3) (GCC) 
built with OpenSSL 1.0.2m  2 Nov 2017
TLS SNI support enabled

configure arguments: --with-ld-opt='-ljemalloc -lpcre -Wl,-z,relro -Wl,-rpath,/usr/local/lib' --with-cc-opt='-m64 -march=native -DTCP_FASTOPEN=23 -g -O3 -fstack-protector-strong -flto -fuse-ld=gold --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wno-deprecated-declarations -gsplit-dwarf' --sbin-path=/usr/local/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --with-compat --with-http_stub_status_module --with-http_secure_link_module --with-libatomic --with-http_gzip_static_module --add-dynamic-module=../ngx_brotli --add-dynamic-module=../ngx_pagespeed-1.13.35.1-beta --with-http_sub_module --with-http_addition_module --with-http_image_filter_module=dynamic --with-http_geoip_module --with-stream_geoip_module --with-stream_realip_module --with-stream_ssl_preread_module --with-threads --with-stream=dynamic --with-stream_ssl_module --with-http_realip_module --add-dynamic-module=../ngx-fancyindex-0.4.2 --add-module=../ngx_cache_purge-2.4.2 --add-dynamic-module=../ngx_devel_kit-0.3.0 --add-dynamic-module=../set-misc-nginx-module-0.31 --add-dynamic-module=../echo-nginx-module-0.61 --add-module=../redis2-nginx-module-0.14 --add-module=../ngx_http_redis-0.3.7 --add-dynamic-module=../lua-nginx-module-0.10.11 --add-module=../memc-nginx-module-0.18 --add-module=../srcache-nginx-module-0.31 --add-dynamic-module=../headers-more-nginx-module-0.33 --with-pcre=../pcre-8.41 --with-pcre-jit --with-zlib=../zlib-1.2.11 --with-http_ssl_module --with-http_v2_module --with-openssl=../openssl-1.0.2m --with-openssl-opt='enable-ec_nistp_64_gcc_128'

@oschaaf

This comment has been minimized.

Copy link
Member

oschaaf commented Nov 21, 2017

Looking at a related SO post, kernels before 2.6.35 do not have F_SETPIPE_SZ defined:
https://stackoverflow.com/questions/25411892/f-setpipe-sz-undeclared

Maybe we should skip the related code if F_SETPIPE_SZ is not around.

@centminmod

This comment has been minimized.

Copy link

centminmod commented Nov 21, 2017

Ah kernel related ! Yeah if a workaround for such can be made, that would be great :)

@ryanagler

This comment has been minimized.

Copy link

ryanagler commented Nov 22, 2017

also having this issue under Centos 6

centminmod added a commit to centminmod/centminmod that referenced this issue Nov 22, 2017

update inc/nginx_pagespeed.inc support downgrades
- support downgrading ngx_pagespeed from 1.13.35.1-beta to 1.12.34.3-stable. Nginx Pagespeed 1.13.35.1-beta introduced changes which broke centos 6 systems with 2.6.32 kernels apache/incubator-pagespeed-ngx#1503
@centminmod

This comment has been minimized.

Copy link

centminmod commented Nov 22, 2017

yeah for now, i have downgraded to 1.12.34.3-stable version until there's a workaround fix

centminmod added a commit to centminmod/centminmod that referenced this issue Nov 23, 2017

downgrade ngx_pagespeed for centos 6 compatibility issue
- download from ngx_pagespeed 1.13.35.1-beta back to 1.12.34.3-stable due to centos 6 kernel compatibility issue apache/incubator-pagespeed-ngx#1503

oschaaf added a commit that referenced this issue Nov 23, 2017

F_SETPIPE_SZ: check for existence before using
Kernels before 2.6.35 do not have F_SETPIPE_SZ defined.

Fixes #1503

centminmod added a commit to centminmod/centminmod that referenced this issue Nov 25, 2017

@centminmod

This comment has been minimized.

Copy link

centminmod commented Nov 25, 2017

confirm the fix works on centos 6

thanks @oschaaf

oschaaf added a commit that referenced this issue Nov 27, 2017

F_SETPIPE_SZ: check for existence before using (#1505)
Kernels before 2.6.35 do not have F_SETPIPE_SZ defined.

Fixes #1503

oschaaf added a commit that referenced this issue Dec 27, 2017

F_SETPIPE_SZ: check for existence before using (#1505)
Kernels before 2.6.35 do not have F_SETPIPE_SZ defined.

Fixes #1503
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment