Commit Graph

58014 Commits (9edad026f4494de1a6f02ecc3f477faa27a361ef)

Author SHA1 Message Date
maxim_productengine 9773e06cc1 SL-11753 FIXED Group & Resident with the same name share chat history. 2019-08-21 16:22:43 +03:00
Nat Goodspeed d13b4d1803 Automated merge with ssh://bitbucket.org/andreykproductengine/drtvwr-493 2019-08-20 12:50:43 -04:00
Nat Goodspeed 5b5eb55f0c DRTVWR-493: Clarify capturing LLError::getFatalFunction() in a var.
VS 2013 thought we were storing an initialization-list.
2019-08-20 12:48:21 -04:00
Nat Goodspeed 54b98cb8c1 DRTVWR-493: Defend LL[Param]Singleton against ctor/init exceptions.
An exception in the LLSingleton subclass constructor, or in its
initSingleton() method, could leave the LLSingleton machinery in a bad state:
the failing instance would remain in the MasterList, also on the stack of
initializing LLSingletons. Catch exceptions in either and perform relevant
cleanup.

This problem is highlighted by test programs, in which LL_ERRS throws an
exception rather than crashing the whole process.

In the relevant catch clauses, clean up the initializing stack BEFORE logging.
Otherwise we get tangled up recording bogus dependencies.

Move capture_dependency() out of finishInitializing(): it must be called by
every valid getInstance() call, both from LLSingleton and LLParamSingleton.

Introduce new CONSTRUCTED EInitState value to distinguish "have called the
constructor but not yet the initSingleton() method" from "currently within
initSingleton() method." This is transient, but we execute the 'switch' on
state within that moment. One could argue that the previous enum used
INITIALIZING for current CONSTRUCTED, and INITIALIZED meant INITIALIZING too,
but this is clearer.

Introduce template LLSingletonBase::classname() helper methods to clarify
verbose demangle(typeid(stuff).name()) calls.

Similarly, introduce LLSingleton::pop_initializing() shorthand method.
2019-08-20 12:36:06 -04:00
Nat Goodspeed 310db14bee DRTVWR-493: Improve exception safety of LLSingleton initialization.
Add try/catch clauses to constructSingleton() (to catch exceptions in the
subclass constructor) and finishInitializing() (to catch exceptions in the
subclass initSingleton() method). Each of these catch clauses rethrows the
exception -- they're for cleanup, not for ultimate handling.

Introduce LLSingletonBase::reset_initializing(list_t::size_t). The idea is
that since we can't know whether the exception happened before or after the
push_initializing() call in LLSingletonBase's constructor, we can't just pop
the stack. Instead, constructSingleton() captures the stack size before
attempting to construct the new LLSingleton subclass. On exception, it calls
reset_initializing() to restore the stack to that size.

Naturally that requires a corresponding LLSingleton_manage_master method,
whose MasterList specialization is a no-op.

finishInitializing()'s exception handling is a bit simpler because it has a
constructed LLSingleton subclass instance in hand, therefore
push_initializing() has definitely been called, therefore it can call
pop_initializing().

Break out new static capture_dependency() method from finishInitializing()
because, in the previous LLSingleton::getInstance() implementation, the logic
now wrapped in capture_dependency() was reached even in the INITIALIZED case.
TODO: Add a new EInitState to differentiate "have been constructed, now
calling initSingleton()" from "fully initialized, normal case" -- in the
latter control path we should not be calling capture_dependency().

The LLSingleton_manage_master<LLSingletonBase::MasterList> specialization's
get_initializing() function (which called get_initializing_from()) was
potentially dangerous. get_initializing() is called by push_initializing(),
which (in the general case) is called by LLSingletonBase's constructor. If
somehow the MasterList's LLSingletonBase constructor ended up calling
get_initializing(), it would have called get_initializing_from(), passing an
LLSingletonBase which had not yet been constructed into the MasterList. In
particular, its mInitializing map would not yet have been initialized at all.

Since the MasterList must not, by design, depend on any other LLSingletons,
LLSingleton_manage_master<LLSingletonBase::MasterList>::get_initializing()
need not return a list from the official mInitializing map anyway. It can, and
should, and now does, return a static dummy list. That obviates
get_initializing_from(), which is removed.

