Commit Graph

40547 Commits (91cca79c1453be22b878c00a0c51abaedba4f21a)

Author SHA1 Message Date
Nat Goodspeed 91cca79c14 DRTVWR-476: #include "boost/noncopyable.hpp" in another consumer. 2020-04-09 08:06:46 -04:00
Nat Goodspeed c7cf322be5 DRTVWR-476: #include "boost/noncopyable.hpp" in httpcommon.h.
Apparently, in previous Boost versions, boost::noncopyable was sneaking into
the namespace via other headers. Now the compiler complains about its absence
without an explicit #include.
2020-04-09 06:49:49 -04:00
Nat Goodspeed 320787f405 DRTVWR-476: Update zlib, freetype, libpng, boost, openssl, libxml2, googlemock, google_breakpad, curl, colladadom
Update zlib to codeticket version 538988.
Update freetype to codeticket version 539865.
Update libpng to codeticket version 539868.
Update boost to codeticket version 539869.
Update openssl to codeticket version 539874.
Update libxml2 to codeticket version 539866.
Update googlemock to codeticket version 539876.
Update google_breakpad to codeticket version 539880.
Update curl to codeticket version 539883.
Update colladadom to codeticket version 539922.
2020-04-08 20:20:32 -04:00
Nat Goodspeed 9db2439240 DRTVWR-476: Update openssl, zlib, freetype, libxml2, libpng, boost, google_breakpad, curl, googlemock, colladadom
Update openssl to codeticket version 539835.
Update zlib to codeticket version 538988.
Update freetype to codeticket version 539828.
Update libxml2 to codeticket version 539829.
Update libpng to codeticket version 539830.
Update boost to codeticket version 539833.
Update google_breakpad to codeticket version 539846.
Update curl to codeticket version 539847.
Update googlemock to codeticket version 539769.
Update colladadom to codeticket version 539768.
2020-04-08 10:31:16 -04:00
Nat Goodspeed 1bf3448fd4 DRTVWR-476: Update boost, colladadom, googlemock
Update boost to codeticket version 539746.
Update colladadom to codeticket version 539768.
Update googlemock to codeticket version 539769.
2020-04-07 14:50:24 -04:00
Nat Goodspeed c4d1cc9e9c DRTVWR-476: Update to slvoice build 539691 2020-04-03 16:44:05 -04:00
Nat Goodspeed d979ba68ee DRTVWR-476: Use a longer default timeout for Sync class.
The timeout is meant to prevent a deadlocked test program from hanging a
build. It's not intended to ensure some sort of SLA for the operations under
test. Empirically, using a longer timeout helps some test programs. The only
downside of increasing the timeout is that if some test does hang, it takes
longer to notice. But changes on the order of a few seconds are negligible.
2020-04-03 10:54:37 -04:00
Nat Goodspeed fde7dad001 DRTVWR-476: Make LoginListener::waitFor() take arbitrary predicate.
This allows one of the tests to specifically waitFor() the completion status
update from LLLogin, rather than the next status update to come along: the
coroutine potentially emits a whole sequence of status updates before
completion.

Then the waitFor() overload that merely waits for the next status update is
implemented by passing that specific predicate to the other overload.
2020-04-03 10:49:16 -04:00
Nat Goodspeed 5ced20b1a9 DRTVWR-476: chained_callback.h depends on lltut.h. #include it. 2020-04-03 10:48:03 -04:00
Nat Goodspeed 962ccb4f01 DRTVWR-476: Facilitate debugging test programs with logging.
On Mac, even if you run a test program with --debug or set LOGTEST=DEBUG, it
won't log to stderr if you're filtering build output or running the build in
an emacs compile buffer. This is because, on Mac, a viewer launched by mouse
rather than from the command line is passed a stderr stream that ultimately
gets logged to the system Console. The shouldLogToStderr() function is
intended to avoid spamming the Console with the (voluminous) viewer log
output. It tests whether stderr isatty() and, if not, suppresses calling
LLError::logToStderr().

This makes debugging test programs using log output trickier than necessary.
Change shouldLogToStderr() to permit logging when either stderr isatty() or is
a pipe. The original intention is preserved in that empirically, a viewer
launched by mouse is passed a stderr stream identified as a character device
rather than as a pipe.

Also introduce SetEnv, a class that facilitates setting (e.g.) LOGTEST=DEBUG
for specific test programs without setting it for all test programs in the
build. Using the constructor for a static object means you can set environment
variables before main() is entered, which is important because it's the main()
function in test.cpp that acts on the LOGTEST and LOGFAIL environment
variables.

These changes make it unnecessary to retain the temporary change in test.cpp
to force LOGTEST to DEBUG.
2020-04-03 10:46:17 -04:00
Nat Goodspeed dc07509f29 DRTVWR-476: Cherry-pick debug aids from commit 77b0c53 (fiber-mutex) 2020-04-03 10:38:53 -04:00
Nat Goodspeed b793ab8619 DRTVWR-476: Apparently it can take more than 2s for threads to chat.
llmainthreadtask_test builds in a Sync timeout to keep build-time tests from
hanging. That timeout was set to 2000ms, which seems as though it ought to be
plenty enough time for a process with only 2 threads to exchange data between
them. But on TeamCity EC2 Windows build hosts, sometimes we hit that timeout
and fail. Extend it to try to improve the robustness of builds, even though
the possibility of a production viewer blocking for that long for anything
seems worrisome. (Fortunately the production viewer does not use Sync.)
2020-03-26 17:51:06 -04:00
Nat Goodspeed 84a7ec90b3 DRTVWR-476: Fix glitches from lindenlab/viewer master branch merge. 2020-03-26 11:00:52 -04:00
Nat Goodspeed 8fb39231db DRTVWR-476: Update tut, llca, pcre, bugsplat, zlib, expat, nvapi, glext, vlc-bin, viewer-manager, uriparser, slvoice, openjpeg, ogg_vorbis, llphysicsextensions_source, libndofdev, libhunspell, jsoncpp, jpeglib, glod, glh_linear, fmodex, dictionaries, nghttp2, libxml2, openssl, libpng, freetype, xmlrpc-epi, apr_suite, dullahan, google_breakpad, curl, kdu, havok-source, boost, colladadom, googlemock
Update tut to codeticket version 539059.
Update llca to codeticket version 539061.
Update pcre to codeticket version 538986.
Update bugsplat to codeticket version 538987.
Update zlib to codeticket version 538988.
Update expat to codeticket version 538990.
Update nvapi to codeticket version 539058.
Update glext to codeticket version 538965.
Update vlc-bin to codeticket version 538966.
Update viewer-manager to codeticket version 538967.
Update uriparser to codeticket version 538968.
Update slvoice to codeticket version 538969.
Update openjpeg to codeticket version 538970.
Update ogg_vorbis to codeticket version 538971.
Update llphysicsextensions_source to codeticket version 538972.
Update libndofdev to codeticket version 538973.
Update libhunspell to codeticket version 538974.
Update jsoncpp to codeticket version 538976.
Update jpeglib to codeticket version 538977.
Update glod to codeticket version 538980.
Update glh_linear to codeticket version 538981.
Update fmodex to codeticket version 538982.
Update dictionaries to codeticket version 538984.
Update nghttp2 to codeticket version 538985.
Update libxml2 to codeticket version 539066.
Update openssl to codeticket version 539067.
Update libpng to codeticket version 539069.
Update freetype to codeticket version 539071.
Update xmlrpc-epi to codeticket version 539072.
Update apr_suite to codeticket version 539073.
Update dullahan to codeticket version 539088.
Update google_breakpad to codeticket version 539090.
Update curl to codeticket version 539091.
Update kdu to codeticket version 539108.
Update havok-source to codeticket version 539117.
Update boost to codeticket version 539140.
Update colladadom to codeticket version 539147.
Update googlemock to codeticket version 539148.
2020-03-25 19:28:43 -04:00
Nat Goodspeed 26c5950965 DRTVWR-476: Eliminate LLWearableType LLSingleton circularity.
LLWearableType::initSingleton() calls LLWearableDictionary::initParamSingleton().
LLWearableDictionary's constructor constructs specific WearableEntry
instances, each of which wants to translate its name string to a user-facing
label using LLWearableType::mTrans.

