[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Basic QML test seg faults in PyQT but not QT on Linux
From:       Louis Simons <lousimons () gmail ! com>
Date:       2016-09-20 23:17:56
Message-ID: CAJG7t==g83uFCcHxiAnzXEaFbMEonZXKChcNmnKDMJmR-f68rw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Additionally, my seg. fault seems to be tied both to PyQT (as opposed to
the C++ API) and the graphics drivers (for an NVIDIA GeForce GTS 250).  I
tried switching to Linux Mint's xserver-xorg-video-nouveau driver, and
while that didn't work and fell back to software rendering, the application
worked in both PyQT and C++.  When I switched back to the recommended
driver, nvidia-340 (340.96-0ubuntu3), the seg. fault in the PyQT version
came back.

Is there a way to figure out exactly what differs between the C++ and PyQT
versions using GDB?

Thanks,
Louis

On Sat, Sep 17, 2016 at 5:04 PM Louis Simons <lousimons@gmail.com> wrote:

> On 17 Sep 2016, at 2:39 am, Louis Simons <lousimons@gmail.com> wrote:
>> >
>> >
>> > Ok.  I'm hoping someone on Linux will chime in for confirmation.  This
>> seg. fault doesn't make sense as there's definitely people using QML in
>> PyQT in recent versions.  Is there anyway to identify the source of the
>> seg. fault?
>> >
>> > I added the backtrace to
>> http://stackoverflow.com/questions/39381009/simple-pyqt5-qml-application-causes-segmentation-fault.
>> It all seems to be a result of __strstr_sse2 receiveing a null pointer from
>> haystack_start.  While this seems like a graphics driver bug (
>> https://bugs.kde.org/show_bug.cgi?id=348812), it works in the C++
>> version, so is it possible there's a problem in a PyQT binding?
>>
>> Unlikely.
>>
>
> I agree it's unlikely, but if the exact same C++ program works without a
> seg. fault, and the PyQT version crashes, what else could it be?  The C++
> is the following:
>
>     #include <QGuiApplication>
>     #include <QQmlApplicationEngine>
>
>     int main(int argc, char *argv[]) {
>         QGuiApplication app(argc, argv);
>         QQmlApplicationEngine engine;
>         engine.load(QUrl(QStringLiteral("simple.qml")));
>         return app.exec();
>     }
>
> The Python is the following:
>
>     from sys import argv, exit
>     from PyQt5.QtGui import QGuiApplication
>     from PyQt5.QtQml import QQmlApplicationEngine
>
>     def main():
>         app = QGuiApplication(argv)
>         engine = QQmlApplicationEngine()
>         engine.load('simple.qml')
>         exit(app.exec_())
>
>     if __name__ == '__main__':
>         main()
>
> Thanks,
> Louis
>

[Attachment #5 (text/html)]

<div dir="ltr">Additionally, my seg. fault seems to be tied both to PyQT (as opposed \
to the C++ API) and the graphics drivers (for an NVIDIA GeForce GTS 250).   I tried \
switching to Linux Mint&#39;s xserver-xorg-video-nouveau driver, and while that \
didn&#39;t work and fell back to software rendering, the application worked in both \
PyQT and C++.   When I switched back to the recommended driver, nvidia-340 \
(340.96-0ubuntu3), the seg. fault in the PyQT version came \
back.<div><br></div><div>Is there a way to figure out exactly what differs between \
the C++ and PyQT versions using \
GDB?</div><div><br></div><div>Thanks,</div><div>Louis<br><br><div \
class="gmail_quote"><div dir="ltr">On Sat, Sep 17, 2016 at 5:04 PM Louis Simons \
&lt;<a href="mailto:lousimons@gmail.com">lousimons@gmail.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div \
class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">On 17 Sep 2016, at 2:39 am, Louis \
Simons &lt;<a href="mailto:lousimons@gmail.com" \
target="_blank">lousimons@gmail.com</a>&gt; wrote:<br> &gt;<br>
&gt;<br>
&gt; Ok.   I&#39;m hoping someone on Linux will chime in for confirmation.   This \
seg. fault doesn&#39;t make sense as there&#39;s definitely people using QML in PyQT \
in recent versions.   Is there anyway to identify the source of the seg. fault?<br> \
&gt;<br> &gt; I added the backtrace to <a \
href="http://stackoverflow.com/questions/39381009/simple-pyqt5-qml-application-causes-segmentation-fault" \
rel="noreferrer" target="_blank">http://stackoverflow.com/questions/39381009/simple-pyqt5-qml-application-causes-segmentation-fault</a>. \
It all seems to be a result of __strstr_sse2 receiveing a null pointer from \
haystack_start.   While this seems like a graphics driver bug (<a \
href="https://bugs.kde.org/show_bug.cgi?id=348812" rel="noreferrer" \
target="_blank">https://bugs.kde.org/show_bug.cgi?id=348812</a>), it works in the C++ \
version, so is it possible there&#39;s a problem in a PyQT binding?<br> <br>
Unlikely.<br></blockquote><div><br></div></div></div><div dir="ltr"><div \
class="gmail_quote"><div>I agree it&#39;s unlikely, but if the exact same C++ program \
works without a seg. fault, and the PyQT version crashes, what else could it be?   \
The C++ is the following:</div><div><br></div><div><div>     <span>  </span>#include \
&lt;QGuiApplication&gt;</div><div>     <span>  </span>#include \
&lt;QQmlApplicationEngine&gt;</div><div>     <span>  </span><br></div><div>     \
<span>  </span>int main(int argc, char *argv[]) {</div><div>     <span>  </span>      \
QGuiApplication app(argc, argv);</div><div>     <span>  </span>      \
QQmlApplicationEngine engine;</div><div>           <span>  \
</span>engine.load(QUrl(QStringLiteral(&quot;simple.qml&quot;)));</div><div>     \
<span>  </span>      return app.exec();</div><div>      \
}</div></div><div><br></div><div>The Python is the \
following:</div><div><br></div><div><div>      from sys import argv, exit</div><div>  \
<span>  </span>from PyQt5.QtGui import QGuiApplication</div><div>     <span>  \
</span>from PyQt5.QtQml import QQmlApplicationEngine</div><div>     <span>  \
</span><br></div><div>     <span>  </span>def main():</div><div>     <span>  </span>  \
app = QGuiApplication(argv)</div><div>     <span>  </span>      engine = \
QQmlApplicationEngine()</div><div>     <span>  </span>      \
engine.load(&#39;simple.qml&#39;)</div><div>     <span>  </span>      \
exit(app.exec_())</div><div>     <span>  </span><br></div><div>     <span>  </span>if \
__name__ == &#39;__main__&#39;:</div><div>           <span>  \
</span>main()</div></div><div><br></div><div>Thanks,<br></div><div>Louis</div></div></div></blockquote></div></div></div>



[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic