nginx-eval-module icon indicating copy to clipboard operation
nginx-eval-module copied to clipboard

Unable to use as dynamic module

Open remort opened this issue 3 years ago • 1 comments

It works if built statically (though with bugs, can't read body sent by eval module via proxy_pass). But refuses to load as a dynamic module. This is a backtrace:

GNU gdb (GDB) 11.1
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-alpine-linux-musl".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from nginx...
(No debugging symbols found in nginx)
[New LWP 16]
Core was generated by `nginx -t'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  ngx_http_eval_merge_loc_conf (cf=0x7ffc2dec70c8, parent=0x7fc63fbcd298, child=0x0) at //nginx-eval-module-1.0.4/ngx_http_eval_module.c:525
525	//nginx-eval-module-1.0.4/ngx_http_eval_module.c: No such file or directory.

I build modules, configuring nginx sources like this:

./configure --add-dynamic-module=$NGINX_EVAL_DIR --with-compat $CONFARGS

where CONFARGS - are configure arguments for Nginx in the container.

Then I copy .so to another exactly the same container as nginx module (to /etc/nginx/modules/) without build requirements installed (nginxes are the same with the same CONFARGS).

For example headers-more-nginx-module built in the same way loads well.

remort avatar May 12 '22 15:05 remort

Have just built it under ubuntu server 18.04. Same thing. Core dump:

# gdb nginx /cores/core.nginx.16 
GNU gdb (Ubuntu 8.1.1-0ubuntu1) 8.1.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from nginx...done.
[New LWP 16]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `nginx'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  ngx_http_eval_merge_loc_conf (cf=0x7ffe2bb5f450, parent=0x563813775c50, child=0x0) at ./nginx-eval-module-1.0.4/ngx_http_eval_module.c:525
525	./nginx-eval-module-1.0.4/ngx_http_eval_module.c: No such file or directory.

remort avatar May 20 '22 15:05 remort