[issue35132] python-gdb error: Python Exception Type does not have a target

2019-03-12 Thread Dylan Cali


Dylan Cali  added the comment:

Thank you!  And thank you Lisa Roach for the investigation and fix.

--

___
Python tracker 
<https://bugs.python.org/issue35132>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35132] python-gdb error: Python Exception Type does not have a target

2019-02-15 Thread Dylan Cali


Dylan Cali  added the comment:

> Hum, Dylan: what is your gdb version?

$ gdb --version
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1

> On Fedora 29 with gdb 8.2-6.fc29, it seems like .target() is useless

I can confirm removing the .target() call in libpython.py resolved the issue 
for me with no ill effects

> You can try faulthandler has a workaround.

I'll give this a try, thank you

--

___
Python tracker 
<https://bugs.python.org/issue35132>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35132] python-gdb error: Python Exception Type does not have a target

2018-11-01 Thread Dylan Cali


New submission from Dylan Cali :

Python version: 3.6.6-debug
System: Kernel: 4.15.0-38-generic x86_64
Distro: Linux Mint 18.2 Sonya
CPU:Quad core Intel Xeon E3-1505M
Memory: 32018.6MB


Expected:

py-list and py-bt to print the current python frame and traceback when 
attaching to a hung python process with gdb, a debug build of python, and 
cpython/Tools/gdb/libpython.py loaded.


Actual:

py-list and py-bt fail with:

Python Exception  Type does not have a target.:
Error occurred in Python command: Type does not have a target.

Invoking 'set python print-stack full' in gdb produces the more useful:

Traceback (most recent call last):
  File "", line 1, in 
  File "~/git/cpython/Tools/gdb/libpython.py", line 916, in filename
  File "~/git/cpython/Tools/gdb/libpython.py", line 1158, in proxyval
RuntimeError: Type does not have a target.

so it is failing at:

fields = gdb.lookup_type('PyUnicodeObject').target().fields()

in libpython.py [1].


Reproduce:

I haven't been able to create a simple standalone program that triggers the 
failure.  I am working on a PR for Keras to try and fix the multiprocessing 
support in some of their utility classes.  Currently the tests are sporadically 
hanging and my intention was to use python's gdb integration to identify 
exactly where and why the hangs are occuring... but I can't get that 
information at the moment because of the error above when invoking py-list and 
py-bt.

So, unfortunately, the shortest path to reproduce is to checkout the PR branch, 
run the offending tests, connect with gdb, and invoke py-list/py-bt:

* install a debug version of 3.6.6 if one isn't already available
* git clone https://github.com/calid/keras.git -b fix-multiprocessing-hang
* cd keras
* pip install -e .[tests]
* pip install tensorflow
* py.test tests/keras/utils/data_utils_test.py
* wait for hang
* gdb -p 
* invoke py-list or py-bt


I am happy to poke around in libpython.py and try to fix/submit a PR myself, 
but I'm not at all familiar with the python internals so I would need some 
guidance.  And obviously let me know if this isn't actually a bug but rather 
environment related/user error.

Thank you!


[1] https://github.com/python/cpython/blob/v3.6.6/Tools/gdb/libpython.py#L1158

--
components: Demos and Tools
messages: 329052
nosy: Dylan Cali
priority: normal
severity: normal
status: open
title: python-gdb error: Python Exception  Type does not 
have a target
type: behavior
versions: Python 3.6

___
Python tracker 
<https://bugs.python.org/issue35132>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com