Building Qt apps with PyInstaller

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Building Qt apps with PyInstaller

Andraz Vrhovec
Hello, has anybody manage to build app using Qt (PySide preferably, or PyQt) that run also on machines different from build? I am getting segfaults when I try to run it on another machines.

Code is simple hello world example from documentation of PySide and PyQt. I have attached "strace -f" output and sources. Below is gdb output:

===============================================
gdb pyqt-test/dist/pyqt/pyqt
(gdb) set follow-fork-mode child
(gdb) run
...
Program received signal SIGSEGV, Segmentation fault.
[Switching to process 7727]
0x00007ffff7df2b68 in ?? () from /lib64/ld-linux-x86-64.so.2
(gdb) where
#0  0x00007ffff7df2b68 in ?? () from /lib64/ld-linux-x86-64.so.2
#1  0x9142a1d45027df64 in ?? ()
Cannot access memory at address 0x21c021d46fd824f0
================================================
gdb pyside-test/dist/pyside/pyside
(gdb) set follow-fork-mode child
(gdb) run
...
Program received signal SIGSEGV, Segmentation fault.
[Switching to process 7709]
0x00007ffff7df2b68 in ?? () from /lib64/ld-linux-x86-64.so.2
(gdb) where
#0  0x00007ffff7df2b68 in ?? () from /lib64/ld-linux-x86-64.so.2
#1  0x1f8d291dc7c05415 in ?? ()
Cannot access memory at address 0xe0bd291df83faf8f

Build machine is Ubuntu 12.04 amd64 and segfaults occur on Ubuntu 13.04 amd64. It seems to me as Qt issue, as simple scripts (print "Hello") works just fine (so bootloader is ok i guess). Also scripts using pygtk run, but have other issues (no fonts). Has anyone ever had a successful build of Qt application that run on other machine than build?

Qt info:
./libQtCore.so.4
This is the QtCore library version 4.8.1
Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
Contact: Nokia Corporation ([hidden email])

Build key:           x86_64 linux g++-4 full-config
Compat build key:    | x86_64 Linux g++-4 full-config |
Build date:          2013-02-06
Installation prefix: /usr
Library path:        /usr/lib/x86_64-linux-gnu
Include path:        /usr/include/qt4
Processor features:  mmx sse sse2 cmov sse3 ssse3 sse4.1 sse4.2 avx

Most of the other .so file in dist directory give segfault, is that expected?


--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/groups/opt_out.

