diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2010-03-03 13:14:00 +0100 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2010-03-03 13:14:00 +0100 |
commit | 9a832a9bdbda66a0c3bfec2ce3eb7ba5bcc2eb44 (patch) | |
tree | d46a12c5bddebed0f132c2d5017eeb54141c3cee | |
parent | 92e5a45bfaba1b24905c4c22af67e59941e63cda (diff) | |
parent | e3e1a6da8047cb36de9a8faf592a69c9a482a5d9 (diff) |
CWS-TOOLING: integrate CWS sb119
Notes
Notes:
split repo tag: ure_ooo/DEV300_m74
-rw-r--r-- | bridges/source/cpp_uno/gcc3_linux_intel/call.s | 16 | ||||
-rw-r--r-- | bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx | 7 | ||||
-rw-r--r-- | cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx | 20 | ||||
-rw-r--r-- | jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx | 16 | ||||
-rw-r--r-- | sal/inc/osl/diagnose.hxx | 14 | ||||
-rw-r--r-- | sal/osl/unx/signal.c | 11 | ||||
-rw-r--r-- | sal/osl/unx/socket.c | 4 | ||||
-rw-r--r-- | sal/rtl/source/hash.cxx | 70 | ||||
-rw-r--r-- | sal/rtl/source/hash.h | 10 | ||||
-rw-r--r-- | sal/rtl/source/ustring.c | 8 | ||||
-rw-r--r-- | stoc/source/invocation_adapterfactory/iafactory.cxx | 25 | ||||
-rw-r--r-- | udkapi/com/sun/star/reflection/XInterfaceAttributeTypeDescription2.idl | 3 |
12 files changed, 106 insertions, 98 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/call.s b/bridges/source/cpp_uno/gcc3_linux_intel/call.s index f345e3a764ac..45d7c5308d30 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/call.s +++ b/bridges/source/cpp_uno/gcc3_linux_intel/call.s @@ -9,7 +9,8 @@ privateSnippetExecutorGeneral: .LCFIg0: movl %esp,%ebp .LCFIg1: - subl $0x4,%esp # 32bit returnValue + subl $0x8,%esp # 32bit returnValue, and preserve potential 128bit + # stack alignment pushl %esp # 32bit &returnValue pushl %ecx # 32bit pCallStack pushl %edx # 32bit nVtableOffset @@ -30,6 +31,7 @@ privateSnippetExecutorVoid: .LCFIv0: movl %esp,%ebp .LCFIv1: + andl $0xFFFFFFF0,%esp # preserve potential 128bit stack alignment pushl $0 # 32bit null pointer (returnValue not used) pushl %ecx # 32bit pCallStack pushl %edx # 32bit nVtableOffset @@ -49,7 +51,8 @@ privateSnippetExecutorHyper: .LCFIh0: movl %esp,%ebp .LCFIh1: - subl $0x8,%esp # 64bit returnValue + subl $0x8,%esp # 64bit returnValue (preserves potential 128bit + # stack alignment) pushl %esp # 32bit &returnValue pushl %ecx # 32bit pCallStack pushl %edx # 32bit nVtableOffset @@ -71,7 +74,8 @@ privateSnippetExecutorFloat: .LCFIf0: movl %esp,%ebp .LCFIf1: - subl $0x4,%esp # 32bit returnValue + subl $0x8,%esp # 32bit returnValue, and preserve potential 128bit + # stack alignment pushl %esp # 32bit &returnValue pushl %ecx # 32bit pCallStack pushl %edx # 32bit nVtableOffset @@ -92,7 +96,8 @@ privateSnippetExecutorDouble: .LCFId0: movl %esp,%ebp .LCFId1: - subl $0x8,%esp # 64bit returnValue + subl $0x8,%esp # 64bit returnValue (preserves potential 128bit + # stack alignment) pushl %esp # 32bit &returnValue pushl %ecx # 32bit pCallStack pushl %edx # 32bit nVtableOffset @@ -113,7 +118,8 @@ privateSnippetExecutorClass: .LCFIc0: movl %esp,%ebp .LCFIc1: - subl $0x4,%esp # 32bit returnValue + subl $0x8,%esp # 32bit returnValue, and preserve potential 128bit + # stack alignment pushl %esp # 32bit &returnValue pushl %ecx # 32bit pCallStack pushl %edx # 32bit nVtableOffset diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx index afd202f683cf..4d1d3f2f8ca4 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx @@ -84,6 +84,13 @@ void callVirtualMethod( void * stackptr; asm volatile ( "mov %%esp, %6\n\t" + // preserve potential 128bit stack alignment + "and $0xfffffff0, %%esp\n\t" + "mov %0, %%eax\n\t" + "lea -4(,%%eax,4), %%eax\n\t" + "and $0xf, %%eax\n\t" + "sub $0xc, %%eax\n\t" + "add %%eax, %%esp\n\t" // copy values "mov %0, %%eax\n\t" "mov %%eax, %%edx\n\t" diff --git a/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx b/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx index 7b7657fc79ed..344203e38762 100644 --- a/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx +++ b/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx @@ -275,10 +275,12 @@ static uno::TypeDescription getAcquireMethod(void) typelib_TypeDescriptionReference * type_XInterface = * typelib_static_type_getByTypeClass(typelib_TypeClass_INTERFACE); - typelib_InterfaceTypeDescription * pTXInterfaceDescr = 0; - TYPELIB_DANGER_GET ((typelib_TypeDescription **)&pTXInterfaceDescr, type_XInterface); - uno::TypeDescription acquire(pTXInterfaceDescr->ppAllMembers[1]); - TYPELIB_DANGER_RELEASE((typelib_TypeDescription *)pTXInterfaceDescr); + typelib_TypeDescription * pTXInterfaceDescr = 0; + TYPELIB_DANGER_GET (&pTXInterfaceDescr, type_XInterface); + uno::TypeDescription acquire( + reinterpret_cast< typelib_InterfaceTypeDescription * >( + pTXInterfaceDescr)->ppAllMembers[1]); + TYPELIB_DANGER_RELEASE(pTXInterfaceDescr); return acquire; } @@ -288,10 +290,12 @@ static uno::TypeDescription getReleaseMethod(void) typelib_TypeDescriptionReference * type_XInterface = * typelib_static_type_getByTypeClass(typelib_TypeClass_INTERFACE); - typelib_InterfaceTypeDescription * pTXInterfaceDescr = 0; - TYPELIB_DANGER_GET ((typelib_TypeDescription **)&pTXInterfaceDescr, type_XInterface); - uno::TypeDescription release(pTXInterfaceDescr->ppAllMembers[2]); - TYPELIB_DANGER_RELEASE((typelib_TypeDescription *)pTXInterfaceDescr); + typelib_TypeDescription * pTXInterfaceDescr = 0; + TYPELIB_DANGER_GET (&pTXInterfaceDescr, type_XInterface); + uno::TypeDescription release( + reinterpret_cast< typelib_InterfaceTypeDescription * >( + pTXInterfaceDescr)->ppAllMembers[2]); + TYPELIB_DANGER_RELEASE(pTXInterfaceDescr); return release; } diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx index f84bcb4f9ec0..896342b5389d 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx @@ -175,7 +175,7 @@ rtl::OUString getRuntimeLib(const rtl::ByteSequence & data) jmp_buf jmp_jvm_abort; sig_atomic_t g_bInGetJavaVM = 0; -void abort_handler() +extern "C" void JNICALL abort_handler() { // If we are within JNI_CreateJavaVM then we jump back into getJavaVM if( g_bInGetJavaVM != 0 ) @@ -508,20 +508,6 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( return JFW_PLUGIN_E_VM_CREATION_FAILED; } - // The office sets a signal handler at startup. That causes a crash - // with java 1.3 under Solaris. To make it work, we set back the - // handler -#ifdef UNX - struct sigaction act; - act.sa_handler=SIG_DFL; - act.sa_flags= 0; - sigaction( SIGSEGV, &act, NULL); - sigaction( SIGPIPE, &act, NULL); - sigaction( SIGBUS, &act, NULL); - sigaction( SIGILL, &act, NULL); - sigaction( SIGFPE, &act, NULL); -#endif - // Some testing with Java 1.4 showed that JavaVMOption.optionString has to // be encoded with the system encoding (i.e., osl_getThreadTextEncoding): JavaVMInitArgs vm_args; diff --git a/sal/inc/osl/diagnose.hxx b/sal/inc/osl/diagnose.hxx index 72883d994d4a..e7360e93349e 100644 --- a/sal/inc/osl/diagnose.hxx +++ b/sal/inc/osl/diagnose.hxx @@ -125,19 +125,17 @@ public: VoidPointerSet::const_iterator iPos(m_data.m_addresses.begin()); VoidPointerSet::const_iterator const iEnd(m_data.m_addresses.end()); for ( ; iPos != iEnd; ++iPos ) { - T const* pLeakingObj = static_cast<T const*>(*iPos); - OSL_ASSERT( pLeakingObj != 0 ); - static_cast<void>(pLeakingObj); + OSL_ASSERT( *iPos != 0 ); } } return bRet; } - void registerObject( T const* pObj ) { + void registerObject( void const* pObj ) { osl_detail_ObjectRegistry_registerObject(m_data, pObj); } - void revokeObject( T const* pObj ) { + void revokeObject( void const* pObj ) { osl_detail_ObjectRegistry_revokeObject(m_data, pObj); } @@ -188,12 +186,10 @@ public: protected: DebugBase() { - StaticObjectRegistry::get().registerObject( - static_cast<InheritingClassT const*>(this) ); + StaticObjectRegistry::get().registerObject( this ); } ~DebugBase() { - StaticObjectRegistry::get().revokeObject( - static_cast<InheritingClassT const*>(this) ); + StaticObjectRegistry::get().revokeObject( this ); } private: diff --git a/sal/osl/unx/signal.c b/sal/osl/unx/signal.c index df9ad8f27515..c5141fa02260 100644 --- a/sal/osl/unx/signal.c +++ b/sal/osl/unx/signal.c @@ -199,6 +199,7 @@ static sal_Bool InitSignal() int i; struct sigaction act; struct sigaction oact; + sigset_t unset; if (is_soffice_Impl()) { @@ -280,6 +281,16 @@ static sal_Bool InitSignal() } } + /* Clear signal mask inherited from parent process (on Mac OS X, upon a + crash soffice re-execs itself from within the signal handler, so the + second soffice would have the guilty signal blocked and would freeze upon + encountering a similar crash again): */ + if (sigemptyset(&unset) < 0 || + pthread_sigmask(SIG_SETMASK, &unset, NULL) < 0) + { + OSL_TRACE("sigemptyset or pthread_sigmask failed"); + } + return sal_True; } diff --git a/sal/osl/unx/socket.c b/sal/osl/unx/socket.c index c901aa7b505d..c8faf6c028f5 100644 --- a/sal/osl/unx/socket.c +++ b/sal/osl/unx/socket.c @@ -1858,6 +1858,9 @@ void SAL_CALL osl_closeSocket(oslSocket pSocket) pSocket->m_nLastError=0; nFD = pSocket->m_Socket; + if (nFD == OSL_INVALID_SOCKET) + return; + pSocket->m_Socket = OSL_INVALID_SOCKET; #if defined(LINUX) @@ -1904,6 +1907,7 @@ void SAL_CALL osl_closeSocket(oslSocket pSocket) #endif /* OSL_DEBUG_LEVEL */ close(nConnFD); } + pSocket->m_bIsAccepting = sal_False; } #endif /* LINUX */ diff --git a/sal/rtl/source/hash.cxx b/sal/rtl/source/hash.cxx index ec5229002c4b..7caa2341ca11 100644 --- a/sal/rtl/source/hash.cxx +++ b/sal/rtl/source/hash.cxx @@ -36,52 +36,51 @@ #include <hash_set> namespace { - struct UStringHash - { - size_t operator()(rtl_uString * const &rString) const - { return (size_t)rtl_ustr_hashCode_WithLength( rString->buffer, rString->length ); } - }; - struct UStringEqual - { - sal_Bool operator() ( rtl_uString * const &pStringA, - rtl_uString * const &pStringB) const - { - if (pStringA == pStringB) - return true; - if (pStringA->length != pStringB->length) - return false; - return !rtl_ustr_compare_WithLength( pStringA->buffer, pStringA->length, - pStringB->buffer, pStringB->length); - } - }; -} -typedef std::hash_set< rtl_uString *, UStringHash, UStringEqual, - rtl::Allocator<rtl_uString *> > UniqueHash; +struct UStringHash +{ + size_t operator()(rtl_uString * const &rString) const + { return (size_t)rtl_ustr_hashCode_WithLength( rString->buffer, rString->length ); } +}; -struct StringHashTableImpl : public UniqueHash +struct UStringEqual { - StringHashTableImpl(sal_uInt32 nSize) : UniqueHash( nSize ) {} + sal_Bool operator() ( rtl_uString * const &pStringA, + rtl_uString * const &pStringB) const + { + if (pStringA == pStringB) + return true; + if (pStringA->length != pStringB->length) + return false; + return !rtl_ustr_compare_WithLength( pStringA->buffer, pStringA->length, + pStringB->buffer, pStringB->length); + } }; +typedef std::hash_set< rtl_uString *, UStringHash, UStringEqual, + rtl::Allocator<rtl_uString *> > StringHashTable; + StringHashTable * -rtl_str_hash_new (sal_uInt32 nSize) +getHashTable () { - return new StringHashTableImpl (nSize); + static StringHashTable *pInternPool = NULL; + if (pInternPool == NULL) { + static StringHashTable aImpl(1024); + pInternPool = &aImpl; + } + return pInternPool; } -void -rtl_str_hash_free (StringHashTable *pHash) -{ - delete pHash; } +extern "C" { + rtl_uString * -rtl_str_hash_intern (StringHashTable *pHash, - rtl_uString *pString, +rtl_str_hash_intern (rtl_uString *pString, int can_return) { - UniqueHash::iterator aIter; + StringHashTable *pHash = getHashTable(); + StringHashTable::iterator aIter; aIter = pHash->find(pString); if (aIter != pHash->end()) { @@ -106,8 +105,9 @@ rtl_str_hash_intern (StringHashTable *pHash, } void -rtl_str_hash_remove (StringHashTable *pHash, - rtl_uString *pString) +rtl_str_hash_remove (rtl_uString *pString) { - pHash->erase(pString); + getHashTable()->erase(pString); +} + } diff --git a/sal/rtl/source/hash.h b/sal/rtl/source/hash.h index 63f3e99c8495..2aadfb33efcd 100644 --- a/sal/rtl/source/hash.h +++ b/sal/rtl/source/hash.h @@ -8,15 +8,11 @@ extern "C" { #endif /* __cplusplus */ -typedef struct StringHashTableImpl StringHashTable; +/* These functions are not multi-thread safe: */ -StringHashTable *rtl_str_hash_new (sal_uInt32 nSize); -void rtl_str_hash_free (StringHashTable *pHash); -rtl_uString *rtl_str_hash_intern (StringHashTable *pHash, - rtl_uString *pString, +rtl_uString *rtl_str_hash_intern (rtl_uString *pString, int can_return); -void rtl_str_hash_remove (StringHashTable *pHash, - rtl_uString *pString); +void rtl_str_hash_remove (rtl_uString *pString); #if defined __cplusplus } diff --git a/sal/rtl/source/ustring.c b/sal/rtl/source/ustring.c index aebd0684a50a..b0bdd2d98e73 100644 --- a/sal/rtl/source/ustring.c +++ b/sal/rtl/source/ustring.c @@ -761,8 +761,6 @@ getInternMutex() return pPoolGuard; } -static StringHashTable *pInternPool = NULL; - /* returns true if we found a dup in the pool */ static void rtl_ustring_intern_internal( rtl_uString ** newStr, rtl_uString * str, @@ -774,9 +772,7 @@ static void rtl_ustring_intern_internal( rtl_uString ** newStr, osl_acquireMutex( pPoolMutex ); - if (!pInternPool) - pInternPool = rtl_str_hash_new (1024); - *newStr = rtl_str_hash_intern (pInternPool, str, can_return); + *newStr = rtl_str_hash_intern (str, can_return); osl_releaseMutex( pPoolMutex ); @@ -864,7 +860,7 @@ internRelease (rtl_uString *pThis) pPoolMutex = getInternMutex(); osl_acquireMutex( pPoolMutex ); - rtl_str_hash_remove (pInternPool, pThis); + rtl_str_hash_remove (pThis); /* May have been separately acquired */ if ( SAL_STRING_REFCOUNT( diff --git a/stoc/source/invocation_adapterfactory/iafactory.cxx b/stoc/source/invocation_adapterfactory/iafactory.cxx index a2d8c6063881..2fda1819f891 100644 --- a/stoc/source/invocation_adapterfactory/iafactory.cxx +++ b/stoc/source/invocation_adapterfactory/iafactory.cxx @@ -766,27 +766,28 @@ FactoryImpl::FactoryImpl( Reference< XComponentContext > const & xContext ) ::getCppuType( (const Sequence< sal_Int16 > *)0 ); rShortSeqType.getDescription( &m_pShortSeqTD ); // script.XInvocation - typelib_InterfaceTypeDescription * pTD = 0; + typelib_TypeDescription * pTD = 0; const Type & rInvType = ::getCppuType( (const Reference< script::XInvocation > *)0 ); - TYPELIB_DANGER_GET( - (typelib_TypeDescription **)&pTD, rInvType.getTypeLibType() ); - if( ! pTD->aBase.bComplete ) - typelib_typedescription_complete( (typelib_TypeDescription **)&pTD ); + TYPELIB_DANGER_GET( &pTD, rInvType.getTypeLibType() ); + typelib_InterfaceTypeDescription * pITD; + pITD = reinterpret_cast<typelib_InterfaceTypeDescription*>(pTD); + if( ! pITD->aBase.bComplete ) + typelib_typedescription_complete( &pTD ); ::typelib_typedescriptionreference_getDescription( - &m_pInvokMethodTD, pTD->ppMembers[ 1 ] ); // invoke() + &m_pInvokMethodTD, pITD->ppMembers[ 1 ] ); // invoke() ::typelib_typedescriptionreference_getDescription( - &m_pSetValueTD, pTD->ppMembers[ 2 ] ); // setValue() + &m_pSetValueTD, pITD->ppMembers[ 2 ] ); // setValue() ::typelib_typedescriptionreference_getDescription( - &m_pGetValueTD, pTD->ppMembers[ 3 ] ); // getValue() + &m_pGetValueTD, pITD->ppMembers[ 3 ] ); // getValue() // script.XTypeConverter const Type & rTCType = ::getCppuType( (const Reference< script::XTypeConverter > *)0 ); - TYPELIB_DANGER_GET( - (typelib_TypeDescription **)&pTD, rTCType.getTypeLibType() ); + TYPELIB_DANGER_GET( &pTD, rTCType.getTypeLibType() ); + pITD = reinterpret_cast<typelib_InterfaceTypeDescription*>(pTD); ::typelib_typedescriptionreference_getDescription( - &m_pConvertToTD, pTD->ppMembers[ 0 ] ); // convertTo() - TYPELIB_DANGER_RELEASE( (typelib_TypeDescription *)pTD ); + &m_pConvertToTD, pITD->ppMembers[ 0 ] ); // convertTo() + TYPELIB_DANGER_RELEASE( pTD ); if (!m_pInvokMethodTD || !m_pSetValueTD || !m_pGetValueTD || !m_pConvertToTD || diff --git a/udkapi/com/sun/star/reflection/XInterfaceAttributeTypeDescription2.idl b/udkapi/com/sun/star/reflection/XInterfaceAttributeTypeDescription2.idl index bd37f64cf714..96b8957683ff 100644 --- a/udkapi/com/sun/star/reflection/XInterfaceAttributeTypeDescription2.idl +++ b/udkapi/com/sun/star/reflection/XInterfaceAttributeTypeDescription2.idl @@ -35,7 +35,8 @@ module com { module sun { module star { module reflection { interface XCompoundTypeDescription; /** - Reflects a singleton, supporting interface-based singletons. + Reflects an interface attribute, supporting extended attributes that are + bound or raise exceptions. <p>This type supersedes <type>XInterfaceAttributeTypeDescription</type>, which does not support extended attributes.</p> |