Re: [Qgis-developer] QGIS crash during testing of my plugin

2014-10-15 Thread Salvatore Larosa
Ciao Luca,

On Wed, Oct 15, 2014 at 9:25 AM, Luca Delucchi  wrote:
> On 14 October 2014 14:15, Salvatore Larosa  wrote:
>> On Tue, Oct 14, 2014 at 1:49 PM, Luca Delucchi  wrote:
>>> On 14 October 2014 13:28, Salvatore Larosa  wrote:
>>>

 Did you install the python-dbg package?

>>>
>>> yes sure
>>
>> and python2.7-dbg?
>>
>
> yes
>
>> I don't know whether getting stacktrace by python helps here, but that
>> should be a big hint in order to try to track down the source of the
>> problem with your plugin.
>>
>
> ok, how do you usually use py-bt with gdb? how do you run gdb ("gdb
> qgis" or something different)?

Usually, it is enough to type:

# gdb qgis
(gdb) r
 <- crash
(gdb) py-bt
 -> python stacktrace

but there are other useful options [0]

also look at this link [1], you could be in the same situation

Saluti!

[0] - https://docs.python.org/devguide/gdb.html
[1] - 
http://stackoverflow.com/questions/22931774/how-to-use-gdb-python-debugging-extension-inside-virtualenv

-- 
Salvatore Larosa
linkedIn: http://linkedin.com/in/larosasalvatore
twitter: @lrssvt
skype: s.larosa
IRC: lrssvt on freenode
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] QGIS crash during testing of my plugin

2014-10-15 Thread Luca Delucchi
On 14 October 2014 14:15, Salvatore Larosa  wrote:
> On Tue, Oct 14, 2014 at 1:49 PM, Luca Delucchi  wrote:
>> On 14 October 2014 13:28, Salvatore Larosa  wrote:
>>
>>>
>>> Did you install the python-dbg package?
>>>
>>
>> yes sure
>
> and python2.7-dbg?
>

yes

> I don't know whether getting stacktrace by python helps here, but that
> should be a big hint in order to try to track down the source of the
> problem with your plugin.
>

ok, how do you usually use py-bt with gdb? how do you run gdb ("gdb
qgis" or something different)?

-- 
ciao
Luca

http://gis.cri.fmach.it/delucchi/
www.lucadelu.org
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] QGIS crash during testing of my plugin

2014-10-14 Thread Salvatore Larosa
On Tue, Oct 14, 2014 at 1:49 PM, Luca Delucchi  wrote:
> On 14 October 2014 13:28, Salvatore Larosa  wrote:
>
>>
>> Did you install the python-dbg package?
>>
>
> yes sure

and python2.7-dbg?

I don't know whether getting stacktrace by python helps here, but that
should be a big hint in order to try to track down the source of the
problem with your plugin.

-- 
Salvatore Larosa
linkedIn: http://linkedin.com/in/larosasalvatore
twitter: @lrssvt
skype: s.larosa
IRC: lrssvt on freenode
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] QGIS crash during testing of my plugin

2014-10-14 Thread Luca Delucchi
On 14 October 2014 13:28, Salvatore Larosa  wrote:

>
> Did you install the python-dbg package?
>

yes sure

apt-get install python-dbg
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-dbg is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.


-- 
ciao
Luca

http://gis.cri.fmach.it/delucchi/
www.lucadelu.org
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] QGIS crash during testing of my plugin

2014-10-14 Thread Salvatore Larosa
On Tue, Oct 14, 2014 at 12:19 PM, Luca Delucchi  wrote:
> On 14 October 2014 11:51, Salvatore Larosa  wrote:
>> Hi Luca,
>>
>
> Hi Salvatore,
>
>
>>
>> just type py-bt [0] onto gdb prompt, you need of the python extension
>> for debugging though.
>>
>
> I'm still not able to run it, I installed all the needed software.
> These are my steps:
> - run "gdb qgis"
> - inside gdb type "run" this execute qgis
> - now try to crash qgis
> - type "py-bt" but the result is
>
>  (gdb) py-bt
>  Undefined command: "py-bt".  Try "help".

Did you install the python-dbg package?

-- 
Salvatore Larosa
linkedIn: http://linkedin.com/in/larosasalvatore
twitter: @lrssvt
skype: s.larosa
IRC: lrssvt on freenode
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] QGIS crash during testing of my plugin

2014-10-14 Thread Luca Delucchi
On 14 October 2014 11:51, Salvatore Larosa  wrote:
> Hi Luca,
>

Hi Salvatore,


>
> just type py-bt [0] onto gdb prompt, you need of the python extension
> for debugging though.
>