That in turn means we no longer need to pass get_initializing() an
LLSingletonBase*. Remove that parameter.
2019-08-19 11:44:56 -04:00
Nat Goodspeed d10b06dc4f DRTVWR-493: When a test fails due to exception, display exception. 2019-08-19 10:00:09 -04:00
Ansariel cce6f93dd7 FIRE-12004: Add timer for refreshing attachments if attachments were attempted to get killed after the actual TP finished 2019-08-15 18:41:57 +02:00
PanteraPolnocy 693e6710fd Updated Polish translation 2019-08-23 03:11:41 +02:00
Ansariel c9d0920bb0 FIRE-24262: Mark user-editable fields in profile as untrusted content 2019-08-15 17:56:02 +02:00
Brad Payne (Vir Linden) bd01474e23 SL-11662 - apparently a race condition between image loading and material property setting 2019-08-15 15:08:38 +01:00
Ansariel 0be6b40b25 FIRE-24262: Introduce an explicit label for "wear_folder" SLURLs to mitigate its abuse of trying to fool people into wearing the bunny default avatar 2019-08-14 22:39:17 +02:00
Nat Goodspeed 0e6a6c7775 DRTVWR-493: Work around static initialization order problem.
LLParamSingleton contained a static member mutex. Unfortunately that wasn't
guaranteed to be initialized by the time its getInstance() was entered. Use a
function-local static instead.
2019-08-14 13:57:13 -04:00
Nat Goodspeed 63103afb65 No such thing as 'virtual static' 2019-08-14 13:43:08 -04:00
andreykproductengine be7713cab2 Merged in lindenlab/viewer-release 2019-08-14 15:02:56 +03:00
Ansariel c59dd5d76f Update legacy universal icon 2019-08-14 00:12:44 +02:00
Ansariel 2e55e8b870 Merge viewer-baking-updates 2019-08-13 22:55:06 +02:00
Ansariel fec05c06ff Merge Firestorm LGPL 2019-08-13 22:48:40 +02:00
Ansariel 247da095c0 Merge viewer-neko 2019-08-13 22:30:36 +02:00
Ansariel d9447bcd4e Merge Firestorm LGPL Bear 2019-08-13 22:28:30 +02:00
Ansariel 6d6b70d062 Merge Firestorm LGPL 2019-08-13 22:26:19 +02:00
Ansariel a9e1c96a00 Merge viewer-bear 2019-08-13 21:39:49 +02:00
Ansariel 0b135af1fc Merge Firestorm LGPL Lynx 2019-08-13 21:38:46 +02:00
Ansariel a138f375af Merge Firestorm LGPL 2019-08-13 21:35:59 +02:00
Ansariel 0654b6efb4 Merge viewer-lynx 2019-08-13 21:20:20 +02:00
Brad Payne (Vir Linden) 15db923cae merge 2019-08-13 20:08:37 +01:00
AndreyL ProductEngine 2325dca257 Merged in lindenlab/viewer-serval 2019-08-13 22:03:46 +03:00
AndreyL ProductEngine cdcdc4b3e3 Merged in lindenlab/viewer-bear 2019-08-13 21:59:37 +03:00
AndreyL ProductEngine 823cef92ed Merged in lindenlab/viewer-lynx 2019-08-13 21:58:10 +03:00
AndreyL ProductEngine ef423bfb81 Merged in lindenlab/viewer-release 2019-08-13 21:54:23 +03:00
andreykproductengine bc5d79e06e DRTVWR-493 Test fix for W64 2019-08-13 21:46:12 +03:00
Ansariel b91f29bf49 Update German translation 2019-08-13 20:35:02 +02:00
Ansariel daa60fdb2c Merge viewer-neko 2019-08-13 20:32:40 +02:00
Ansariel c3e28ce2ac Merge viewer-lynx 2019-08-13 20:21:00 +02:00
Ansariel 4087c4c077 Merge Firestorm LGPL 2019-08-13 20:17:51 +02:00
andreykproductengine 82f259b133 DRTVWR-493 Converted LLViewerParcelMediaAutoPlay to singleton 2019-08-13 20:47:02 +03:00
andreykproductengine 24a0601a50 DRTVWR-493 Reworked a number of inits 2019-08-13 20:19:46 +03:00
Ansariel 3632d52eaa Merge LL viewer-release 6.2.4 2019-08-13 19:09:09 +02:00
Ansariel 014b4ed4f4 Merge Firestorm LGPL 2019-08-13 19:07:31 +02:00
Nat Goodspeed e9ead7cc2e increment viewer version to 6.2.5 2019-08-13 12:30:44 -04:00
Nat Goodspeed b04b741945 Added tag 6.2.4-release for changeset 67297f990285 2019-08-13 12:30:44 -04:00
andreykproductengine 1233842012 SL-11718 Crash in LLRender2D 2019-08-13 17:22:58 +03:00
maxim_productengine cd25ae3e08 SL-11707 FIXED [Maint] Incorrect sound length limit referenced. 2019-08-13 12:40:32 +03:00
Nat Goodspeed 5196af8663 DRTVWR-493: Rely on recursive_mutex to handle circularity
from LLParamSingleton::initSingleton().
2019-08-12 17:47:48 -04:00
Nat Goodspeed a5f58663c0 Automated merge with ssh://bitbucket.org/andreykproductengine/drtvwr-493 2019-08-12 17:43:09 -04:00
Nat Goodspeed 4fce6dc435 DRTVWR-493: Permit LLParamSingleton::initSingleton() circularity.
This was forbidden, but AndreyK points out cases in which LLParamSingleton::
initSingleton() should in fact be allowed to circle back to its own instance()
method. Use a recursive_mutex instead of plain mutex to permit that; remove
LL_ERRS preventing it.

