[BlackBerry-Python] PySide for BB10

Martin Kolman martin.kolman at gmail.com
Wed Jan 9 09:21:24 EST 2013


Hi !
I'm working on porting PySide to BB10. My work is mostly based on the 
excellent PySide-for-Playbook tutorial from the BBPy project.

Where is it documented ?
http://modrana.org/trac/wiki/BB10
Please let me know about possible corrections or more information to add! :)

What's working:
* compiling Qt, Shiboken & PySide using the BB10 NDK
* compiling Shiboken & PySide against the on-device Qt libs
* packaging
* installing to device

What isn't:
* the example application segfaults when started

More info about the segfault
After the application package is installed on the device & the icon is 
clicked a black window briefly shows up and vanishes.
The log in /accounts/1000/appdata/<appname>/logs/log has a this single line:

Process 30396593 (python3.2) terminated SIGSEGV code=1 fltno=11 
ip=783abf7c(/base/lib/libcpp.so.4 at _ZNKSt6locale9_GetfacetEj+0x27) 
mapaddr=0002bf7c. ref=00000010

The error is still the same, regardless if the Qt libs are custom 
compiled & bundled or on-device Qt libs are used.

I've also found two Python core dumps in the logs folder, they are 
available for download from this folder:
http://modrana.org/platforms/bb10/coredumps/

The same error can be also reproduced when just importing the bbpy 
module from the commandline:
1. download one of the example package contents:
http://modrana.org/platforms/bb10/examples/with_qt_4.8.1.zip
or
http://modrana.org/platforms/bb10/examples/using_on_device_qt.zip
2. unpack it and move the blackberry-py folder to your BB10 device
3. ssh to your BB10 device, cd the the blackberry-py folder
4. run: python3.2
5. run: import bbpy
6. Python should segfault with the above mentioned error.

The segfault is caused by importing the PySide submodules. If all 
PySide.* imports are commented out, it doesn't segfault.

Possible ideas what might be causing this:

Commented-out CMake tests
I've commented-out some CMake tests to make Shiboken build, see 
"Building Shiboken" here:
http://modrana.org/trac/wiki/BB10#PySide

BB10 doesn't like loading additional libraries using LD_LIBRARY_PATH
This is just a guess, but maybe it kills the app when it tries to load a 
library from its own data folder. The segfault might be the result of 
system killing the app.

bad Qt build
Not probably, as I get the same error when compiling against the 
on-device Qt libs.

bad PySide/Shiboken build
More probable - as even if using the on-device Qt build, Shiboken/PySide 
is what is handling the import.

bad Python interpreter
Maybe the Python 3.2 interpreter on the device is bad and can't handle 
the PySide import ?

So thats it - I've kinda run out of ideas what to try to get it working.

Any help will be much appreciated! :)


With kind regards

Martin Kolman


More information about the BlackBerry-Python mailing list