Giter VIP home page Giter VIP logo

Comments (10)

agentzh avatar agentzh commented on August 31, 2024

@idevz OpenResty enables debuginfo in luajit (and all other components) by default, no special treatment needed (not even --with-debug). And our gdb tools should work on OpenResty without those special ./configure options as well.

The No global L located (tried globalL and ngx_cycle) error is usually a sign of lack of Lua related configurations in your nginx server instance. Are you 100% sure that your nginx worker process you're analyzed is indeed running Lua code?

from openresty-gdb-utils.

agentzh avatar agentzh commented on August 31, 2024

@idevz Okay, I can reproduce the issue on Mac OS X with the gdb 7.10 installed via homebrew. It works well, however, with gdb 7.9.1 on Fedora Linux with OpenResty 1.9.3.2, according to my test today.

from openresty-gdb-utils.

agentzh avatar agentzh commented on August 31, 2024

@idevz Okay, I've digged it up and found that there might be problem in this gdb on Mac OS X or the debuginfo in the nginx binary generated by clang there since gdb.lookup_global_symbol("ngx_cycle") returns None while the global C variable ngx_cycle is definitely there:

(gdb) p/x ngx_cycle
$2 = 0x81005250

(gdb) py print(gdb.lookup_global_symbol("ngx_cycle"))
None

For comparsion, on Linux with gdb 7.9.1, we have the following expected:

(gdb) p/x ngx_cycle
$1 = 0x22731b0
(gdb) py print(gdb.lookup_global_symbol("ngx_cycle"))
ngx_cycle

So it looks like a gdb issue. Will you try on Linux or some other OSes instead?

from openresty-gdb-utils.

idevz avatar idevz commented on August 31, 2024

@agentzh thank you very much, I try again with gdb 7.10.1, and it still fail, I will build a Centos VM for testing. thanks again. πŸ‘

from openresty-gdb-utils.

idevz avatar idevz commented on August 31, 2024

@agentzh thanks for your help, I build up this on my centos vm with gdb-7.10.1 and openresty-1.9.3.2, It's works well.

[root@zc1 src]# gdb -p 17540
GNU gdb (GDB) 7.10.1
Copyright (C) 2015 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-unknown-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".
Attaching to process 17540
Reading symbols from /usr/local/openresty-1.9.3.2/nginx/sbin/nginx...done.
Reading symbols from /lib64/libpthread.so.0...(no debugging symbols found)...done.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Reading symbols from /lib64/libcrypt.so.1...(no debugging symbols found)...done.
Reading symbols from /usr/local/openresty-1.9.3.2/luajit/lib/libluajit-5.1.so.2...done.
Reading symbols from /lib64/libm.so.6...(no debugging symbols found)...done.
Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done.
Reading symbols from /lib64/libpcre.so.0...(no debugging symbols found)...done.
Reading symbols from /lib64/libz.so.1...(no debugging symbols found)...done.
Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
Reading symbols from /lib64/libfreebl3.so...(no debugging symbols found)...done.
Reading symbols from /lib64/libgcc_s.so.1...(no debugging symbols found)...done.
Reading symbols from /lib64/libnss_files.so.2...(no debugging symbols found)...done.
0x0000003c766e9133 in __epoll_wait_nocancel () from /lib64/libc.so.6
(gdb) lvmst
current VM state: C code (from interpreted Lua code)
(gdb) lgcstat
 430 str        objects: max=940, avg = 27, min=18, sum=11783
  15 upval      objects: max=24, avg = 24, min=24, sum=360
   1 thread     objects: max=496, avg = 496, min=496, sum=496
  13 proto      objects: max=231, avg = 139, min=80, sum=1815
 306 func       objects: max=144, avg = 32, min=20, sum=9836
   0 trace      objects: max=0, avg = 0, min=0, sum=0
   0 cdata      objects: max=0, avg = 0, min=0, sum=0
  65 tab        objects: max=3104, avg = 296, min=32, sum=19288
   4 udata      objects: max=64, avg = 46, min=40, sum=184

 sizeof strhash 2048
 sizeof g->tmpbuf 128
 sizeof ctype_state 0
 sizeof jit_state 0

total sz 51170
g->strnum 430, g->gc.total 51170
elapsed: 0.120000 sec
(gdb) p/x ngx_cycle
$1 = 0x223e3b0
(gdb)

πŸ‘

from openresty-gdb-utils.

agentzh avatar agentzh commented on August 31, 2024

@idevz Okay, then it looks like a Mac OS X thing.

from openresty-gdb-utils.

idevz avatar idevz commented on August 31, 2024

@agentzh Yes,Thank you very much. πŸ‘ πŸ’―

from openresty-gdb-utils.

ssdr avatar ssdr commented on August 31, 2024

same issue on centos 6.5 with gdb 7.11 😒

from openresty-gdb-utils.

agentzh avatar agentzh commented on August 31, 2024

@ssdr Are you using the latest version of OpenResty releases? See

http://openresty.org/en/download.html

Since you provide little details about your gdb output, I guess it's either you are using LuaJIT 2.0 instead of LuaJIT 2.1 (only the latter is supported) and/or your LuaJIT build lacks debug symbols. Better use the OpenResty bundle to avoid such problems.

from openresty-gdb-utils.

ssdr avatar ssdr commented on August 31, 2024

@agentzh yes, I am using LuaJIT2.0, I'll try LuaJIT2.1, thank you for your reply πŸ˜ƒ

from openresty-gdb-utils.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.