pyqt.strace.txt (355K) Download Attachment
pyqt.py (508 bytes) Download Attachment
pyside.py (310 bytes) Download Attachment
pyside.strace.txt (358K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Building Qt apps with PyInstaller

Raoul Snyman

My open source project, OpenLP, is written in PyQt4 and uses PyInstaller on windows and Mac OS X.

http://launchpad.net/openlp

Check out our packaging repository.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Building Qt apps with PyInstaller

Andraz Vrhovec
Thanks, but pyinstaller on Windows and OSX works just fine for me right now. Only issue seems to be Linux :(

On Friday, October 4, 2013 1:05:12 PM UTC+2, Raoul Snyman wrote:

My open source project, OpenLP, is written in PyQt4 and uses PyInstaller on windows and Mac OS X.

http://launchpad.net/openlp

Check out our packaging repository.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Building Qt apps with PyInstaller

Andraz Vrhovec
In reply to this post by Andraz Vrhovec
I installed libc6-dbg so, maybe this is a bit better gdb output for pyside example:

(gdb) where
#0  __longjmp () at ../sysdeps/x86_64/__longjmp.S:67
#1  0x3cb785a95cf65540 in ?? ()
Cannot access memory at address 0xb0385a95cf656ba


On Friday, October 4, 2013 12:15:45 PM UTC+2, Andraz Vrhovec wrote:
Hello, has anybody manage to build app using Qt (PySide preferably, or PyQt) that run also on machines different from build? I am getting segfaults when I try to run it on another machines.

Code is simple hello world example from documentation of PySide and PyQt. I have attached "strace -f" output and sources. Below is gdb output:

===============================================
gdb pyqt-test/dist/pyqt/pyqt
(gdb) set follow-fork-mode child
(gdb) run
...
Program received signal SIGSEGV, Segmentation fault.
[Switching to process 7727]
0x00007ffff7df2b68 in ?? () from /lib64/ld-linux-x86-64.so.2
(gdb) where
#0  0x00007ffff7df2b68 in ?? () from /lib64/ld-linux-x86-64.so.2
#1  0x9142a1d45027df64 in ?? ()
Cannot access memory at address 0x21c021d46fd824f0
================================================
gdb pyside-test/dist/pyside/pyside
(gdb) set follow-fork-mode child
(gdb) run
...
Program received signal SIGSEGV, Segmentation fault.
[Switching to process 7709]
0x00007ffff7df2b68 in ?? () from /lib64/ld-linux-x86-64.so.2
(gdb) where
#0  0x00007ffff7df2b68 in ?? () from /lib64/ld-linux-x86-64.so.2
#1  0x1f8d291dc7c05415 in ?? ()
Cannot access memory at address 0xe0bd291df83faf8f

Build machine is Ubuntu 12.04 amd64 and segfaults occur on Ubuntu 13.04 amd64. It seems to me as Qt issue, as simple scripts (print "Hello") works just fine (so bootloader is ok i guess). Also scripts using pygtk run, but have other issues (no fonts). Has anyone ever had a successful build of Qt application that run on other machine than build?

Qt info:
./libQtCore.so.4
This is the QtCore library version 4.8.1
Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
Contact: Nokia Corporation ([hidden email])

Build key:           x86_64 linux g++-4 full-config
Compat build key:    | x86_64 Linux g++-4 full-config |
Build date:          2013-02-06
Installation prefix: /usr
Library path:        /usr/lib/x86_64-linux-gnu
Include path:        /usr/include/qt4
Processor features:  mmx sse sse2 cmov sse3 ssse3 sse4.1 sse4.2 avx

Most of the other .so file in dist directory give segfault, is that expected?


--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Building Qt apps with PyInstaller

Nathan Weston
In reply to this post by Andraz Vrhovec
I have a PyQt (not PySide) application that I build on RedHat, which
runs across a range of other Linux systems. I'm using PyInstaller 2.0.

One thing I've found is that, on Linux, PyInstaller will pull in a bunch
of system libraries, and you're often better off skipping these and
using whatever version is installed on the target machine. I don't
remember this leading to any segfaults for us, but we did see a lot of
strange behaviors so it might be worth a try.

The libraries we're excluding right now are:  libfontconfig.so,
libglib-2.0.so, libX11.so, libXext.so, libXau.so, libXdmcp.so,
libexpat.so, libXrender.so, libSM.so, libICE.so, libbz2.so, libz.so,
libgthread-2.0.so, libcom_err.so, libgssapi_krb5.so, libkrb5.so,
libk5crypto.so, libfreetype.so, libpng12.so, libssl.so, libcrypto.so,
libgobject-2.0.so, libdrm.so

But that might vary depending on your build configuration. You can test
this by manually deleting libraries after running PyInstaller. If that
helps, then go back and adjust your build to exclude those libraries.

On 10/04/2013 06:15 AM, Andraz Vrhovec wrote:

> Hello, has anybody manage to build app using Qt (PySide preferably, or
> PyQt) that run also on machines different from build? I am getting
> segfaults when I try to run it on another machines.
>
> Code is simple hello world example from documentation of PySide and
> PyQt. I have attached "strace -f" output and sources. Below is gdb output:
>
> ===============================================
> gdb pyqt-test/dist/pyqt/pyqt
> (gdb) set follow-fork-mode child
> (gdb) run
> ...
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to process 7727]
> 0x00007ffff7df2b68 in ?? () from /lib64/ld-linux-x86-64.so.2
> (gdb) where
> #0  0x00007ffff7df2b68 in ?? () from /lib64/ld-linux-x86-64.so.2
> #1  0x9142a1d45027df64 in ?? ()
> Cannot access memory at address 0x21c021d46fd824f0
> ================================================
> gdb pyside-test/dist/pyside/pyside
> (gdb) set follow-fork-mode child
> (gdb) run
> ...
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to process 7709]
> 0x00007ffff7df2b68 in ?? () from /lib64/ld-linux-x86-64.so.2
> (gdb) where
> #0  0x00007ffff7df2b68 in ?? () from /lib64/ld-linux-x86-64.so.2
> #1  0x1f8d291dc7c05415 in ?? ()
> Cannot access memory at address 0xe0bd291df83faf8f
>
> Build machine is Ubuntu 12.04 amd64 and segfaults occur on Ubuntu 13.04
> amd64. It seems to me as Qt issue, as simple scripts (print "Hello")
> works just fine (so bootloader is ok i guess). Also scripts using pygtk
> run, but have other issues (no fonts). Has anyone ever had a successful
> build of Qt application that run on other machine than build?
>
> Qt info:
> ./libQtCore.so.4
> This is the QtCore library version 4.8.1
> Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
> Contact: Nokia Corporation ([hidden email])
>
> Build key:           x86_64 linux g++-4 full-config
> Compat build key:    | x86_64 Linux g++-4 full-config |
> Build date:          2013-02-06
> Installation prefix: /usr
> Library path:        /usr/lib/x86_64-linux-gnu
> Include path:        /usr/include/qt4
> Processor features:  mmx sse sse2 cmov sse3 ssse3 sse4.1 sse4.2 avx
>
> Most of the other .so file in dist directory give segfault, is that
> expected?
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [hidden email].
> To post to this group, send email to [hidden email].
> Visit this group at http://groups.google.com/group/pyinstaller.
> For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Building Qt apps with PyInstaller

