Hi there. As a followup of my previous message (problem using dbus rpc call with argument in python) i decided to give rpc_async_run a try instead of rpc_run.
Now, not only it 'does not work', but pyhton2.5 segfault as well. I guess i did something wrong like not having an osso context properly set or something like this, but i also feel it should be up to libosso or python-osso to check the argument it use ar ok, shouldnt it ? I have attached a test cased based on : http://maemo.org/platform/docs/python-bora/python_maemo_howto.html#Introduction+to+LibOSSO I also try to catch a backtrace, with 'gdb /usr/bin/python2.5 core' , but i m not that familiar with gdb, nor do i know where to get the python-osso debug symbols. Anyway, the begining of the backtrace looks like this: #0 0xb72d068c in _python_to_rpc_t () from /usr/lib/python2.5/site-packages/osso/rpc.so #1 0xb72cfc61 in Context_rpc_run_with_defaults () from /usr/lib/python2.5/site-packages/osso/rpc.so #2 0xb79f09b9 in osso_rpc_run () from /usr/lib/libosso.so.1 Am i wrong in thinking there is something wrong in python-osso ? I use python2.5-osso 0.2-1osso1. _python_to_rpc_t is defined in python-osso/src/osso-helper.c, but this is where i m stuck at, not understanding what may be wrong there (i guess one of the 2 argument being sent has not the right type or size or something, but that s about it). Any help would be appreciated. Pierre Amadio
Core was generated by `/usr/bin/python2.5 ./sender.py'. Program terminated with signal 11, Segmentation fault. #0 0xb72d068c in _python_to_rpc_t () from /usr/lib/python2.5/site-packages/osso/rpc.so (gdb) bt #0 0xb72d068c in _python_to_rpc_t () from /usr/lib/python2.5/site-packages/osso/rpc.so #1 0xb72cfc61 in Context_rpc_run_with_defaults () from /usr/lib/python2.5/site-packages/osso/rpc.so #2 0xb79f09b9 in osso_rpc_run () from /usr/lib/libosso.so.1 #3 0xb79b8c3f in dbus_pending_call_get_data () from /usr/lib/libdbus-1.so.2 #4 0xb79a74d9 in dbus_connection_has_messages_to_send () from /usr/lib/libdbus-1.so.2 #5 0xb79a9bf8 in dbus_connection_dispatch () from /usr/lib/libdbus-1.so.2 #6 0xb75d6f2d in dbus_g_message_get_message () from /usr/lib/libdbus-glib-1.so.2 #7 0xb79408e7 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 #8 0xb7942285 in g_main_context_acquire () from /usr/lib/libglib-2.0.so.0 #9 0xb79425aa in g_main_loop_run () from /usr/lib/libglib-2.0.so.0 #10 0xb774bb23 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0 #11 0xb6f32d8b in init_gtkimpl () from /usr/lib/python2.5/site-packages/gtk-2.0/gtk/_gtkimpl.so #12 0xb7e973c8 in PyEval_EvalFrameEx () from /usr/lib/libpython2.5.so.1.0 #13 0xb7e98c40 in PyEval_EvalCodeEx () from /usr/lib/libpython2.5.so.1.0 #14 0xb7e98c9b in PyEval_EvalCode () from /usr/lib/libpython2.5.so.1.0 #15 0xb7eabfe0 in PyErr_Display () from /usr/lib/libpython2.5.so.1.0 #16 0xb7eac4be in PyRun_FileExFlags () from /usr/lib/libpython2.5.so.1.0 #17 0xb7eacec7 in PyRun_SimpleFileExFlags () from /usr/lib/libpython2.5.so.1.0 #18 0xb7ead5b3 in PyRun_AnyFileExFlags () from /usr/lib/libpython2.5.so.1.0 #19 0xb7eb4985 in Py_Main () from /usr/lib/libpython2.5.so.1.0 #20 0x0804856e in main ()
[D-BUS Service] Name=spam.eggs.osso_test_receiver Exec=/home/melmoth/dev/rapier/receive.py
#!/usr/bin/python2.5 import osso import gtk def callback_func(interface, method, arguments, user_data): print "RPC received",user_data print "arg=",arguments #osso_c = user_data #osso_sysnote = osso.SystemNote(osso_c) #osso_sysnote.system_note_infoprint("osso_test_receiver: Received a RPC to %s." % method) return "ok data has been processed" osso_c = osso.Context("osso_test_receiver", "0.0.1", False) print "osso_test_receiver started" osso_rpc = osso.Rpc(osso_c) osso_rpc.set_rpc_callback("spam.eggs.osso_test_receiver", "/spam/eggs/osso_test_receiver", "spam.eggs.osso_test_receiver", callback_func, 'plop') gtk.main()
#!/usr/bin/python2.5 import osso import hildon import gtk def process_rpc_answer(retval): print "process_rpc_answer called:",retval return True def send_rpc(widget, osso_c): """ Cf http://www.maemo.org/platform/docs/pymaemo/pyosso_context.html#rpc_run_with_defaults """ osso_rpc = osso.Rpc(osso_c) test=osso_rpc.rpc_async_run("spam.eggs.osso_test_receiver", "/spam/eggs/osso_test_receiver", "spam.eggs.osso_test_receiver", "do_something", process_rpc_answer, 'some user data', ('argA','argB') ) print "test=,",test print "RPC sent" osso_c = osso.Context("osso_test_sender", "0.0.1", False) window = hildon.Window() window.connect("destroy", gtk.main_quit) send_button = gtk.Button("Send RPC") window.add(send_button) send_button.connect("clicked", send_rpc, osso_c) window.show_all() gtk.main()
_______________________________________________ maemo-developers mailing list maemo-developers@maemo.org https://maemo.org/mailman/listinfo/maemo-developers