maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   D-Bus error: Not enough memory?? Weird compiling python error. (https://talk.maemo.org/showthread.php?t=37423)

HangLoose 2009-12-16 15:22

D-Bus error: Not enough memory?? Weird compiling python error.
 
I am following this tutorial:
http://wiki.maemo.org/PyMaemo/UsingPythonInMaemo

When I try to compile this code:
Code:

#!/usr/bin/env python2.5
import gtk
import hildon
 
class HelloWorldApp(hildon.Program):
  def __init__(self):
    hildon.Program.__init__(self)
 
    self.window = hildon.Window()
    self.window.connect("destroy", gtk.main_quit)
    self.add_window(self.window)
 
    label = gtk.Label("Hello World!")
    self.window.add(label)
    label.show()
 
  def run(self):
    self.window.show_all()
    gtk.main()
 
app = HelloWorldApp()
app.run()

I get the following error:
Quote:

[sbox-FREMANTLE_X86: /usr/lib/hildon-desktop] > python2.5 hello_world_home.py
process 28672: arguments to dbus_connection_get_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5757.
This is normally a bug in some application using the D-Bus library.
process 28672: arguments to dbus_connection_set_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5721.
This is normally a bug in some application using the D-Bus library.
python2.5[28672]: GLIB ERROR ** default - Not enough memory to set up DBusConnection for use with GLib
aborting...
Aborted (core dumped)
Any idea what that means?

bodell 2009-12-16 15:51

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Try putting a "run-standalone.sh" before python2.5 in your command line.

I would recommend against that tutorial, it is out of date. Start here: http://wiki.maemo.org/PyMaemo
Then go here: http://wiki.maemo.org/PyMaemo/UITutorial

krk969 2010-01-03 14:28

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
I did the above and also ran the below commands as per the wiki in my ARMEL target

X86: ~] > eval $(dbus-launch --sh-syntax)
X86: ~] > export BUS_SESSION_BUS_ADDRESS
X86: ~] > export DBUS_SESSION_BUS_PID

corrected a typo in the wiki
export BUS_SESSION_BUS_ADDRESS
should be
export DBUS_SESSION_BUS_ADDRESS
I think.

Anyways I still get this error

could you help ?

[sbox-FREMANTLE_ARMEL: ~] > run-standalone.sh python2.5 py.py
process 24390: arguments to dbus_connection_get_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5757.
This is normally a bug in some application using the D-Bus library.
process 24390: arguments to dbus_connection_set_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5721.
This is normally a bug in some application using the D-Bus library.
python2.5[24390]: GLIB ERROR ** default - Not enough memory to set up DBusConnection for use with GLib
aborting...
qemu: uncaught target signal 6 (Aborted) - core dumped
[sbox-FREMANTLE_ARMEL: ~] > cat py.py
import gtk
import hildon
[sbox-FREMANTLE_ARMEL: ~] >

qwerty12 2010-01-03 14:38

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Maybe this'll work, I don't know:

Switch to the X86 target, fire up Xephyr as per the Wiki instructions, run af-sb-init.sh start, don't start up D-Bus manually, and, finally, run-standalone.sh python2.5 py.py

krk969 2010-01-03 15:02

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Quote:

Originally Posted by qwerty12 (Post 451185)
Maybe this'll work, I don't know:

Switch to the X86 target, fire up Xephyr as per the Wiki instructions, run af-sb-init.sh start, don't start up D-Bus manually, and, finally, run-standalone.sh python2.5 py.py

thanks qwerty12, but the hildon python bindings seem to be available for ARM only as of now.

In anycase, does that mean I cannot use hildon bindings in python on the ARMEL target ?

thp 2010-01-03 15:22

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Quote:

Originally Posted by krk969 (Post 451220)
thanks qwerty12, but the hildon python bindings seem to be available for ARM only as of now.

In anycase, does that mean I cannot use hildon bindings in python on the ARMEL target ?

The hildon python bindings are available for X86 as well, you just have to install them separately for the X86 "target" (btw, you have to do this for all packages that you need in both targets). A "fakeroot apt-get install python2.5-hildon" in the X86 target should do the trick.

krk969 2010-01-03 15:37

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Quote:

Originally Posted by thp (Post 451234)
The hildon python bindings are available for X86 as well, you just have to install them separately for the X86 "target" (btw, you have to do this for all packages that you need in both targets). A "fakeroot apt-get install python2.5-hildon" in the X86 target should do the trick.

Thanks thp.

I tried that in the X86 target , but hadnt worked coz maybe the repositories werent there in my apt/source.list.

But it had worked for ARMEL target and I could download with the same list of repositories.

this is my /etc/apt/sources.list

deb http://repository.maemo.org/ fremantle/sdk free non-free
deb-src http://repository.maemo.org/ fremantle/sdk free
deb http://repository.maemo.org/ fremantle/tools free non-free
deb-src http://repository.maemo.org/ fremantle/tools free


But my main intention is to develop for ARMEL and I keep getting the above error.

EDIT::
added the extras-devel repository to get this result

[sbox-FREMANTLE_X86: ~] > fakeroot apt-cache search python2.5-hildon
python-hildon - Python bindings for Hildon Framework.
python-hildondesktop - Python bindings for libhildondesktop

krk969 2010-01-03 15:49

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
same error in X86 target also

[sbox-FREMANTLE_X86: ~] > run-standalone.sh ./py.py
process 27248: arguments to dbus_connection_get_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5757.
This is normally a bug in some application using the D-Bus library.
process 27248: arguments to dbus_connection_set_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5721.
This is normally a bug in some application using the D-Bus library.
python2.5[27248]: GLIB ERROR ** default - Not enough memory to set up DBusConnection for use with GLib
aborting...
/usr/bin/run-standalone.sh: line 11: 27248 Aborted (core dumped) "$@"

thp 2010-01-03 15:52

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Yes, install "python-hildon" then.. my fault (it was called python2.5-hildon some time ago). As Python is a scripting language, and you don't compile python scripts in the traditional sense (the Python interpreter does compile the source file into Python bytecode - *.pyc and *.pyo files - but these are platform-independent).

I'm also developing Python applications for the N900, and do all my testing in the SDK with the X86 target. I also do lots of testing directly on-device, as I just need to rsync my source tree to the device and test it using SSH or the X Terminal - no compiling needed :)

In short: Unless you are writing Python C extension modules, you should not need to care about the ARMEL target, and the X86 target will give you less headache. Do a "fakeroot apt-get install python-hildon" in Scratchbox, and don't forget to always call Python with "python2.5", as "python" will most likely use the Scratchbox-provided python 2.3.

thp 2010-01-03 15:54

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Quote:

Originally Posted by krk969 (Post 451279)
same error in X86 target also

[sbox-FREMANTLE_X86: ~] > run-standalone.sh ./py.py
process 27248: arguments to dbus_connection_get_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5757.

You have started Xephyr, did an "export DISPLAY=:2" and ran "af-sb-init.sh start" and after that (in the same session) did the "run-standalone.sh python2.5 py.py"? Maybe your installation is simply broken. You can try copying the file to your device and trying it out there (you might need to install the necessary packages on the device or simply install an app that drags in the required dependencies).


All times are GMT. The time now is 04:21.

vBulletin® Version 3.8.8