WearableEntry's constructor was calling LLWearableType::getInstance(). Under
circumstances we don't fully understand (recursive mutex misbehavior?), that
could hang.

Instead, pass the canonical LLWearableType instance to LLWearableDictionary's
constructor, and from there into WearableEntry's constructor.
2020-03-25 19:28:42 -04:00
Nat Goodspeed ce36ef8242 DRTVWR-476: Use LLThreadSafeQueue::close() to shut down coprocs.
The tactic of pushing an empty QueuedCoproc::ptr_t to signal coprocedure close
only works for LLCoprocedurePools with a single coprocedure (e.g. "Upload" and
"AIS"). Only one coprocedureInvokerCoro() coroutine will pop that empty
pointer and shut down properly -- the rest will continue waiting indefinitely.

Rather than pushing some number of empty pointers, hopefully enough to notify
all consumer coroutines, close() the queue. That will notify as many consumers
as there may be.

That means catching LLThreadSafeQueueInterrupt from popBack(), instead of
detecting empty pointer.

Also, if a queued coprocedure throws an exception, coprocedureInvokerCoro()
logs it as before -- but instead of rethrowing it, the coroutine now loops
back to wait for more work. Otherwise, the number of coroutines servicing the
queue dwindles.
2020-03-25 19:25:42 -04:00
Nat Goodspeed 5c92047e82 DRTVWR-476: Introduce LLThreadSafeQueue::close().
Also isClosed() and explicit operator bool() to detect closed state.

close() causes every subsequent pushFront() to throw
LLThreadSafeQueueInterrupt. Once the queue is drained, it causes popBack() to
throw likewise.
2020-03-25 19:25:42 -04:00
Nat Goodspeed 0756885ead DRTVWR-476: make printActiveCoroutines() output slightly clearer.
For the main coroutine on each thread, show the 'main0' (or whatever) name
instead of the empty-string name.
2020-03-25 19:25:42 -04:00
Nat Goodspeed 1c62f52af8 DRTVWR-476: LLChannelManager depends on LLUI. Tell LLSingleton. 2020-03-25 19:25:42 -04:00
Nat Goodspeed 4a046b844b DRTVWR-476: Re-enable LLInstanceTracker tests disabled months ago. 2020-03-25 19:25:42 -04:00
Nat Goodspeed 871c0cfe9d DRTVWR-476: Update boost, colladadom, googlemock
Update boost to codeticket version 533856.
Update colladadom to codeticket version 533872.
Update googlemock to codeticket version 533873.
2020-03-25 19:25:42 -04:00
Nat Goodspeed d1175e8fa1 DRTVWR-476: Log calls to LLParamSingleton::initParamSingleton(). 2020-03-25 19:25:42 -04:00
Nat Goodspeed fa450ea849 DRTVWR-476: Update LLMainThreadTask tests for simpler API. 2020-03-25 19:25:42 -04:00
Nat Goodspeed c50db83365 DRTVWR-476: Fix merge glitch. 2020-03-25 19:25:41 -04:00
Nat Goodspeed 5689b311c7 DRTVWR-476: Update viewer-manager to codeticket version 533794. 2020-03-25 19:24:25 -04:00
Nat Goodspeed 79f3bda1a5 DRTVWR-476: On Windows, use prebuilt Boost.Stacktrace. 2020-03-25 19:24:25 -04:00
Nat Goodspeed 557a74fbdd DRTVWR-476: Adapt LLInstanceTracker::snapshot for VS limitations. 2020-03-25 19:24:25 -04:00
Nat Goodspeed e1e9247a31 DRTVWR-476: Update boost, colladadom, googlemock
Update boost to codeticket version 533684.
Update colladadom to codeticket version 533705.
Update googlemock to codeticket version 533706.
2020-03-25 19:24:25 -04:00
Nat Goodspeed 38da7d5d5f DRTVWR-476: Add unit tests for LLMainThreadTask.
Now that we have the Sync class to help construct unit tests that move forward
in a deterministic stepwise order, we can build suitable unit tests for
LLMainThreadTask.
2020-03-25 19:24:25 -04:00
Nat Goodspeed 1efb4aefed DRTVWR-476: LLTHROW() requires LLException or subclass. 2020-03-25 19:24:25 -04:00
Nat Goodspeed 39e7b48317 DRTVWR-476: Make llcoro::logname() distinguish different threads.
Actually, introduce static LLCoros::logname() and make the namespaced free
function an alias for that.

