Index: bugfixes.xml =================================================================== RCS file: /cvsroot/omniORBpy/bugfixes.xml,v retrieving revision 1.1.2.29 retrieving revision 1.1.2.30 diff -u -u -r1.1.2.29 -r1.1.2.30 --- bugfixes.xml 2001/06/18 09:32:16 1.1.2.29 +++ bugfixes.xml 2001/12/10 18:06:54 1.1.2.30 @@ -8,6 +8,14 @@ - + + Segfault with narrow on pseudo object + Krzysztof Czarnowski + + + Attempts to narrow a pseudo object like a POA would segfault. + + Index: update.log =================================================================== RCS file: /cvsroot/omniORBpy/update.log,v retrieving revision 1.28.2.65 retrieving revision 1.28.2.70 diff -u -u -r1.28.2.65 -r1.28.2.70 --- update.log 2001/06/21 14:09:26 1.28.2.65 +++ update.log 2001/12/10 18:06:55 1.28.2.70 @@ -1,3 +1,43 @@ +Mon Dec 10 18:01:14 GMT 2001 dpg1 +================================= + +- Segfault with narrow on pseudo object. + +modules/omni30/omnipy.cc + + +Thu Oct 18 17:31:58 BST 2001 dpg1 +================================= + +- Segfault with invalid policy list in create_POA(). + +modules/omni30/pyPOAFunc.cc + + +Wed Oct 17 10:30:11 BST 2001 dpg1 +================================= + +- Use sys.prefix as well as sys.exec_prefix to find Python includes. + +modules/dir.mk + + +Fri Oct 5 15:27:13 BST 2001 dpg1 +================================= + +- Fix hard-coded Python path in AIX make rules. + +modules/dir.mk + + +Fri Jul 6 15:34:33 BST 2001 dpg1 +================================= + +- Expose omniORB.MaxMessageSize function. + +modules/common/pyomniFunc.cc + + Thu Jun 21 15:07:36 BST 2001 dpg1 ================================= Index: modules/dir.mk =================================================================== RCS file: /cvsroot/omniORBpy/modules/dir.mk,v retrieving revision 1.27.2.9 retrieving revision 1.27.2.11 diff -u -u -r1.27.2.9 -r1.27.2.11 --- modules/dir.mk 2001/06/21 13:39:23 1.27.2.9 +++ modules/dir.mk 2001/10/17 09:35:14 1.27.2.11 @@ -81,12 +81,12 @@ ifdef UnixPlatform #CXXDEBUGFLAGS = -g -PYPREFIX := $(shell $(PYTHON) -c 'import sys; print sys.exec_prefix') +PYEPREFIX := $(shell $(PYTHON) -c 'import sys; print sys.exec_prefix') +PYPREFIX := $(shell $(PYTHON) -c 'import sys; print sys.prefix') PYVERSION := $(shell $(PYTHON) -c 'import sys; print sys.version[:3]') -PYINCDIR := $(PYPREFIX)/include PYINCFILE := "" PYINCTHRD := "" -DIR_CPPFLAGS += -I$(PYINCDIR) -DPYTHON_INCLUDE=$(PYINCFILE) -DPYTHON_THREAD_INC=$(PYINCTHRD) +DIR_CPPFLAGS += -I$(PYEPREFIX)/include -I$(PYPREFIX)/include -DPYTHON_INCLUDE=$(PYINCFILE) -DPYTHON_THREAD_INC=$(PYINCTHRD) endif @@ -258,7 +258,7 @@ lib = _omnipymodule.so libinit = init_omnipy -py_exp = /usr/local/lib/python$(PYVERSION)/config/python.exp +py_exp = $(PYPREFIX)/lib/python$(PYVERSION)/config/python.exp ifeq ($(notdir $(CXX)),xlC_r) Index: modules/common/pyomniFunc.cc =================================================================== RCS file: /cvsroot/omniORBpy/modules/common/pyomniFunc.cc,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -u -r1.1.2.4 -r1.1.2.5 --- modules/common/pyomniFunc.cc 2000/10/30 14:27:36 1.1.2.4 +++ modules/common/pyomniFunc.cc 2001/07/06 14:36:28 1.1.2.5 @@ -27,8 +27,11 @@ // Description: // omniORB API functions -// $Id: pyomniFunc.cc,v 1.1.2.4 2000/10/30 14:27:36 dpg1 Exp $ +// $Id: pyomniFunc.cc,v 1.1.2.5 2001/07/06 14:36:28 dpg1 Exp $ // $Log: pyomniFunc.cc,v $ +// Revision 1.1.2.5 2001/07/06 14:36:28 dpg1 +// Expose omniORB.MaxMessageSize function. +// // Revision 1.1.2.4 2000/10/30 14:27:36 dpg1 // Add omniORB.maxTcpConnectionPerServer // @@ -393,6 +396,32 @@ return 0; } + static char MaxMessageSize_doc [] = + "MaxMessageSize(int) -> None\n" + "MaxMessageSize() -> int\n" + "\n" + "Set or get the ORB-wide limit on the sizr of a GIOP message.\n"; + + static PyObject* pyomni_MaxMessageSize(PyObject* self, + PyObject* args) + { + if (PyTuple_GET_SIZE(args) == 0) { + return PyInt_FromLong(omniORB::MaxMessageSize()); + } + else if (PyTuple_GET_SIZE(args) == 1) { + PyObject* pymc = PyTuple_GET_ITEM(args, 0); + + if (PyInt_Check(pymc)) { + omniORB::MaxMessageSize(PyInt_AS_LONG(pymc)); + Py_INCREF(Py_None); + return Py_None; + } + } + PyErr_SetString(PyExc_TypeError, + (char*)"Operation requires a single integer argument"); + return 0; + } + static PyMethodDef pyomni_methods[] = { {(char*)"installTransientExceptionHandler", pyomni_installTransientExceptionHandler, @@ -413,6 +442,10 @@ {(char*)"maxTcpConnectionPerServer", pyomni_maxTcpConnectionPerServer, METH_VARARGS, maxTcpConnectionPerServer_doc}, + + {(char*)"MaxMessageSize", + pyomni_MaxMessageSize, + METH_VARARGS, MaxMessageSize_doc}, {NULL,NULL} }; Index: modules/omni30/omnipy.cc =================================================================== RCS file: /cvsroot/omniORBpy/modules/omni30/omnipy.cc,v retrieving revision 1.37.2.3 retrieving revision 1.37.2.4 diff -u -u -r1.37.2.3 -r1.37.2.4 --- modules/omni30/omnipy.cc 2001/05/01 11:16:42 1.37.2.3 +++ modules/omni30/omnipy.cc 2001/12/10 18:06:55 1.37.2.4 @@ -27,9 +27,12 @@ // Description: // Main entry points for _omnipy Python module -// $Id: omnipy.cc,v 1.37.2.3 2001/05/01 11:16:42 dpg1 Exp $ +// $Id: omnipy.cc,v 1.37.2.4 2001/12/10 18:06:55 dpg1 Exp $ // $Log: omnipy.cc,v $ +// Revision 1.37.2.4 2001/12/10 18:06:55 dpg1 +// Segfault with narrow on pseudo object. +// // Revision 1.37.2.3 2001/05/01 11:16:42 dpg1 // omnipy_narrow() called createObjRef() while holding the interpreter // lock. @@ -751,14 +754,18 @@ isa = cxxsource->_is_a(repoId); if (isa) { - omniObjRef* oosource = cxxsource->_PR_getobj(); - omniObjRef* oodest = - omniPy::createObjRef(oosource->_mostDerivedRepoId(), - repoId, - oosource->_iopProfiles(), - 0, 1); - cxxdest = - (CORBA::Object_ptr)(oodest->_ptrToObjRef(CORBA::Object::_PD_repoId)); + if (!cxxsource->_NP_is_pseudo()) { + omniObjRef* oosource = cxxsource->_PR_getobj(); + omniObjRef* oodest = + omniPy::createObjRef(oosource->_mostDerivedRepoId(), + repoId, + oosource->_iopProfiles(), + 0, 1); + cxxdest = (CORBA::Object_ptr) + (oodest->_ptrToObjRef(CORBA::Object::_PD_repoId)); + } + else + cxxdest = CORBA::Object::_duplicate(cxxsource); } } OMNIPY_CATCH_AND_HANDLE_SYSTEM_EXCEPTIONS Index: modules/omni30/pyPOAFunc.cc =================================================================== RCS file: /cvsroot/omniORBpy/modules/omni30/pyPOAFunc.cc,v retrieving revision 1.12.2.4 retrieving revision 1.12.2.5 diff -u -u -r1.12.2.4 -r1.12.2.5 --- modules/omni30/pyPOAFunc.cc 2001/05/03 15:25:02 1.12.2.4 +++ modules/omni30/pyPOAFunc.cc 2001/10/18 16:39:40 1.12.2.5 @@ -27,8 +27,11 @@ // Description: // POA functions -// $Id: pyPOAFunc.cc,v 1.12.2.4 2001/05/03 15:25:02 dpg1 Exp $ +// $Id: pyPOAFunc.cc,v 1.12.2.5 2001/10/18 16:39:40 dpg1 Exp $ // $Log: pyPOAFunc.cc,v $ +// Revision 1.12.2.5 2001/10/18 16:39:40 dpg1 +// Segfault with invalid policy list in create_POA(). +// // Revision 1.12.2.4 2001/05/03 15:25:02 dpg1 // Various places released object references while holding the // interpreter lock. Object reference deletion locks omni::internalLock, @@ -137,6 +140,8 @@ CORBA::Policy_ptr createPolicyObject(PortableServer::POA_ptr poa, PyObject* pypolicy) { + if (!pypolicy) OMNIORB_THROW(BAD_PARAM, 0, CORBA::COMPLETED_NO); + CORBA::Policy_ptr policy = 0; PyObject* pyptype = PyObject_GetAttrString(pypolicy, (char*)"_policy_type"); @@ -230,7 +235,8 @@ &pyPOA, &name, &pyPM, &pypolicies)) return 0; - RAISE_PY_BAD_PARAM_IF(!PySequence_Check(pypolicies)); + RAISE_PY_BAD_PARAM_IF(!(PyList_Check(pypolicies) || + PyTuple_Check(pypolicies))); PortableServer::POA_ptr poa = (PortableServer::POA_ptr)omniPy::getTwin(pyPOA, POA_TWIN);