Add LLParamSingleton::instance() method that calls
LLParamSingleton::getInstance(). Inheriting LLSingleton::instance() called
LLSingleton::getInstance() -- not at all what we want.

Add LLParamSingleton unit tests.
2019-08-12 17:35:45 -04:00
andreykproductengine 3c552696bf DRTVWR-493 LLWearableType to LLParamSingleton 2019-08-12 22:56:15 +03:00
andreykproductengine b6a3901c2f Merge from nat_linden/drtvwr-493 2019-08-12 20:35:27 +03:00
AndreyL ProductEngine d6030c7376 SL-11719 Initialize the conversation dialog on login screen appearance to avoid crash 2019-08-12 19:54:20 +03:00
Nat Goodspeed 5a72d34b76 Automated merge with file:///Users/nat/linden/viewer-catch 2019-08-12 09:58:08 -04:00
Nat Goodspeed 98be6e141c DRTVWR-493: Streamline LLParamSingleton, LLLockedSingleton.
Simplify LLSingleton::SingletonLifetimeManager to SingletonInitializer: that
struct has not been responsible for deletion ever since LLSingletonBase
acquired dependency-ordered deleteAll().

Move SingletonData::mInitState changes from SingletonLifetimeManager to
constructSingleton() method. Similarly, constructSingleton() now sets
SingletonData::mInstance instead of making its caller store the pointer.

Add variadic arguments to LLSingleton::constructSingleton() so we can reuse it
for LLParamSingleton.

Add finishInitializing() method to encapsulate logic reused for
getInstance()'s INITIALIZING and DELETED cases.

Make LLParamSingleton a subclass of LLSingleton, just as LLLockedSingleton is
a subclass of LLParamSingleton. Make LLParamSingleton a friend of LLSingleton,
so it can access private members of LLSingleton without also granting access
to any DERIVED_CLASS subclass. This eliminates the need for protected
getInitState().

LLParamSingleton::initParamSingleton() reuses LLSingleton::constructSingleton()
and finishInitializing(). Its getInstance() method completely replaces
LLSingleton::getInstance(): in most EInitStates, LLParamSingleton::getInstance()
is an error.

Use a std::mutex to serialize calls to LLParamSingleton::initParamSingleton()
and getInstance(). While LLSingleton::getInstance() relies on the "initialized
exactly once" guarantee for block-scope static declarations, LLParamSingleton
cannot rely on the same mechanism.

LLLockedSingleton is now a very succinct subclass of LLParamSingleton -- they
have very similar functionality.

Giving the LLSINGLETON() macro variadic arguments eliminates the need for a
separate LLPARAMSINGLETON() macro, while continuing to support existing usage.
2019-08-12 09:44:56 -04:00