Because CoroData is a subclass of LLInstanceTracker with a key, every instance
requires a distinct key. That conflicts with our "getName() returns empty
string for default coroutine on thread" convention. Introduce a new CoroData
constructor, specifically for the default coroutine on each thread, that
initializes the getName() name to empty string while providing a distinct
"mainN" key. Make get_CoroData() use that new constructor for its thread_local
instance, passing an atomic<int> incremented each time we initialize one for a
new thread.

Then LLCoros::logname() returns either the getName() name or the key.
2020-03-25 19:24:25 -04:00
Nat Goodspeed 3cd2beb97e DRTVWR-476: Make Sync::bump() atomic, add set() method.
Using Sync with multiple threads is trickier than with coroutines. In
particular, Sync::bump() was racy (get() and set() as two different
operations), and threads were proceeding when they should have waited.

Fortunately LLCond, on which Sync is based, already supports atomic update
operations. Use that for bump().

But to nail things down even more specifically, add set(n) to complement
yield_until(n). Using those methods, there should be no ambiguity about which
call in one thread synchronizes with which call in the other thread.
2020-03-25 19:24:25 -04:00
Nat Goodspeed 80f913fadb DRTVWR-476: Adjust LLCoros to new LLInstanceTracker API. 2020-03-25 19:24:25 -04:00
Nat Goodspeed 2a56ab4436 DRTVWR-476, SL-12197: Don't throw Stopping from main coroutine.
The new LLCoros::Stop exception is intended to terminate long-lived coroutines
-- not interrupt mainstream shutdown processing. Only throw it on an
explicitly-launched coroutine.

Make LLCoros::getName() (used by the above test) static. As with other LLCoros
methods, it might be called after the LLCoros LLSingleton instance has been
deleted. Requiring the caller to call instance() implies a possible need to
also call wasDeleted(). Encapsulate that nuance into a static method instead.
2020-03-25 19:24:25 -04:00
Nat Goodspeed 95cf6dddae DRTVWR-476,SL-11215,SL-11216: Update to viewer-manager build 533067 2020-03-25 19:21:16 -04:00
Nat Goodspeed 9ef702db11 DRTVWR-476: Enrich LLExceptions thrown by LLTHROW() with stack trace.
The LLTHROW() abstraction allows us to enrich the subject exception with a
boost::stacktrace -- without having to propagate the boost/stacktrace.hpp
header throughout the code base.

To my delight, our existing use of
boost::current_exception_diagnostic_information() already reports the newly
added boost::stacktrace information -- we don't have to query it specifically!
2020-03-25 19:21:16 -04:00
Nat Goodspeed b41a2eff45 DRTVWR-476: Add LLTHROW()/LOG_UNHANDLED_EXCEPTION() test.
llexception_test.cpp is about discovering appropriate infrastructure to get
good information from the LLTHROW() and LOG_UNHANDLED_EXCEPTION() mechanism.
But we didn't before have a test that actually exercises them. Now we do.
2020-03-25 19:21:16 -04:00
Nat Goodspeed cc9bdbcf19 DRTVWR-476: Introduce LLStacktrace, a token to stream stack trace.
LLStacktrace has no behavior except when you stream an instance to a
std::ostream. Then it reports the current traceback at that point to the
ostream.