I'm still not able to run it, I installed all the needed software.
These are my steps:
- run "gdb qgis"
- inside gdb type "run" this execute qgis
- now try to crash qgis
- type "py-bt" but the result is

 (gdb) py-bt
 Undefined command: "py-bt".  Try "help".

Instead if I run only "bt" I obtain some output (the following one is
the complete output of gdb)

 (gdb) run
Starting program: /usr/local/bin/qgis
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Warning: loading of qt translation failed [/usr/share/qt4/translations/qt_en_GB]
Warning: QGraphicsScene::addItem: item has already been added to this scene
[New Thread 0x7fffd2b97700 (LWP 31012)]
[New Thread 0x7fff92294700 (LWP 31013)]
[New Thread 0x7fff91540700 (LWP 31014)]
[New Thread 0x7fff676b4700 (LWP 31019)]
[Thread 0x7fff676b4700 (LWP 31019) exited]

Program received signal SIGSEGV, Segmentation fault.
0x7fff80330559 in ?? () from
/usr/lib/python2.7/dist-packages/PyQt4/QtCore.so
(gdb) bt
#0  0x7fff80330559 in ?? () from
/usr/lib/python2.7/dist-packages/PyQt4/QtCore.so
#1  0x72855919 in QMetaObject::cast(QObject*) const () from
/usr/lib/x86_64-linux-gnu/libQtCore.so.4
#2  0x71fe0e9c in QMdiArea::eventFilter(QObject*, QEvent*) ()
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#3  0x7fff7faeb566 in ?? () from
/usr/lib/python2.7/dist-packages/PyQt4/QtGui.so
#4  0x7284ed82 in
QCoreApplicationPrivate::sendThroughApplicationEventFilters(QObject*,
QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#5  0x71ba42a8 in QApplicationPrivate::notify_helper(QObject*,
QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#6  0x71baae18 in QApplication::notify(QObject*, QEvent*) ()
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#7  0x73e82a37 in QgsApplication::notify(QObject*, QEvent*) ()
from /usr/local/lib/libqgis_core.so.2.5.0
#8  0x7284ecad in QCoreApplication::notifyInternal(QObject*,
QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#9  0x71ba6547 in QApplicationPrivate::enterModal(QWidget*) ()
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#10 0x71bf48c8 in QWidgetPrivate::show_helper() () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
#11 0x71bf674a in QWidget::setVisible(bool) () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
#12 0x720784ae in QDialog::setVisible(bool) () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
#13 0x7fff7fcb389c in ?? () from
/usr/lib/python2.7/dist-packages/PyQt4/QtGui.so
#14 0x72078876 in QDialog::exec() () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
#15 0x7fff7fc69205 in ?? () from
/usr/lib/python2.7/dist-packages/PyQt4/QtGui.so
#16 0x7fff80ba9a8c in call_function (oparg=,
pp_stack=) at ../Python/ceval.c:4021
#17 PyEval_EvalFrameEx (f=0x7fff88151050, throwflag=1746239640) at
../Python/ceval.c:2667
#18 0x7fff80c1ccf0 in PyEval_EvalCodeEx (co=0x7fff7cc9ddb0,
globals=0x7fff80125780, locals=0x7fffbb60, locals@entry=0x0,
args=0x7fff6f9dd228, argcount=2144122026,
kws=0xedd480 , kws@entry=0x0, kwcount=0,
defs=0x0, defcount=0, closure=0x0) at ../Python/ceval.c:3253
#19 0x7fff80b6be3c in function_call.lto_priv.328
(func=0x7fff7cc03d70, arg=0x7fff6f9dd210, kw=0x0) at
../Objects/funcobject.c:526
#20 0x7fff80b74873 in PyObject_Call (func=0x7fff7cc03d70,
arg=, kw=) at ../Objects/abstract.c:2529
#21 0x7fff80bb6c55 in instancemethod_call.lto_priv.243
(func=0x7fff67ea5938, arg=0x7fff88151050, kw=0x0) at
../Objects/classobject.c:2602
#22 0x7fff80b74873 in PyObject_Call
(func=func@entry=0x7fff67f80be0, arg=arg@entry=0x7fff88151050,
kw=) at ../Objects/abstract.c:2529
#23 0x7fff80c1c247 in PyEval_CallObjectWithKeywords
(func=0x7fff67f80be0, arg=0x7fff88151050, kw=) at
../Python/ceval.c:3890
#24 0x7fff80622390 in sip_api_invoke_slot_ex () from
/usr/lib/python2.7/dist-packages/sip.so
#25 0x7fff8032ca92 in ?? () from
/usr/lib/python2.7/dist-packages/PyQt4/QtCore.so
#26 0x7fff8032cddd in ?? () from
/usr/lib/python2.7/dist-packages/PyQt4/QtCore.so
#27 0x7fff8032d98d in ?? () from
/usr/lib/python2.7/dist-packages/PyQt4/QtCore.so
#28 0x72863ffb in QMetaObject::activate(QObject*, QMetaObject
const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#29 0x71b9db22 in QAction::triggered(bool) () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
#30 0x71b9f6c7 in QAction::activate(QAction::ActionEvent) ()
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#31 0x71ff309d in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#32 0x71ff7a69 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#33 0x7fff7fae5fbb in ?? () from
/usr/lib/python2.7/dist-packages/PyQt4/QtGui.so
#34 0x71bf73b8 in 

