ChatCrawlersearch across public Telegram Open the app
Q

Qt for Python (PySide/Shiboken)

23 February 2022
2022-02-23×
23 February 2022
I
Hi, I am investigating some segmentation fault with my PySide6 project . I suspect I do bad work with memory managements. For instance, when creating a Layout in a QWidget constrictor. Do I need to use "self" or "not" ? Do all my widgets need a parent ? Or None is enough ?
F
Also the Python "faulthandler" module or gdb might help
I am actually hunting a ghost ! I get a segmentation fault when I close the Mainwindow... Only , If I have show before a Dialog
@thecompiler I finally found the reason after many step by step... Now I m trying to see if faulthandler can help me :
This was the reason : self.tag_choice_action = QWidgetAction(self.tag_choice) self.tag_choice_action.setDefaultWidget(self.tag_choice)
I guess Qt try to delete twice , because the QWidgetAction has the wrong parent
unfortunally, PythonFaultHandler doesn't seem to return any info : Fatal Python error: Segmentation fault Current thread 0x00007fa47d1ec740 (most recent call first): <no Python frame> [1] 47071 segmentation fault (core dumped) PYTHONFAULTHANDLER=1 python -m cutevariant
I
Do I m using it correctly ?
F
I think so, but it'll only help you if the crash happens from Python code, not inside C++
Dridk maybe you can get a python interpreter with debug symbols, and build pyside only the modules you are using, so it's faster, and install it on a virtual env, then you can do a gdb --args python your_code.py and wait for a nice stacktrace pointing to the function causing the crash
it's a small code, you can send it here using pastebin or any other server, and I can give it a spin tomorrow
Calendar: February 2022
Archive by month
Open in Telegram Каталог площадок Искать в ChatCrawler

A snapshot of an open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · What we do not do · Remove a page · Catalog