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

heap command returns "unorderable types: int() <= NoneType()" error #18

Closed
csala opened this issue May 4, 2015 · 3 comments · Fixed by #20
Closed

heap command returns "unorderable types: int() <= NoneType()" error #18

csala opened this issue May 4, 2015 · 3 comments · Fixed by #20

Comments

@csala
Copy link

csala commented May 4, 2015

Hello,

I'm not sure if this is a bug or just wrong usage, but I'm getting the error from the title when trying to use the heap command.

Here you have the whole output, including the commands used and the error (last two rows):

root@host ~ # cat gdb-heap-commands 
python
import sys
sys.path.insert(0, "/usr/share/glib-2.0/gdb")
sys.path.append("/usr/share/glib-2.0/gdb")
sys.path.append("/root/gdb-heap")
import gdbheap
end
root@host ~ # gdb python core.9795 -x gdb-heap-commands
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 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 python...Reading symbols from /usr/lib/debug//usr/bin/python2.7...done.
done.

warning: core file may not match specified executable file.
[New LWP 9795]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `gunicorn: worker [gunicorn]'.
#0  0x00007f08d4eb2af3 in __epoll_wait_nocancel () at ../sysdeps/unix/syscall-template.S:81
81  ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) heap
Blocks retrieved 10000
Blocks retrieved 20000
Blocks retrieved 30000
Python Exception <class 'TypeError'> unorderable types: int() <= NoneType(): 
Error occurred in Python command: unorderable types: int() <= NoneType()

As you can see, I'm also obtaining an other error about a syscall file not being found, though I cannot say if it has any relation (probably not).

@rogerhu
Copy link
Owner

rogerhu commented May 5, 2015

There have been a lot of issues when the GDB bumped to Python 3.0. Can you
type " set python print-stack" (://
sourceware.org/gdb/current/onlinedocs/gdb/Python-Commands.html#Python-Commands)
to see where the issue is coming from ? Any fixes would be appreciated.

On Mon, May 4, 2015 at 3:07 AM, Carles Sala notifications@github.com
wrote:

Hello,

I'm not sure if this is a bug or just wrong usage, but I'm getting the
error from the title when trying to use the heap command.

Here you have the whole output, including the commands used and the error
(last two rows):

root@host ~ # cat gdb-heap-commands
python
import sys
sys.path.insert(0, "/usr/share/glib-2.0/gdb")
sys.path.append("/usr/share/glib-2.0/gdb")
sys.path.append("/root/gdb-heap")
import gdbheap
end
root@host ~ # gdb python core.9795 -x gdb-heap-commands
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 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 python...Reading symbols from /usr/lib/debug//usr/bin/python2.7...done.
done.

warning: core file may not match specified executable file.
[New LWP 9795]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `gunicorn: worker [gunicorn]'.
#0 0x00007f08d4eb2af3 in __epoll_wait_nocancel () at ../sysdeps/unix/syscall-template.S:81
81 ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) heap
Blocks retrieved 10000
Blocks retrieved 20000
Blocks retrieved 30000
Python Exception <class 'TypeError'> unorderable types: int() <= NoneType():
Error occurred in Python command: unorderable types: int() <= NoneType()

As you can see, I'm also obtaining an other error about a syscall file not
being found, though I cannot say if it has any relation (probably not).


Reply to this email directly or view it on GitHub
#18.

@csala
Copy link
Author

csala commented May 9, 2015

Hi @rogerhu,

Here you have the stack trace:

(gdb) heap
Blocks retrieved 10000
Blocks retrieved 20000
Blocks retrieved 30000
Traceback (most recent call last):
  File "/root/gdb-heap/heap/commands.py", line 34, in g
    return f(self, args, from_tty)
  File "/root/gdb-heap/heap/commands.py", line 56, in invoke
    usage_list = list(lazily_get_usage_list())
  File "/root/gdb-heap/heap/__init__.py", line 503, in lazily_get_usage_list
    categorize_usage_list(usage_list)
  File "/root/gdb-heap/heap/__init__.py", line 528, in categorize_usage_list
    if u.obj.categorize_refs(usage_set):
  File "/root/gdb-heap/heap/cpython.py", line 357, in categorize_refs
    detail='%s.__dict__' % self.safe_tp_name())
  File "/root/gdb-heap/heap/cpython.py", line 297, in categorize_refs
    level)
  File "/root/gdb-heap/heap/__init__.py", line 364, in set_addr_category
    if level <= u.level:
TypeError: unorderable types: int() <= NoneType()
Error occurred in Python command: unorderable types: int() <= NoneType()

I'll have a look at the code, to see if I can see the reason.

This was referenced May 9, 2015
@pikrzysztof
Copy link

No idea what happend, but I have just cloned the repository and got exactly the same stack trace:

(gdb) set python print-stack full
(gdb) heap
Blocks retrieved 10000
Blocks retrieved 20000
Blocks retrieved 30000
Blocks retrieved 40000
Blocks retrieved 50000
Blocks retrieved 60000
Blocks retrieved 70000
Blocks retrieved 80000
Blocks retrieved 90000
Blocks retrieved 100000
Blocks retrieved 110000
Blocks retrieved 120000
Blocks retrieved 130000
Blocks retrieved 140000
Blocks retrieved 150000
Blocks retrieved 160000
Blocks retrieved 170000
Blocks retrieved 180000
Traceback (most recent call last):
  File "/opt/backend/gdb-heap/heap/commands.py", line 34, in g
    return f(self, args, from_tty)
  File "/opt/backend/gdb-heap/heap/commands.py", line 56, in invoke
    usage_list = list(lazily_get_usage_list())
  File "/opt/backend/gdb-heap/heap/__init__.py", line 503, in lazily_get_usage_list
    categorize_usage_list(usage_list)
  File "/opt/backend/gdb-heap/heap/__init__.py", line 528, in categorize_usage_list
    if u.obj.categorize_refs(usage_set):
  File "/opt/backend/gdb-heap/heap/cpython.py", line 357, in categorize_refs
    detail='%s.__dict__' % self.safe_tp_name())
  File "/opt/backend/gdb-heap/heap/cpython.py", line 297, in categorize_refs
    level)
  File "/opt/backend/gdb-heap/heap/__init__.py", line 364, in set_addr_category
    if level <= u.level:
TypeError: unorderable types: int() <= NoneType()
Error occurred in Python command: unorderable types: int() <= NoneType()
(gdb) 

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

Successfully merging a pull request may close this issue.

3 participants