Andraz Vrhovec
Thanks!

I removed libg* stuff (glib, gobject) and segfault is gone.

That reduced the problem to:
Cannot mix incompatible Qt library (version 0x40804) with this library (version 0x40801)

I guess it still somehow manage to find system qt (4.8.4) even if there is libQtCore and libQtGui version 4.8.1 bundled (from build machine).

On Friday, October 4, 2013 3:20:58 PM UTC+2, Nathan Weston wrote:
I have a PyQt (not PySide) application that I build on RedHat, which
runs across a range of other Linux systems. I'm using PyInstaller 2.0.

One thing I've found is that, on Linux, PyInstaller will pull in a bunch
of system libraries, and you're often better off skipping these and
using whatever version is installed on the target machine. I don't
remember this leading to any segfaults for us, but we did see a lot of
strange behaviors so it might be worth a try.

The libraries we're excluding right now are:  libfontconfig.so,
libglib-2.0.so, libX11.so, libXext.so, libXau.so, libXdmcp.so,
libexpat.so, libXrender.so, libSM.so, libICE.so, libbz2.so, libz.so,
libgthread-2.0.so, libcom_err.so, libgssapi_krb5.so, libkrb5.so,
libk5crypto.so, libfreetype.so, libpng12.so, libssl.so, libcrypto.so,
libgobject-2.0.so, libdrm.so

But that might vary depending on your build configuration. You can test
this by manually deleting libraries after running PyInstaller. If that
helps, then go back and adjust your build to exclude those libraries.

On 10/04/2013 06:15 AM, Andraz Vrhovec wrote:

> Hello, has anybody manage to build app using Qt (PySide preferably, or
> PyQt) that run also on machines different from build? I am getting
> segfaults when I try to run it on another machines.
>
> Code is simple hello world example from documentation of PySide and
> PyQt. I have attached "strace -f" output and sources. Below is gdb output:
>
> ===============================================
> gdb pyqt-test/dist/pyqt/pyqt
> (gdb) set follow-fork-mode child
> (gdb) run
> ...
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to process 7727]
> 0x00007ffff7df2b68 in ?? () from /lib64/ld-linux-x86-64.so.2
> (gdb) where
> #0  0x00007ffff7df2b68 in ?? () from /lib64/ld-linux-x86-64.so.2
> #1  0x9142a1d45027df64 in ?? ()
> Cannot access memory at address 0x21c021d46fd824f0
> ================================================
> gdb pyside-test/dist/pyside/pyside
> (gdb) set follow-fork-mode child
> (gdb) run
> ...
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to process 7709]
> 0x00007ffff7df2b68 in ?? () from /lib64/ld-linux-x86-64.so.2
> (gdb) where
> #0  0x00007ffff7df2b68 in ?? () from /lib64/ld-linux-x86-64.so.2
> #1  0x1f8d291dc7c05415 in ?? ()
> Cannot access memory at address 0xe0bd291df83faf8f
>
> Build machine is Ubuntu 12.04 amd64 and segfaults occur on Ubuntu 13.04
> amd64. It seems to me as Qt issue, as simple scripts (print "Hello")
> works just fine (so bootloader is ok i guess). Also scripts using pygtk
> run, but have other issues (no fonts). Has anyone ever had a successful
> build of Qt application that run on other machine than build?
>
> Qt info:
> ./libQtCore.so.4
> This is the QtCore library version 4.8.1
> Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
> Contact: Nokia Corporation (<a href="javascript:" target="_blank" gdf-obfuscated-mailto="L5o5cGIWrUcJ">qt-...@...)
>
> Build key:           x86_64 linux g++-4 full-config
> Compat build key:    | x86_64 Linux g++-4 full-config |
> Build date:          2013-02-06
> Installation prefix: /usr
> Library path:        /usr/lib/x86_64-linux-gnu
> Include path:        /usr/include/qt4
> Processor features:  mmx sse sse2 cmov sse3 ssse3 sse4.1 sse4.2 avx
>
> Most of the other .so file in dist directory give segfault, is that
> expected?
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="L5o5cGIWrUcJ">pyinstaller...@googlegroups.com.
> To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="L5o5cGIWrUcJ">pyins...@....
> Visit this group at http://groups.google.com/group/pyinstaller.
> For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Building Qt apps with PyInstaller

Martin Zibricky

On Friday 04 of October 2013 07:19:35 Andraz Vrhovec wrote:

I guess it still somehow manage to find system qt (4.8.4) even if there isĀ  libQtCore and libQtGui version 4.8.1 bundled (from build machine).

 

I gues this is because qt4 plugins are not handled by pyside import hooks and thus pyside loads qt4 plugins from the OS and those plugins are linked with qt 4.8.4.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Building Qt apps with PyInstaller

Martin Zibricky
In reply to this post by Andraz Vrhovec

On Friday 04 of October 2013 07:19:35 Andraz Vrhovec wrote:

Thanks! I removed libg* stuff (glib, gobject) and segfault is gone.



There should be a general discussion if pyinstaller should ignore some libg* objects in file

 

PyInstaller/depend/dylib.py

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Building Qt apps with PyInstaller

Andraz Vrhovec
In reply to this post by Martin Zibricky
Actually it was missing libQtDBus. I am not sure if this goes plugins category, but ldd somehow missed it. Still figuring out why.

So summary how I fixed it:

1) remove lib*.so files as nathan suggested (mainly glib and gobject)
2) copy libQtDBus.so.4 from build system into dist directory (this was causing qt version mismatch)


On Friday, October 4, 2013 5:13:37 PM UTC+2, Martin Z wrote:

On Friday 04 of October 2013 07:19:35 Andraz Vrhovec wrote:

I guess it still somehow manage to find system qt (4.8.4) even if there is  libQtCore and libQtGui version 4.8.1 bundled (from build machine).

 

I gues this is because qt4 plugins are not handled by pyside import hooks and thus pyside loads qt4 plugins from the OS and those plugins are linked with qt 4.8.4.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/groups/opt_out.