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

Compile tengine-3.0.0 with xquic 1.6.1 failed #1875

Closed
yourchanges opened this issue Oct 13, 2023 · 7 comments
Closed

Compile tengine-3.0.0 with xquic 1.6.1 failed #1875

yourchanges opened this issue Oct 13, 2023 · 7 comments

Comments

@yourchanges
Copy link

yourchanges commented Oct 13, 2023

Ⅰ. Issue Description

Compile tengine-3.0.0 with xquic 1.6.1 failed

Ⅱ. Describe what happened

cc -c -I/usr/local/include/luajit-2.1/  -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -Wno-deprecated-declarations -DNDK_SET_VAR  -I src/core -I src/event -I src/event/modules -I src/os/unix -I src/proc -I modules/ngx_http_upstream_check_module -I modules/ngx_http_xquic_module -I ../xquic/include -I modules/ngx_http_lua_module/src/api -I ../pcre-8.43/ -I ../xquic/third_party/babassl//.openssl/include -I ../zlib-1.2.11 -I objs -I src/http -I src/http/modules -I src/http/v2 -I modules/ngx_http_upstream_dyups_module -I ../nginx-upsync-module-2.1.3/src -I ../ngx_brotli/deps/brotli/c/include -I /usr/local/include/luajit-2.1/ \
	-o objs/addon/ngx_http_xquic_module/ngx_http_xquic_module.o \
	modules/ngx_http_xquic_module/ngx_http_xquic_module.c
cc -c -I/usr/local/include/luajit-2.1/  -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -Wno-deprecated-declarations -DNDK_SET_VAR  -I src/core -I src/event -I src/event/modules -I src/os/unix -I src/proc -I modules/ngx_http_upstream_check_module -I modules/ngx_http_xquic_module -I ../xquic/include -I modules/ngx_http_lua_module/src/api -I ../pcre-8.43/ -I ../xquic/third_party/babassl//.openssl/include -I ../zlib-1.2.11 -I objs -I src/http -I src/http/modules -I src/http/v2 -I modules/ngx_http_upstream_dyups_module -I ../nginx-upsync-module-2.1.3/src -I ../ngx_brotli/deps/brotli/c/include -I /usr/local/include/luajit-2.1/ \
	-o objs/addon/ngx_http_xquic_module/ngx_http_xquic.o \
	modules/ngx_http_xquic_module/ngx_http_xquic.c
modules/ngx_http_xquic_module/ngx_http_xquic.c: 在函数‘ngx_http_xquic_session_process_packet’中:
modules/ngx_http_xquic_module/ngx_http_xquic.c:925:59: 错误:传递‘xqc_engine_packet_process’的第 9 个参数时将指针赋给整数,未作类型转换 [-Werror=int-conversion]
                                   (xqc_msec_t) recv_time, NULL) != 0)
                                                           ^~~~
In file included from modules/ngx_http_xquic_module/ngx_http_v3_stream.h:14,
                 from modules/ngx_http_xquic_module/ngx_xquic.h:12,
                 from modules/ngx_http_xquic_module/ngx_http_xquic.h:13,
                 from modules/ngx_http_xquic_module/ngx_http_xquic.c:9:
../xquic/include/xquic/xquic.h:1416:34: 附注:需要类型‘xqc_usec_t’ {或称 ‘long unsigned int’},但实参的类型为‘void *’
     uint64_t path_id, xqc_usec_t recv_time, void *user_data);
                       ~~~~~~~~~~~^~~~~~~~~
modules/ngx_http_xquic_module/ngx_http_xquic.c:922:9: 错误:提供给函数‘xqc_engine_packet_process’的实参太少
     if (xqc_engine_packet_process(qc->engine, (u_char *)packet->buf, recv_size,
         ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from modules/ngx_http_xquic_module/ngx_http_v3_stream.h:14,
                 from modules/ngx_http_xquic_module/ngx_xquic.h:12,
                 from modules/ngx_http_xquic_module/ngx_http_xquic.h:13,
                 from modules/ngx_http_xquic_module/ngx_http_xquic.c:9:
../xquic/include/xquic/xquic.h:1412:11: 附注:在此声明
 xqc_int_t xqc_engine_packet_process(xqc_engine_t *engine,
           ^~~~~~~~~~~~~~~~~~~~~~~~~
cc1:所有的警告都被当作是错误
make[1]: *** [objs/Makefile:2082:objs/addon/ngx_http_xquic_module/ngx_http_xquic.o] 错误 1
make[1]: 离开目录“/opt/tengine/tengine-3.0.0”
make: *** [Makefile:10:build] 错误 2

Ⅲ. Describe what you expected to happen

Ⅳ. How to reproduce it (as minimally and precisely as possible)

git clone https://github.com/alibaba/xquic.git
cd xquic/
git clone -b 8.3-stable https://github.com/Tongsuo-Project/Tongsuo.git ./third_party/babassl
cd ./third_party/babassl/
./config --prefix=/usr/local/babassl
make -j
export SSL_TYPE_STR="babassl"
export SSL_PATH_STR="${PWD}"
export SSL_INC_PATH_STR="${PWD}/include"
export SSL_LIB_PATH_STR="${PWD}/libssl.a;${PWD}/libcrypto.a"
cd -
git submodule update --init --recursive
mkdir -p build; cd build
cmake -DGCOV=on -DCMAKE_BUILD_TYPE=Debug -DXQC_ENABLE_TESTING=1 -DXQC_SUPPORT_SENDMMSG_BUILD=1 -DXQC_ENABLE_EVENT_LOG=1 -DXQC_ENABLE_BBR2=1 -DXQC_ENABLE_RENO=1 -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} -DSSL_INC_PATH=${SSL_INC_PATH_STR} -DSSL_LIB_PATH=${SSL_LIB_PATH_STR} ..
make -j
cp libxquic.so /usr/local/lib/

cd tengine-3.0.0
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_gzip_static_module  --with-http_ssl_module --with-http_v2_module --with-pcre=../pcre-8.43/ --with-zlib=../zlib-1.2.11 --with-http_lua_module --with-luajit-lib=/usr/local/lib/ --with-luajit-inc=/usr/local/include/luajit-2.1/ --with-lua-inc=/usr/local/include/luajit-2.1/ --with-lua-lib=/usr/local/lib/ --with-ld-opt=-Wl,-rpath, --add-module=modules/ngx_http_concat_module  --add-module=modules/ngx_http_upstream_session_sticky_module --add-module=modules/ngx_http_reqstat_module  --add-module=modules/ngx_http_upstream_check_module  --add-module=modules/ngx_http_trim_filter_module --add-module=modules/ngx_http_footer_filter_module --add-module=modules/ngx_http_upstream_consistent_hash_module --add-module=modules/ngx_http_upstream_dynamic_module --add-module=modules/ngx_http_user_agent_module --add-module=modules/ngx_http_upstream_dyups_module --add-module=modules/ngx_http_upstream_vnswrr_module --add-module=../nginx-upsync-module-2.1.3 --add-module=../nginx-module-vts-master --add-module=../ngx_brotli --with-xquic-inc="../xquic/include"  --with-xquic-lib="../xquic/build"    --add-module=modules/ngx_http_xquic_module   --with-openssl="../xquic/third_party/babassl/"
make

Ⅵ. Environment:

  • Tengine version (use sbin/nginx -V): tengine3.0.0
  • OS (e.g. from /etc/os-release): rocky linux 8.6
  • Kernel (e.g. uname -a): Linux dev4 4.18.0-477.15.1.el8_8.x86_64 fixed bugs of the limit_req module #1 SMP Wed Jun 28 15:04:18 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
@yourchanges
Copy link
Author

follow the https://github.com/alibaba/tengine/blob/master/modules/ngx_http_xquic_module/README.md use xquic-1.6.0 and Tongsuo-8.3.2 works

@yourchanges
Copy link
Author

and by the way, follow the guide , I configue the nginx, but all the site on the nginx cannot be opened, the error log says:

2023/10/13 15:36:15 [emerg] 225267#0: |xquic|xqc_engine_create: fail|
2023/10/13 15:36:15 [emerg] 225267#0: |xquic|ngx_xquic_process_init|engine_init fail|
2023/10/13 15:36:15 [emerg] 225266#0: |xquic|xqc_engine_create: fail|
2023/10/13 15:36:15 [emerg] 225266#0: |xquic|ngx_xquic_process_init|engine_init fail|
2023/10/13 15:36:15 [emerg] 225270#0: |xquic|xqc_engine_create: fail|
2023/10/13 15:36:15 [emerg] 225270#0: |xquic|ngx_xquic_process_init|engine_init fail|
2023/10/13 15:36:15 [emerg] 225272#0: |xquic|xqc_engine_create: fail|
2023/10/13 15:36:15 [emerg] 225272#0: |xquic|ngx_xquic_process_init|engine_init fail|
2023/10/13 15:36:15 [emerg] 225271#0: |xquic|xqc_engine_create: fail|
2023/10/13 15:36:15 [emerg] 225271#0: |xquic|ngx_xquic_process_init|engine_init fail|
2023/10/13 15:36:15 [emerg] 225268#0: |xquic|xqc_engine_create: fail|
2023/10/13 15:36:15 [emerg] 225268#0: |xquic|ngx_xquic_process_init|engine_init fail|
2023/10/13 15:36:15 [emerg] 225269#0: |xquic|xqc_engine_create: fail|
2023/10/13 15:36:15 [emerg] 225269#0: |xquic|ngx_xquic_process_init|engine_init fail|
2023/10/13 15:36:15 [emerg] 225265#0: |xquic|xqc_engine_create: fail|
2023/10/13 15:36:15 [emerg] 225265#0: |xquic|ngx_xquic_process_init|engine_init fail|
2023/10/13 15:36:15 [emerg] 225273#0: |xquic|xqc_engine_create: fail|
2023/10/13 15:36:15 [emerg] 225273#0: |xquic|ngx_xquic_process_init|engine_init fail|
2023/10/13 15:36:15 [emerg] 225275#0: |xquic|xqc_engine_create: fail|
2023/10/13 15:36:15 [emerg] 225275#0: |xquic|ngx_xquic_process_init|engine_init fail|
2023/10/13 15:36:15 [emerg] 225274#0: |xquic|xqc_engine_create: fail|
2023/10/13 15:36:15 [emerg] 225274#0: |xquic|ngx_xquic_process_init|engine_init fail|
2023/10/13 15:36:15 [emerg] 225279#0: |xquic|xqc_engine_create: fail|
2023/10/13 15:36:15 [emerg] 225279#0: |xquic|ngx_xquic_process_init|engine_init fail|
2023/10/13 15:36:15 [emerg] 225277#0: |xquic|xqc_engine_create: fail|
2023/10/13 15:36:15 [emerg] 225277#0: |xquic|ngx_xquic_process_init|engine_init fail|
2023/10/13 15:36:15 [emerg] 225280#0: |xquic|xqc_engine_create: fail|
2023/10/13 15:36:15 [emerg] 225280#0: |xquic|ngx_xquic_process_init|engine_init fail|
2023/10/13 15:36:15 [emerg] 225290#0: |xquic|xqc_engine_create: fail|
2023/10/13 15:36:15 [emerg] 225290#0: |xquic|ngx_xquic_process_init|engine_init fail|
2023/10/13 15:36:15 [emerg] 225276#0: |xquic|xqc_engine_create: fail|
2023/10/13 15:36:15 [emerg] 225276#0: |xquic|ngx_xquic_process_init|engine_init fail|
2023/10/13 15:36:15 [emerg] 225281#0: |xquic|xqc_engine_create: fail|
2023/10/13 15:36:15 [emerg] 225281#0: |xquic|ngx_xquic_process_init|engine_init fail|
2023/10/13 15:36:16 [alert] 225263#0: worker process 225267 exited with fatal code 2 and cannot be respawned
2023/10/13 15:36:15 [emerg] 225287#0: |xquic|xqc_engine_create: fail|
2023/10/13 15:36:15 [emerg] 225287#0: |xquic|ngx_xquic_process_init|engine_init fail|
2023/10/13 15:36:16 [alert] 225263#0: worker process 225270 exited with fatal code 2 and cannot be respawned
2023/10/13 15:36:15 [emerg] 225278#0: |xquic|xqc_engine_create: fail|
2023/10/13 15:36:15 [emerg] 225278#0: |xquic|ngx_xquic_process_init|engine_init fail|
2023/10/13 15:36:16 [alert] 225263#0: worker process 225266 exited with fatal code 2 and cannot be respawned
2023/10/13 15:36:15 [emerg] 225286#0: |xquic|xqc_engine_create: fail|

@yourchanges
Copy link
Author

and how to generate the /usr/local/tengine/ssl/default-fake-certificate.pem; for testing?

@lianglli
Copy link
Member

Tengine does NOT integrate with xquic latest version currently.

Pls. complite tengine 3.0.0 with xquic 1.6.0 specifically.

XQUIC_VERSION=1.6.0

wget -c "https://github.com/alibaba/xquic/archive/refs/tags/v1.6.0.tar.gz"
tar -xf v1.6.0.tar.gz

@yourchanges
Copy link
Author

Thank you @lianglli , and how to generate the /usr/local/tengine/ssl/default-fake-certificate.pem; for testing? pls give some tips, I can't launch the nginx , it always says: "2023/10/13 15:36:15 [emerg] 225267#0: |xquic|xqc_engine_create: fail|
2023/10/13 15:36:15 [emerg] 225267#0: |xquic|ngx_xquic_process_init|engine_init fail|"

@lianglli
Copy link
Member

The tengine-ingress docker image has the default-fake-certificate.pem.
You will be able to get the default-fake-certificate.pem from the https://github.com/alibaba/tengine-ingress.

BTW, search "generate a self-signed SSL certificate on Linux" from google

@yourchanges
Copy link
Author

@lianglli of cause, I know how to "generate a self-signed SSL certificate on Linux" and always use the commercial ssl cert for the online sites. I think my question should be ,
1 what's the difference between the default-fake-certificate.pem used by xquic and normal server side ssl cert/key,
2 how to solve the the "[emerg] 225267#0: |xquic|ngx_xquic_process_init|engine_init fail" , and it related to the default-fake-certificate.pem ?

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

No branches or pull requests

2 participants