Re: [Qgis-developer] QGIS crash during testing of my plugin

2014-10-14 Thread Salvatore Larosa
Hi Luca,

On Tue, Oct 14, 2014 at 11:40 AM, Luca Delucchi  wrote:
> On 14 October 2014 11:26, Salvatore Larosa  wrote:
>> Hi,
>>
>
> Hi Salvatore,
>
>> On Tue, Oct 14, 2014 at 11:15 AM, Luca Delucchi  wrote:
>>> Hi everybody,
>>>
>>> I'm developing a Python plugin with several submodules (like MMQGIS).
>>> I create a BaseDialog class to create each dialog and some functions
>>> to fill the dialogs.
>>> When I try to call the second method QGIS crash and it return this logs.
>>> Maybe I should create a ui file for each method and don't use the
>>> BaseDialog class to create my interfaces?
>>
>> could you attach the output of the py-bt command?
>
> How to use py-bt command?

just type py-bt [0] onto gdb prompt, you need of the python extension
for debugging though.

Regards,
-SL

[0] - https://docs.python.org/devguide/gdb.html

-- 
Salvatore Larosa
linkedIn: http://linkedin.com/in/larosasalvatore
twitter: @lrssvt
skype: s.larosa
IRC: lrssvt on freenode
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] QGIS crash during testing of my plugin

2014-10-14 Thread Luca Delucchi
On 14 October 2014 11:26, Salvatore Larosa  wrote:
> Hi,
>

Hi Salvatore,

> On Tue, Oct 14, 2014 at 11:15 AM, Luca Delucchi  wrote:
>> Hi everybody,
>>
>> I'm developing a Python plugin with several submodules (like MMQGIS).
>> I create a BaseDialog class to create each dialog and some functions
>> to fill the dialogs.
>> When I try to call the second method QGIS crash and it return this logs.
>> Maybe I should create a ui file for each method and don't use the
>> BaseDialog class to create my interfaces?
>
> could you attach the output of the py-bt command?

How to use py-bt command?

> Just for having some more information about the crash.

Here the output of gdb, I don't know if it helps

(gdb) run
Starting program: /usr/local/bin/qgis
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Warning: loading of qt translation failed [/usr/share/qt4/translations/qt_en_GB]
Warning: QGraphicsScene::addItem: item has already been added to this scene
[New Thread 0x7fffd2b97700 (LWP 29464)]
[New Thread 0x7fff92294700 (LWP 29465)]
[New Thread 0x7fff91540700 (LWP 29466)]
[New Thread 0x7fff6762f700 (LWP 29472)]
[Thread 0x7fff6762f700 (LWP 29472) exited]

Program received signal SIGSEGV, Segmentation fault.
0x7fff80330559 in ?? () from
/usr/lib/python2.7/dist-packages/PyQt4/QtCore.so
(gdb) continue
Continuing.
QGIS died on signal 11warning: process 29460 is already traced by process 29458
ptrace: Operation not permitted.
No thread selected
No stack.
gdb returned 0

Program received signal SIGABRT, Aborted.
0x7fffef17c077 in __GI_raise (sig=sig@entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) continue
Continuing.
[Thread 0x7fff91540700 (LWP 29466) exited]
[Thread 0x7fffd2b97700 (LWP 29464) exited]
[Thread 0x77f887c0 (LWP 29460) exited]

Program terminated with signal SIGABRT, Aborted.
The program no longer exists.


>
> Regards,
> -SL
>


-- 
ciao
Luca

http://gis.cri.fmach.it/delucchi/
www.lucadelu.org
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] QGIS crash during testing of my plugin

2014-10-14 Thread Salvatore Larosa
Hi,

On Tue, Oct 14, 2014 at 11:15 AM, Luca Delucchi  wrote:
> Hi everybody,
>
> I'm developing a Python plugin with several submodules (like MMQGIS).
> I create a BaseDialog class to create each dialog and some functions
> to fill the dialogs.
> When I try to call the second method QGIS crash and it return this logs.
> Maybe I should create a ui file for each method and don't use the
> BaseDialog class to create my interfaces?

