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

Report more debug information about caught exception

...in an attempt to track down why various tinderbox builds started to fail
CppunitTest_sw_filters_test with an "Uncaught exception during Task::Invoke()!"
abort.

On IRC, jmux claims that catching exceptions and turning them into abort() here
(instead of letting them propagate) is necessary:  "The main problem was the
wrong state in the scheduler.  So something actually handled the exception, but
the next caller into the scheduler had an invalid linked list of tasks, breaking
things left and right."

Change-Id: Ic3365e282404483518652c00160c2036b79991cf
Reviewed-on: https://gerrit.libreoffice.org/46450Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst f9712582
...@@ -21,7 +21,14 @@ ...@@ -21,7 +21,14 @@
#include <salwtype.hxx> #include <salwtype.hxx>
#include <algorithm> #include <algorithm>
#include <cstdlib>
#include <exception>
#include <typeinfo>
#include <com/sun/star/uno/Exception.hpp>
#include <cppuhelper/exc_hlp.hxx>
#include <sal/log.hxx>
#include <sal/types.h>
#include <svdata.hxx> #include <svdata.hxx>
SalUserEventList::SalUserEventList() SalUserEventList::SalUserEventList()
...@@ -90,9 +97,20 @@ bool SalUserEventList::DispatchUserEvents( bool bHandleAllCurrentEvents ) ...@@ -90,9 +97,20 @@ bool SalUserEventList::DispatchUserEvents( bool bHandleAllCurrentEvents )
{ {
ProcessEvent( aEvent ); ProcessEvent( aEvent );
} }
catch (css::uno::Exception& e)
{
auto const e2 = cppu::getCaughtException();
SAL_WARN("vcl", "Uncaught " << e2.getValueTypeName() << " " << e.Message);
std::abort();
}
catch (std::exception& e)
{
SAL_WARN("vcl", "Uncaught " << typeid(e).name() << " " << e.what());
std::abort();
}
catch (...) catch (...)
{ {
SAL_WARN( "vcl", "Uncaught exception during ProcessEvent!" ); SAL_WARN("vcl", "Uncaught exception during DispatchUserEvents!");
std::abort(); std::abort();
} }
} }
......
...@@ -20,7 +20,14 @@ ...@@ -20,7 +20,14 @@
#include <sal/config.h> #include <sal/config.h>
#include <cassert> #include <cassert>
#include <cstdlib>
#include <exception>
#include <typeinfo>
#include <com/sun/star/uno/Exception.hpp>
#include <cppuhelper/exc_hlp.hxx>
#include <sal/log.hxx>
#include <sal/types.h>
#include <svdata.hxx> #include <svdata.hxx>
#include <tools/time.hxx> #include <tools/time.hxx>
#include <unotools/configmgr.hxx> #include <unotools/configmgr.hxx>
...@@ -439,11 +446,21 @@ next_entry: ...@@ -439,11 +446,21 @@ next_entry:
{ {
pTask->Invoke(); pTask->Invoke();
} }
catch (css::uno::Exception& e)
{
auto const e2 = cppu::getCaughtException();
SAL_WARN("vcl.schedule", "Uncaught " << e2.getValueTypeName() << " " << e.Message);
std::abort();
}
catch (std::exception& e)
{
SAL_WARN("vcl.schedule", "Uncaught " << typeid(e).name() << " " << e.what());
std::abort();
}
catch (...) catch (...)
{ {
SAL_WARN( "vcl.schedule", SAL_WARN("vcl.schedule", "Uncaught exception during Task::Invoke()!");
"Uncaught exception during Task::Invoke()!" ); std::abort();
abort();
} }
Lock( nLockCount ); Lock( nLockCount );
pMostUrgent->mbInScheduler = false; pMostUrgent->mbInScheduler = false;
......
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