[omniORB] C++ with omniORB embedding python which uses omniORBpy
Roland Spatzenegger
spatzenegger at 4soft.de
Thu Oct 13 12:35:04 BST 2005
Hi,
Duncan Grisby schrieb:
>On Tuesday 4 October, Roland Spatzenegger wrote:
>
>
>>we have a c++ linux programm which uses omniorb (CORBA server and also
>>a client). One function of the programm is to start python
>>scripts. The Python scripts again uses OmniorbPy to communicate with
>>other servers.
>>If the scripts are executed with exec("python ...") it works, but I
>>get a lot of problems if the scripts are embedded and the python
>>interpreter is forked. On error is:
>> omniORB: Assertion failed. This indicates a bug in the application using
>>omniORB, or maybe in omniORB itself.
>> file: orbOptions.cc
>> line: 132
>> info: findHandler(h.key()) == 0
>>terminate called after throwing an instance of 'omniORB::fatalException'
>>
>>
>
>What platform are you using? It looks like Python has loaded a new
>instance of the omniORB library, rather than using the one that's
>already in the process. Furthermore, it hasn't initialised the new load
>of the library correctly so it blows up. Does omniORBpy work if you use
>it normally? How about if you start it from within C++ code that isn't
>linked with omniORB?
>
>
>
>
I think I have found the problem, but first your questions:
I use: Omniorb 4.0.5, OmniOrbPy 2.5, python 2.4.1, Linux 2.6, gcc 4.0.1
With C++/Omniorb and python/Omnirb started with exec it works.
For the Python-Integration I now use almost the same code as mod_python
from Apache. So each python interpreter is started in it's own thread,
without OmniOrb it works correctly.
The problem, as you already said, is that the Orb is initialized twice.
It looks like that the python-module always tries to initializes the
ORB. Is there a way to prevent this?
bye
Roland
Here is a example stack trace:
(gdb) backtrace
#0 0x00949402 in __kernel_vsyscall ()
#1 0x009a3118 in raise () from /lib/libc.so.6
#2 0x009a4888 in abort () from /lib/libc.so.6
#3 0x00322d5e in __gnu_cxx::__verbose_terminate_handler ()
from /usr/lib/libstdc++.so.6
#4 0x00320a31 in __gxx_personality_v0 () from /usr/lib/libstdc++.so.6
#5 0x00320a66 in std::terminate () from /usr/lib/libstdc++.so.6
#6 0x00320b9a in __cxa_throw () from /usr/lib/libstdc++.so.6
#7 0x001a4e49 in omni::assertFail () from /usr/local/lib/libomniORB4.so.0
#8 0x001b42f0 in omni::orbOptions::registerHandler ()
from /usr/local/lib/libomniORB4.so.0
#9 0x010a867f in global constructors keyed to
_ZN4omni13orbParameters23acceptBiDirectionalGIOPE ()
from /usr/local/lib/python2.4/site-packages/_omnipymodule.so
#10 0x0122275d in __do_global_ctors_aux ()
from /usr/local/lib/python2.4/site-packages/_omnipymodule.so
#11 0x00ff9f35 in _init ()
from /usr/local/lib/python2.4/site-packages/_omnipymodule.so
#12 0x0096adcb in call_init () from /lib/ld-linux.so.2
#13 0x0096aeca in _dl_init_internal () from /lib/ld-linux.so.2
#14 0x0096e405 in dl_open_worker () from /lib/ld-linux.so.2
#15 0x0096ac6e in _dl_catch_error () from /lib/ld-linux.so.2
#16 0x0096e9c9 in _dl_open () from /lib/ld-linux.so.2
#17 0x00acdd42 in dlopen_doit () from /lib/libdl.so.2
---Type <return> to continue, or q <return> to quit---
#18 0x0096ac6e in _dl_catch_error () from /lib/ld-linux.so.2
#19 0x00ace3e3 in _dlerror_run () from /lib/libdl.so.2
#20 0x00acddd2 in dlopen@@GLIBC_2.1 () from /lib/libdl.so.2
#21 0x00c71f52 in _PyImport_GetDynLoadFunc () from
/usr/lib/libpython2.4.so.1.0
#22 0x00c67751 in _PyImport_LoadDynamicModule ()
from /usr/lib/libpython2.4.so.1.0
#23 0x00c65f8d in PyImport_AppendInittab () from
/usr/lib/libpython2.4.so.1.0
#24 0x00c66752 in PyImport_ReloadModule () from /usr/lib/libpython2.4.so.1.0
#25 0x00c66976 in PyImport_ReloadModule () from /usr/lib/libpython2.4.so.1.0
#26 0x00c66e16 in PyImport_ImportModuleEx () from
/usr/lib/libpython2.4.so.1.0
#27 0x00c41b9e in _PyUnicodeUCS4_IsAlpha () from
/usr/lib/libpython2.4.so.1.0
#28 0x00c161f3 in PyCFunction_Call () from /usr/lib/libpython2.4.so.1.0
#29 0x00bf03b4 in PyObject_Call () from /usr/lib/libpython2.4.so.1.0
#30 0x00bf047c in PyObject_CallFunction () from /usr/lib/libpython2.4.so.1.0
#31 0x00c67249 in PyImport_Import () from /usr/lib/libpython2.4.so.1.0
#32 0x00c6741b in PyImport_ImportModule () from /usr/lib/libpython2.4.so.1.0
#33 0x0807d9b1 in EmbedGetORB (self=0x0, args=0x0)
at ../src/scripthandler.cpp:33
#34 0x00c4e891 in PyEval_EvalFrame () from /usr/lib/libpython2.4.so.1.0
#35 0x00c4fef8 in PyEval_EvalCodeEx () from /usr/lib/libpython2.4.so.1.0
#36 0x00c50228 in PyEval_EvalCode () from /usr/lib/libpython2.4.so.1.0
#37 0x00c6c55a in PyErr_Display () from /usr/lib/libpython2.4.so.1.0
#38 0x00c6d50c in PyRun_SimpleStringFlags () from
/usr/lib/libpython2.4.so.1.0
#39 0x00c6d587 in PyRun_SimpleString () from /usr/lib/libpython2.4.so.1.0
More information about the omniORB-list
mailing list