could you attach the output of the py-bt command?
Just for having some more information about the crash.

Regards,
-SL

-- 
Salvatore Larosa
linkedIn: http://linkedin.com/in/larosasalvatore
twitter: @lrssvt
skype: s.larosa
IRC: lrssvt on freenode
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] QGIS crash during testing of my plugin

2014-10-14 Thread Luca Delucchi
Hi everybody,

I'm developing a Python plugin with several submodules (like MMQGIS).
I create a BaseDialog class to create each dialog and some functions
to fill the dialogs.
When I try to call the second method QGIS crash and it return this logs.
Maybe I should create a ui file for each method and don't use the
BaseDialog class to create my interfaces?

QGIS died on signal 11[New LWP 28114]
[New LWP 28102]
[New LWP 28101]
[New LWP 28100]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x7f3937de3109 in __libc_waitpid (pid=28116,
stat_loc=0x7fffe4e04d54, options=0) at
../sysdeps/unix/sysv/linux/waitpid.c:40
40  ../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
[Current thread is 1 (Thread 0x7f3940b6f7c0 (LWP 28099))]
#0  0x7f3937de3109 in __libc_waitpid (pid=28116,
stat_loc=0x7fffe4e04d54, options=0) at
../sysdeps/unix/sysv/linux/waitpid.c:40
resultvar = 139883782338496
oldtype = 0
#1  0x00571ac3 in qgisCrash(int) ()
No symbol table info available.
#2  
No locals.
#3  0x7f393b43a91e in QMetaObject::cast(QObject*) const () from
/usr/lib/x86_64-linux-gnu/libQtCore.so.4
No symbol table info available.
#4  0x7f393abc5e9c in QMdiArea::eventFilter(QObject*, QEvent*) ()
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#5  0x7f38c8630566 in ?? () from
/usr/lib/python2.7/dist-packages/PyQt4/QtGui.so
No symbol table info available.
#6  0x7f393b433d82 in
QCoreApplicationPrivate::sendThroughApplicationEventFilters(QObject*,
QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
No symbol table info available.
#7  0x7f393a7892a8 in QApplicationPrivate::notify_helper(QObject*,
QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#8  0x7f393a78fe18 in QApplication::notify(QObject*, QEvent*) ()
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#9  0x7f393ca67a37 in QgsApplication::notify(QObject*, QEvent*) ()
from /usr/local/lib/libqgis_core.so.2.5.0
No symbol table info available.
#10 0x7f393b433cad in QCoreApplication::notifyInternal(QObject*,
QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
No symbol table info available.
#11 0x7f393a78b547 in QApplicationPrivate::enterModal(QWidget*) ()
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#12 0x7f393a7d98c8 in QWidgetPrivate::show_helper() () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#13 0x7f393a7db74a in QWidget::setVisible(bool) () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#14 0x7f393ac5d4ae in QDialog::setVisible(bool) () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#15 0x7f393ac5d876 in QDialog::exec() () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#16 0x7f393c2cbe8b in QgsMessageViewer::showMessage(bool) () from
/usr/local/lib/libqgis_gui.so.2.5.0
No symbol table info available.
#17 0x7f38c3a3cd12 in meth_QgsMessageOutput_showMessage () from
/usr/lib/python2.7/dist-packages/qgis/_core.so
No symbol table info available.
#18 0x7f38c96aea8c in PyEval_EvalFrameEx () from
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
No symbol table info available.
#19 0x7f38c96aee9d in PyEval_EvalFrameEx () from
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
No symbol table info available.
#20 0x7f38c9721cf0 in PyEval_EvalCodeEx () from
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
No symbol table info available.
#21 0x7f38c9670e3c in ?? () from
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
No symbol table info available.
#22 0x7f38c9679873 in PyObject_Call () from
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
No symbol table info available.
#23 0x7f38c9721247 in PyEval_CallObjectWithKeywords () from
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
No symbol table info available.
#24 0x7f38c96c7dfc in PyErr_PrintEx () from
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
No symbol table info available.
#25 0x7f38c8e31e1d in ?? () from
/usr/lib/python2.7/dist-packages/PyQt4/QtCore.so
No symbol table info available.
#26 0x7f38c8e3298d in ?? () from
/usr/lib/python2.7/dist-packages/PyQt4/QtCore.so
No symbol table info available.
#27 0x7f393b448ffb in QMetaObject::activate(QObject*, QMetaObject
const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
No symbol table info available.
#28 0x7f393a782b22 in QAction::triggered(bool) () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#29 0x7f393a7846c7 in QAction::activate(QAction::ActionEvent) ()
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#30 0x7f393abd809d in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#31 0x7f393abdca69 in ?? () from /usr/lib