diff options
author | Tijl Coosemans <tijl@FreeBSD.org> | 2016-02-09 02:29:36 +0800 |
---|---|---|
committer | Tijl Coosemans <tijl@FreeBSD.org> | 2016-02-09 02:29:36 +0800 |
commit | 2afb7e98d3f97aba551edf4e174860b48d19b4f9 (patch) | |
tree | 6206924f71ddac02001c5733fda59e17832831d8 /editors | |
parent | 794d967801f6d3c5bce28c4fa6bc8fd4b92b9f36 (diff) | |
download | freebsd-ports-gnome-2afb7e98d3f97aba551edf4e174860b48d19b4f9.tar.gz freebsd-ports-gnome-2afb7e98d3f97aba551edf4e174860b48d19b4f9.tar.zst freebsd-ports-gnome-2afb7e98d3f97aba551edf4e174860b48d19b4f9.zip |
Add upstream patches that resolve a deadlock when one thread closes a
socket or pipe while another thread is still accepting connections.
PR: 205922
Approved by: office (jkim)
Diffstat (limited to 'editors')
-rw-r--r-- | editors/libreoffice/Makefile.common | 2 | ||||
-rw-r--r-- | editors/libreoffice/files/patch-sal_osl_unx_pipe.cxx | 65 | ||||
-rw-r--r-- | editors/libreoffice/files/patch-sal_osl_unx_socket.cxx | 98 | ||||
-rw-r--r-- | editors/libreoffice/files/patch-sal_osl_unx_sockimpl.hxx | 28 |
4 files changed, 192 insertions, 1 deletions
diff --git a/editors/libreoffice/Makefile.common b/editors/libreoffice/Makefile.common index 8deea87ed005..d3111a16faf2 100644 --- a/editors/libreoffice/Makefile.common +++ b/editors/libreoffice/Makefile.common @@ -2,7 +2,7 @@ PORTNAME= libreoffice PORTVERSION= 5.0.4 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES+= editors MAINTAINER= office@FreeBSD.org diff --git a/editors/libreoffice/files/patch-sal_osl_unx_pipe.cxx b/editors/libreoffice/files/patch-sal_osl_unx_pipe.cxx new file mode 100644 index 000000000000..11efa9dfa21a --- /dev/null +++ b/editors/libreoffice/files/patch-sal_osl_unx_pipe.cxx @@ -0,0 +1,65 @@ +--- sal/osl/unx/pipe.cxx.orig 2015-12-11 02:29:35 UTC ++++ sal/osl/unx/pipe.cxx +@@ -82,10 +82,10 @@ oslPipe __osl_createPipeImpl() + return NULL; + pPipeImpl->m_nRefCount =1; + pPipeImpl->m_bClosed = false; +-#if defined(LINUX) ++#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT + pPipeImpl->m_bIsInShutdown = false; + pPipeImpl->m_bIsAccepting = false; +-#endif ++#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */ + return pPipeImpl; + } + +@@ -359,7 +359,7 @@ void SAL_CALL osl_closePipe( oslPipe pPi + Thread does not return from accept on linux, so + connect to the accepting pipe + */ +-#if defined(LINUX) ++#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT + struct sockaddr_un addr; + + if ( pPipe->m_bIsAccepting ) +@@ -387,7 +387,7 @@ void SAL_CALL osl_closePipe( oslPipe pPi + } + close(fd); + } +-#endif /* LINUX */ ++#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */ + + nRet = shutdown(ConnFD, 2); + if ( nRet < 0 ) +@@ -421,13 +421,13 @@ oslPipe SAL_CALL osl_acceptPipe(oslPipe + + OSL_ASSERT(strlen(pPipe->m_Name) > 0); + +-#if defined(LINUX) ++#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT + pPipe->m_bIsAccepting = true; + #endif + + s = accept(pPipe->m_Socket, NULL, NULL); + +-#if defined(LINUX) ++#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT + pPipe->m_bIsAccepting = false; + #endif + +@@ -437,13 +437,13 @@ oslPipe SAL_CALL osl_acceptPipe(oslPipe + return NULL; + } + +-#if defined(LINUX) ++#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT + if ( pPipe->m_bIsInShutdown ) + { + close(s); + return NULL; + } +-#endif /* LINUX */ ++#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */ + else + { + /* alloc memory */ diff --git a/editors/libreoffice/files/patch-sal_osl_unx_socket.cxx b/editors/libreoffice/files/patch-sal_osl_unx_socket.cxx new file mode 100644 index 000000000000..f9ae9ceff0a8 --- /dev/null +++ b/editors/libreoffice/files/patch-sal_osl_unx_socket.cxx @@ -0,0 +1,98 @@ +--- sal/osl/unx/socket.cxx.orig 2015-12-11 02:29:35 UTC ++++ sal/osl/unx/socket.cxx +@@ -447,7 +447,7 @@ oslSocket __osl_createSocketImpl(int Soc + pSocket->m_nLastError = 0; + pSocket->m_nRefCount = 1; + +-#if defined(LINUX) ++#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT + pSocket->m_bIsAccepting = false; + #endif + +@@ -1364,13 +1364,13 @@ void SAL_CALL osl_releaseSocket( oslSock + { + if( pSocket && 0 == osl_atomic_decrement( &(pSocket->m_nRefCount) ) ) + { +-#if defined(LINUX) ++#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT + if ( pSocket->m_bIsAccepting ) + { + SAL_WARN( "sal.osl", "attempt to destroy socket while accepting" ); + return; + } +-#endif /* LINUX */ ++#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */ + osl_closeSocket( pSocket ); + __osl_destroySocketImpl( pSocket ); + } +@@ -1393,7 +1393,7 @@ void SAL_CALL osl_closeSocket(oslSocket + + pSocket->m_Socket = OSL_INVALID_SOCKET; + +-#if defined(LINUX) ++#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT + pSocket->m_bIsInShutdown = true; + + if ( pSocket->m_bIsAccepting ) +@@ -1437,7 +1437,7 @@ void SAL_CALL osl_closeSocket(oslSocket + } + pSocket->m_bIsAccepting = false; + } +-#endif /* LINUX */ ++#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */ + + nRet=close(nFD); + if ( nRet != 0 ) +@@ -1695,9 +1695,9 @@ oslSocket SAL_CALL osl_acceptConnectionO + } + + pSocket->m_nLastError=0; +-#if defined(LINUX) ++#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT + pSocket->m_bIsAccepting = true; +-#endif /* LINUX */ ++#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */ + + if( ppAddr && *ppAddr ) + { +@@ -1718,22 +1718,22 @@ oslSocket SAL_CALL osl_acceptConnectionO + int nErrno = errno; + SAL_WARN( "sal.osl", "accept connection failed: (" << nErrno << ") " << strerror(nErrno) ); + +-#if defined(LINUX) ++#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT + pSocket->m_bIsAccepting = false; +-#endif /* LINUX */ ++#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */ + return 0; + } + + assert(AddrLen == sizeof(struct sockaddr)); + +-#if defined(LINUX) ++#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT + if ( pSocket->m_bIsInShutdown ) + { + close(Connection); + SAL_WARN( "sal.osl", "close while accept" ); + return 0; + } +-#endif /* LINUX */ ++#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */ + + if(ppAddr) + { +@@ -1758,11 +1758,11 @@ oslSocket SAL_CALL osl_acceptConnectionO + + pConnectionSockImpl->m_Socket = Connection; + pConnectionSockImpl->m_nLastError = 0; +-#if defined(LINUX) ++#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT + pConnectionSockImpl->m_bIsAccepting = false; + + pSocket->m_bIsAccepting = false; +-#endif /* LINUX */ ++#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */ + return pConnectionSockImpl; + } + diff --git a/editors/libreoffice/files/patch-sal_osl_unx_sockimpl.hxx b/editors/libreoffice/files/patch-sal_osl_unx_sockimpl.hxx new file mode 100644 index 000000000000..6cdd2ca4fc02 --- /dev/null +++ b/editors/libreoffice/files/patch-sal_osl_unx_sockimpl.hxx @@ -0,0 +1,28 @@ +--- sal/osl/unx/sockimpl.hxx.orig 2015-12-11 02:29:35 UTC ++++ sal/osl/unx/sockimpl.hxx +@@ -24,11 +24,15 @@ + #include <osl/socket.h> + #include <osl/interlck.h> + ++#if defined(FREEBSD) || defined(LINUX) ++#define CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT 1 ++#endif ++ + struct oslSocketImpl { + int m_Socket; + int m_nLastError; + oslInterlockedCount m_nRefCount; +-#if defined(LINUX) ++#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT + bool m_bIsAccepting; + bool m_bIsInShutdown; + #endif +@@ -45,7 +49,7 @@ struct oslPipeImpl { + sal_Char m_Name[PATH_MAX + 1]; + oslInterlockedCount m_nRefCount; + bool m_bClosed; +-#if defined(LINUX) ++#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT + bool m_bIsAccepting; + bool m_bIsInShutdown; + #endif |