Kaydet (Commit) ef48b583 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Revert fix for "#i86306# prepare against really broken CUPS installations..."

...from 8046a87e.  At least sometimes in
sw_complex test (with various bundled Java extensions enabled) under load, this
code reports "Signal 11 during cups initialization called, ignoring cups" and
in-process JVM aborts in panic.  Looks like a legitimate SIGSEGV (to be
translated into java.lang.NullPointerException) from JVM code is erroneously
caught by the temporary lcl_signal_action in cupsmgr.cxx instead.  As there is
no non-cooperative way to have different signal handlers for different threads
(at least under POSIX), and
<https://issues.apache.org/ooo/show_bug.cgi?id=86306> "office crashes at startup
on Solaris Intel" suggests this signal-catching business is only there to work
around a completely broken machine, I think it is best to simply remove it
again.

Change-Id: I55b95a71d622f83c975989a4ffb1d95ef5737075
üst 8ba9f9cd
...@@ -43,8 +43,6 @@ ...@@ -43,8 +43,6 @@
#include "rtl/ustrbuf.hxx" #include "rtl/ustrbuf.hxx"
#include <algorithm> #include <algorithm>
#include <setjmp.h>
#include <signal.h>
#define CUPS_LIB_NAME "libcups.so.2" #define CUPS_LIB_NAME "libcups.so.2"
...@@ -442,17 +440,6 @@ void CUPSManager::runDestThread( void* pThis ) ...@@ -442,17 +440,6 @@ void CUPSManager::runDestThread( void* pThis )
((CUPSManager*)pThis)->runDests(); ((CUPSManager*)pThis)->runDests();
} }
static sigjmp_buf aViolationBuffer;
extern "C"
{
static void lcl_signal_action(int nSignal)
{
fprintf( stderr, "Signal %d during cups initialization called, ignoring cups\n", nSignal );
siglongjmp( aViolationBuffer, 1 );
}
}
void CUPSManager::runDests() void CUPSManager::runDests()
{ {
#if OSL_DEBUG_LEVEL > 1 #if OSL_DEBUG_LEVEL > 1
...@@ -460,62 +447,29 @@ void CUPSManager::runDests() ...@@ -460,62 +447,29 @@ void CUPSManager::runDests()
#endif #endif
cups_dest_t* pDests = NULL; cups_dest_t* pDests = NULL;
// #i86306# prepare against really broken CUPS installations / missing servers // n#722902 - do a fast-failing check for cups working *at all* first
http_t* p_http;
// install signal handler for SEGV, BUS and ABRT if( (p_http=m_pCUPSWrapper->httpConnectEncrypt(
struct sigaction act; m_pCUPSWrapper->cupsServer(),
struct sigaction oact[3]; m_pCUPSWrapper->ippPort(),
m_pCUPSWrapper->cupsEncryption())) != NULL )
act.sa_handler = lcl_signal_action;
act.sa_flags = 0;
sigemptyset(&(act.sa_mask));
int nSegvSignalInstalled = sigaction(SIGSEGV, &act, &oact[0]);
int nBusSignalInstalled = sigaction(SIGBUS, &act, &oact[1]);
int nAbortSignalInstalled = sigaction(SIGABRT, &act, &oact[2]);
// prepare against a signal during FcInit or FcConfigGetCurrent
if( sigsetjmp( aViolationBuffer, ~0 ) == 0 )
{ {
// n#722902 - do a fast-failing check for cups working *at // neat, cups is up, clean up the canary
// all* first m_pCUPSWrapper->httpClose(p_http);
http_t* p_http;
if( (p_http=m_pCUPSWrapper->httpConnectEncrypt(
m_pCUPSWrapper->cupsServer(),
m_pCUPSWrapper->ippPort(),
m_pCUPSWrapper->cupsEncryption())) != NULL )
{
// neat, cups is up, clean up the canary
m_pCUPSWrapper->httpClose(p_http);
int nDests = m_pCUPSWrapper->cupsGetDests( &pDests ); int nDests = m_pCUPSWrapper->cupsGetDests( &pDests );
#if OSL_DEBUG_LEVEL > 1 #if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "came out of cupsGetDests\n" ); fprintf( stderr, "came out of cupsGetDests\n" );
#endif #endif
osl::MutexGuard aGuard( m_aCUPSMutex ); osl::MutexGuard aGuard( m_aCUPSMutex );
m_nDests = nDests; m_nDests = nDests;
m_pDests = pDests; m_pDests = pDests;
m_bNewDests = true; m_bNewDests = true;
#if OSL_DEBUG_LEVEL > 1 #if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "finished cupsGetDests\n" ); fprintf( stderr, "finished cupsGetDests\n" );
#endif #endif
}
} }
else
{
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "cupsGetDests crashed, not using CUPS\n" );
#endif
}
// restore old signal handlers
if( nSegvSignalInstalled == 0 )
sigaction( SIGSEGV, &oact[0], NULL );
if( nBusSignalInstalled == 0 )
sigaction( SIGBUS, &oact[1], NULL );
if( nAbortSignalInstalled == 0 )
sigaction( SIGABRT, &oact[2], NULL );
} }
void CUPSManager::initialize() void CUPSManager::initialize()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment