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

MMDB_free_entry_data_list (entry_data_list=0x23) at maxminddb.c:1860 #8

Closed
atomyuk opened this issue Jul 11, 2018 · 10 comments
Closed

Comments

@atomyuk
Copy link

atomyuk commented Jul 11, 2018

Hi!
while trying to run some tests along with openresty i am getting segfault:

GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-110.el7
Copyright (C) 2013 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-redhat-linux-gnu".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /usr/local/openresty/nginx/sbin/nginx...Reading symbols from /usr/local/openresty/nginx/sbin/nginx...(no debugging symbols found)...done.
(no debugging symbols found)...done.
[New LWP 15418]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `nginx -p /usr/local/openresty/nginx/conf/t/servroot/ -c /usr/local/openresty/ng'.
Program terminated with signal 11, Segmentation fault.
#0 MMDB_free_entry_data_list (entry_data_list=0x23) at maxminddb.c:1860
1860 data_pool_destroy(entry_data_list->pool);
Missing separate debuginfos, use: debuginfo-install openresty-1.13.6.2-1.el7.x86_64
#0 MMDB_free_entry_data_list (entry_data_list=0x23) at maxminddb.c:1860
#1 0x00007f59530a5c14 in lj_vm_ffi_call ()
from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
#2 0x00007f59530e54a4 in lj_ccall_func ()
from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
#3 0x00007f59530f96a6 in lj_cf_ffi_meta___call ()
from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
#4 0x00007f59530a3b23 in lj_BC_FUNCC ()
from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
#5 0x00000000004e9a89 in ngx_http_lua_run_thread ()
#6 0x00000000004ecd36 in ngx_http_lua_content_by_chunk ()
#7 0x00000000004ec88c in ngx_http_lua_content_handler ()
#8 0x0000000000457aee in ngx_http_core_content_phase ()
#9 0x0000000000452595 in ngx_http_core_run_phases ()
#10 0x000000000045ce73 in ngx_http_process_request ()
#11 0x000000000045d6eb in ngx_http_process_request_line ()
#12 0x0000000000447147 in ngx_epoll_process_events ()
#13 0x000000000043e76b in ngx_process_events_and_timers ()
#14 0x00000000004468a0 in ngx_single_process_cycle ()
#15 0x000000000041f76d in main ()

code that producing this error is:
config of test suite is:
use Test::Nginx::Socket 'no_plan';

our $http_config = <<'EOC';
lua_package_path "/usr/local/openresty/nginx/conf/resty/?.luac;/usr/local/openresty/nginx/conf/resty/?.lua;/usr/local/openresty/nginx/conf/resty/lib/?.luac;/usr/local/openresty/nginx/conf/resty/lib/?.lua;;";
EOC

run_tests();

DATA

=== TEST 1: Geoip UA, Kiev
--- http_config eval: $::http_config
--- config
location = /geoip {
include /usr/local/openresty/nginx/conf/resty/conf/init.conf;
content_by_lua_block {
local remote_addr = '95.134.195.14'

    local geo = require 'lb.geoip'
    local res = geo.lookup(remote_addr)
    if ((res or {}).country or {}).iso_code then
        ngx.say(res['country']['iso_code'])
        ngx.exit(ngx.HTTP_OK)
    end
    ngx.say('FAIL')
}

}

can you help to understand why?

@anjia0532
Copy link
Owner

ref #7

@atomyuk
Copy link
Author

atomyuk commented Jul 12, 2018

sorry, but it still segfaulting with same error...

@jloh
Copy link
Contributor

jloh commented Oct 13, 2018

@atomyuk did you ever figure out the segfault? I'm currently running into the same issue.

@anjia0532
Copy link
Owner

@jloh paste your code plz

@jloh
Copy link
Contributor

jloh commented Oct 13, 2018

@anjia0532 you can see the code I'm using here and the segfaults during tests I'm getting here.

I asked on the CircleCI forums but not one seems to know there either.

Its in the maxmind code somewhere (whether its the lib or something else I'm not sure) but this is what a core dump shows:

root@7cb5f43803ab:~/project# gdb $(which openresty) core.1162.\!usr\!local\!openresty\!nginx\!sbin\!nginx
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 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 /usr/bin/openresty...(no debugging symbols found)...done.
[New LWP 1162]
[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 -p /root/project/t/servroot/ -c /root/project/t/servroot/conf/nginx.conf'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f3a3dd98e15 in MMDB_free_entry_data_list () from /usr/lib/x86_64-linux-gnu/libmaxminddb.so
(gdb) backtrace full
#0  0x00007f3a3dd98e15 in MMDB_free_entry_data_list () from /usr/lib/x86_64-linux-gnu/libmaxminddb.so
No symbol table info available.
#1  0x00007f3a3fe68554 in ?? () from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
No symbol table info available.
#2  0x00007f3a3fea956a in ?? () from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
No symbol table info available.
#3  0x00007f3a3febd6a6 in ?? () from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
No symbol table info available.
#4  0x00007f3a3fe66463 in ?? () from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
No symbol table info available.
#5  0x00000000004efcb2 in ngx_http_lua_run_thread ()
No symbol table info available.
#6  0x00000000004f2fa3 in ngx_http_lua_content_by_chunk ()
No symbol table info available.
#7  0x00000000004f2b5c in ngx_http_lua_content_handler ()
No symbol table info available.
#8  0x000000000045978e in ngx_http_core_content_phase ()
No symbol table info available.
#9  0x0000000000454065 in ngx_http_core_run_phases ()
No symbol table info available.
#10 0x000000000045eab3 in ngx_http_process_request ()
No symbol table info available.
#11 0x000000000045f351 in ?? ()
No symbol table info available.
#12 0x00000000004483eb in ?? ()
No symbol table info available.
#13 0x000000000043f4cb in ngx_process_events_and_timers ()
No symbol table info available.
#14 0x0000000000447ae0 in ngx_single_process_cycle ()
No symbol table info available.
#15 0x000000000041f9ef in main ()
No symbol table info available.

@anjia0532
Copy link
Owner

anjia0532 commented Oct 13, 2018

os version:
openresty version:
mmdb version:
lua version:

@jloh
Copy link
Contributor

jloh commented Oct 13, 2018

OS: Ubuntu 16.04 (Xenial)
Openresty: 1.13.6.2
MMDB: Latest
Lua: 5.1.5 (but probably running whatever version openresty is running?)

The weirdest thing is the tests run fine locally but fail via CI/test nginx test suite

@anjia0532
Copy link
Owner

anjia0532 commented Oct 15, 2018

switch to another CI tool(e.g. travis-ci ) ? test again

@jloh
Copy link
Contributor

jloh commented Oct 15, 2018

I've done a whole lot more debugging and this appears to be caused by luacov, disabling this means everything works fine. Why its having issues running I'm not sure, but not an issue here. Sorry for the noise!

@anjia0532
Copy link
Owner

I'm sorry to not help you

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

3 participants