This bit of indirection is intended to avoid the boost/stacktrace.hpp header
from being included everywhere.
2020-03-25 19:21:16 -04:00
Nat Goodspeed 582f9e156e DRTVWR-476: Have to package libhunspell dylib now, not .a lib. 2020-03-25 19:07:22 -04:00
Nat Goodspeed c91e5e3a24 DRTVWR-476: Remove diagnostics around 'SetFile -a V' commands.
Earlier versions of macOS manifested frustrating problems in finishing the
built package. Those build steps seem to have been behaving better for a few
years now. Eliminate (what we fervently hope has become) a bit of ancient cruft.
2020-03-25 19:07:22 -04:00
Nat Goodspeed fc2437fb5d DRTVWR-476: Introduce LLCoprocedureManager::close(). Use in tests.
The new close(void) method simply acquires the logic from
~LLCoprocedureManager() (which now calls close()). It's useful, even if only
in test programs, to be able to shut down all existing LLCoprocedurePools
without having to name them individually -- and without having to destroy the
LLCoprocedureManager singleton instance. Deleting an LLSingleton should be
done only once per process, whereas test programs want to reset the
LLCoprocedureManager after each test.
2020-03-25 19:07:22 -04:00
Nat Goodspeed 39f4acd921 DRTVWR-476: Conflate LOGFAIL env var empty with completely unset.
Sometimes it's useful to be able to temporarily override an existing LOGFAIL
setting in the current environment. It's far more convenient to prepend
LOGFAIL='' to a command than to 'unset LOGFAIL' as a whole separate command --
and then remember to restore its previous value.
2020-03-25 19:07:22 -04:00
Nat Goodspeed bf8aea5059 DRTVWR-476: Use LLThreadSafeQueue, not boost::fibers::buffered_channel.
We've observed buffered_channel::try_push() hanging, which seems very odd. Try
our own LLThreadSafeQueue instead.
2020-03-25 19:07:22 -04:00
Nat Goodspeed af35391114 DRTVWR-476: Make LLThreadSafeQueue coroutine-safe as well. 2020-03-25 19:07:22 -04:00
Nat Goodspeed b461b5dcef DRTVWR-476: Manually count items in LLCoprocedurePool's pending queue.
Reinstate LLCoprocedureManager::countPending() and count() methods. These were
removed because boost::fibers::buffered_channel has no size() method, but
since all users run within a single thread, it works to increment and
decrement a simple counter.

Add count information and max queue size to log messages.
2020-03-25 19:06:13 -04:00
Nat Goodspeed 7826683fa2 DRTVWR-476: Back out 355d9db4a59f: unroll stderr redirection. 2020-03-25 19:06:13 -04:00
Nat Goodspeed 99d4ddc668 DRTVWR-476: Back out e913c05d43b6: unroll stderr redirection. 2020-03-25 19:06:13 -04:00
Nat Goodspeed d94e4613ca DRTVWR-476: Back out e66ec842b851: unrolling stderr redirection. 2020-03-25 19:06:13 -04:00
Nat Goodspeed 950204a5d7 DRTVWR-476: Partially revert 978e09882565: undo using LLTempRedirect.
But leave LLTempRedirect available in the code base.
2020-03-25 19:06:13 -04:00
Nat Goodspeed 7ef10fe11c DRTVWR-476: Don't test configuration.emptyMap().
LLSD::emptyMap() is a factory for an empty map instance, NOT a predicate on
any particular instance. In fact checking configuration.isUndefined() and
testing whether the map is empty are both subsumed by (! configuration).
2020-03-25 19:06:13 -04:00