Commit Graph

43422 Commits (91c20363eee4e1e02435e0ee74867cdb3f6c7136)

Author SHA1 Message Date
Nat Goodspeed 91c20363ee SL-10297: Get rid of LLError::LLCallStacks::allocateStackBuffer().
Also freeStackBuffer() and all the funky classic-C string management of a big
flat buffer divided into exactly 512 128-byte strings. Define StringVector as
a std::vector<std::string>, and use that instead.

Retain the behavior of clearing the vector if it exceeds 512 entries.

This eliminates the LLError::Log::flush(const std::ostringstream&, char*)
overload as well, with its baffling mix of std::string and classic-C (e.g.
strlen(out.str().c_str()).

If we absolutely MUST use a big memory pool for performance reasons, let's
use StringVector with allocators.
2021-05-12 13:37:24 -04:00
Nat Goodspeed 5b96ee0e10 SL-10297: Eliminate llerror.cpp's Globals::messageStream and bool.
Instead of a single std::ostringstream instance shared by all callers, even
those on different threads, make each of the relevant lllog_test_() and
llcallstacks macros instantiate independent (stack) std::ostringstream
objects. lllog_test_() is called by LL_DEBUGS(), LLINFOS(), LL_WARNS(),
LL_ERRS(), LL_VLOGS() et al.

Eliminate LLError::Log::out(), whose sole function was to arbitrate use of
that shared std::ostringstream. Amusingly, if the lock couldn't be locked or
if messageStreamInUse was set, out() would allocate a new (heap!)
std::ostringstream anyway, which would then have to be freed by flush().

Make both LLError::Log::flush() overloads accept const std::ostringstream&.
Make LL_ENDL pass the local _out instance. This eliminates the need to check
whether the passed std::ostringstream* references the shared instance and
(if so) reset it or (if not) delete it.

Make LLError::LLCallStacks::insert() accept the local _out instance as non-
const std::ostream&, rather than acquiring and returning std::ostringstream*.
Make end() accept the local instance as const std::ostringstream&.
2021-05-12 12:02:57 -04:00
Nat Goodspeed 147c66d67c SL-10297: Simplify implementation of LLSingletonBase::logwarns() etc.
Introduce 'string_params' typedef for std::initialization_list<std::string>,
and make logwarns(), loginfos(), logdebugs() and logerrs() accept const
string_params&.

Eliminate the central log() function in llsingleton.cpp that used LL_VLOGS().
To cache the result of a (moderately expensive) Log::shouldLog() call,
LL_VLOGS() wants its CallSite object to be static -- but of course the
shouldLog() result will differ for different ELevel values, so LL_VLOGS()
instantiates a static array of CallSite instances. It seems silly to funnel
distinct logwarns(), etc., functions through a common log() function only to
have LL_VLOGS() tease apart ELevel values again. Instead, make logwarns()
directly invoke LL_WARNS(), and similarly for the rest.

To reduce boilerplate in these distinct functions, teach std::ostream how to
stream a string_params instance by looping over its elements. Then each
logwarns(), etc., function can simply stream its string_params argument to
LL_WARNS() or whichever.

In particular, eliminate the LLERROR_CRASH macro in logerrs(). The fact that
it invokes LL_ERRS() ensures that its LL_ENDL macro will crash the viewer.
2021-05-12 09:46:49 -04:00
Nat Goodspeed c9fc4349b7 SL-10297: Move LL_ERRS crash location into the LL_ERRS macro itself.
Introduce Oz's LLERROR_CRASH macro analogous to the old LLError::crashAndLoop()
function. Change LL_ENDL macro so that, after calling flush(), if the CallSite
is for LEVEL_ERROR, we invoke LLERROR_CRASH right there.

Change the meaning of LLError::FatalFunction. It used to be responsible for
the actual crash (hence crashAndLoop()). Now, instead, its role is to disrupt
control flow in some other way if you DON'T want to crash: throw an exception,
or call exit() or some such. Any FatalFunction that returns normally will fall
into the new crash in LL_ENDL.

Accordingly, the new default FatalFunction is a no-op lambda. This eliminates
the need to test for empty (not set) FatalFunction in Log::flush().

Remove LLError::crashAndLoop() because the official LL_ERRS crash is now in
LL_ENDL.

One of the two common use cases for setFatalFunction() used to be to intercept
control in the last moments before crashing -- not to crash or to avoid
crashing, but to capture the LL_ERRS message in some way. Especially when
that's temporary, though (e.g. LLLeap), saving and restoring the previous
FatalFunction only works when the lifespans of the relevant objects are
strictly LIFO.

Either way, that's a misuse of FatalFunction. Fortunately the Recorder
mechanism exactly addresses that case. Introduce a GenericRecorder template
subclass, with LLError::addGenericRecorder(callable) that accepts a callable
with suitable (level, message) signature, instantiates a GenericRecorder, adds
it to the logging machinery and returns the RecorderPtr for possible later use
with removeRecorder().

Change llappviewer.cpp's errorCallback() to an addGenericRecorder() callable.
Its role was simply to update gDebugInfo["FatalMessage"] with the LL_ERRS
message, then call writeDebugInfo(), before calling crashAndLoop() to finish
crashing. Remove the crashAndLoop() call, retaining the gDebugInfo logic. Pass
errorCallback() to LLError::addGenericRecorder() instead of setFatalFunction().

Oddly, errorCallback()'s crashAndLoop() call was conditional on a compile-time
SHADER_CRASH_NONFATAL symbol. The new mechanism provides no way to support
SHADER_CRASH_NONFATAL -- it is a Bad Idea to return normally from any LL_ERRS
invocation!

Rename LLLeapImpl::fatalFunction() to onError(). Instead of passing it to
LLError::setFatalFunction(), pass it to addGenericRecorder(). Capture the
returned RecorderPtr in mRecorder, replacing mPrevFatalFunction. Then
~LLLeapImpl() calls removeRecorder(mRecorder) instead of restoring
mPrevFatalFunction (which, as noted above, was order-sensitive).

Of course, every enabled Recorder is called with every log message. onError()
and errorCallback() must specifically test for calls with LEVEL_ERROR.

LLSingletonBase::logerrs() used to call LLError::getFatalFunction(), check the
return and call it if non-empty, else call LLError::crashAndLoop(). Replace
all that with LLERROR_CRASH.

Remove from llappviewer.cpp the watchdog_llerrs_callback() and
watchdog_killer_callback() functions. watchdog_killer_callback(), passed to
Watchdog::init(), used to setFatalFunction(watchdog_llerrs_callback) and then
invoke LL_ERRS() -- which seems a bit roundabout. watchdog_llerrs_callback(),
in turn, replicated much of the logic in the primary errorCallback() function
before replicating the crash from llwatchdog.cpp's default_killer_callback().

Instead, pass LLWatchdog::init() a lambda that invokes the LL_ERRS() message
formerly found in watchdog_killer_callback(). It no longer needs to override
FatalFunction with watchdog_llerrs_callback() because errorCallback() will
still be called as a Recorder, obviating watchdog_llerrs_callback()'s first
half; and LL_ENDL will handle the crash, obviating the second half.

Remove from llappviewer.cpp the static fast_exit() function, which was simply
an alias for _exit() acceptable to boost::bind(). Use a lambda directly
calling _exit() instead of using boost::bind() at all.

In the CaptureLog class in llcommon/tests/wrapllerrs.h, instead of statically
referencing the wouldHaveCrashed() function from test.cpp, simply save and
restore the current FatalFunction across the LLError::saveAndResetSettings()
call.

llerror_test.cpp calls setFatalFunction(fatalCall), where fatalCall() was a
function that simply set a fatalWasCalled bool rather than actually crashing
in any way. Of course, that implementation would now lead to crashing the test
program. Make fatalCall() throw a new FatalWasCalled exception. Introduce a
CATCH(LL_ERRS("tag"), "message") macro that expands to:
LL_ERRS("tag") << "message" << LL_ENDL;
within a try/catch block that catches FatalWasCalled and sets the same bool.

Change all existing LL_ERRS() in llerror_test.cpp to corresponding CATCH()
calls. In fact there's also an LL_DEBUGS(bad tag) invocation that exercises an
LL_ERRS internal to llerror.cpp; wrap that too.
2021-05-11 21:42:14 -04:00
Nat Goodspeed 95d8085fa4 SL-10297: Make LLSingletonBase::llerrs() et al. runtime variadic.
Instead of accepting a fixed list of (const char* p1="", etc.), accept
(std::initializer_list<std::string_view>). Accepting a
std::initializer_list<T> in your parameter list allows coding (e.g.)
func({T0, T1, T2, ... });
-- in other words, you can pass the initializer_list a brace-enclosed list of
an arbitrary number of instances of T.

Using std::string_view instead of const char* means we can pass *either* const
char* or std::string. string_view is cheaply constructed from either, allowing
uniform treatment within the function.

Constructing string_view from std::string simply extracts the pointer and
length from the std::string.

Constructing string_view from const char* (e.g. a "string literal") requires
scanning the string for its terminating nul byte -- but that would be
necessary even if the scan were deferred until the function body. Since
string_view stores the length, the scan still happens only once.
2021-05-10 15:21:51 -04:00
Nat Goodspeed ce65bc2f13 Increment viewer version to 6.4.19
following promotion of DRTVWR-515
2021-04-29 12:26:23 -04:00
Andrey Kleshchev 4a99fe56d9 SL-14914 New release viewer install updated to RC unexpectedly
Requested behavior: First install of a new viewer should never prompt to update to any RC.
Anfortunately neither viewer nor updater can tell the difference betwen RC and optional release update, so setting updater to download only required updates.
2021-04-15 17:35:43 +03:00
Andrey Kleshchev 18323f019f SL-15061 Crash deleting non-zero reference in LLConversationItemSession 2021-04-01 20:56:19 +03:00
Andrey Lihatskiy 6240168f24 Merge branch 'master' into DRTVWR-515-maint 2021-04-01 20:45:06 +03:00
Nat Goodspeed 167e45e309 Increment viewer version to 6.4.18
following promotion of DRTVWR-514
2021-04-01 13:37:32 -04:00
Mnikolenko Productengine e51ec77431 SL-15053 Use previous icon for Nearby chat 2021-04-01 13:47:18 +03:00
Andrey Kleshchev b0de02aa02 SL-14993 Crash accessing mInvBindMatrix 2021-03-23 20:54:54 +02:00
Andrey Kleshchev 9fc1b51ae8 SL-14993 Crash accessing mInvBindMatrix 2021-03-23 01:08:38 +02:00
Andrey Lihatskiy 9a36df5763 Merge branch 'master' into DRTVWR-514-keymappings 2021-03-09 21:59:14 +02:00
Andrey Lihatskiy bb17e4b78e Merge branch 'master' into DRTVWR-515-maint 2021-03-09 21:56:14 +02:00
Nat Goodspeed 88d837c16e Increment viewer version to 6.4.17
following promotion of DRTVWR-532
2021-03-09 14:49:29 -05:00
Brad Payne (Vir Linden) bfd4abbf92 Increment viewer version to 6.4.16 following revert of DRTVWR-519 2021-03-08 13:58:35 +00:00
Brad Payne (Vir Linden) c83e740ef9 Revert "Merge branch 'master' of https://bitbucket.org/lindenlab/viewer into DRTVWR-519"
This reverts commit e61f485a04, reversing
changes made to 00c47d079f.
2021-03-08 13:56:16 +00:00
Brad Payne (Vir Linden) 54c2608d45 SL-12122 - removed frametime spikes in windows build caused by unnecessary call to GetPerformanceInfo() 2021-03-02 22:27:45 +02:00
Andrey Lihatskiy 35550e36db Merge branch 'master' into DRTVWR-515-maint 2021-03-02 21:41:26 +02:00
Andrey Lihatskiy f271ba3277 Merge branch 'master' into DRTVWR-514-keymappings 2021-03-02 21:41:13 +02:00
Nat Goodspeed 2b385841f3 Increment viewer version to 6.4.15
following promotion of DRTVWR-519
2021-03-02 14:28:57 -05:00
Mnikolenko Productengine ba608514e1 SL-13609 Don't use any icon for Nearby chat 2021-03-01 17:16:07 +02:00
Andrey Kleshchev bc8bf1cb54 SL-13788 Detecting Intel HD 400 as just Intel HD
CPU based detection in case Intel HD Graphics got detected
2021-02-24 14:41:21 +02:00
Andrey Kleshchev 31bb38a6f3 SL-13788 Some Intel gpus are recognized as just Intel HD Graphics 2021-02-18 18:11:20 +02:00
Andrey Lihatskiy 003f396d2f Merge branch 'master' into DRTVWR-514-keymappings 2021-02-17 21:22:22 +02:00
Andrey Lihatskiy ba8dcf906d Merge branch 'master' into DRTVWR-515-maint 2021-02-17 21:20:08 +02:00
unknown e61f485a04 Merge branch 'master' of https://bitbucket.org/lindenlab/viewer into DRTVWR-519 2021-02-17 09:51:18 -08:00
Nat Goodspeed 00c47d079f Increment viewer version to 6.4.14
following promotion of DRTVWR-517
2021-02-17 11:00:52 -05:00
Andrey Kleshchev 0e3d8023dc SL-12795 Fix log session name not updating 2021-02-11 18:49:11 +02:00
Andrey Kleshchev 03eddbd627 SL-11215 Fixed unit test 2021-02-11 00:32:29 +02:00
Andrey Kleshchev af7554a835 SL-11215 Release notes url should be an url 2021-02-10 22:40:40 +02:00
Andrey Kleshchev aee03dfe74 SL-14828 Update web_profile_url for Aditi 2021-02-04 21:27:36 +02:00
Callum Prentice d26567915c Merge with Master after Viewer release 2021-02-03 09:31:32 -08:00
Andrey Lihatskiy 2da7bc83b5 Updated LLCA to codeticket build 555615 2021-02-02 19:08:12 +02:00
Andrey Kleshchev 44b6459dfa Merge branch 'master' into DRTVWR-514-keymappings
# Conflicts:
#	indra/llui/llscrolllistctrl.cpp
2021-02-01 23:33:41 +02:00
Andrey Kleshchev 7396a528c0 Temporary revert "Updated LLCA to codeticket build 555537"
This reverts commit eac0f1857c.
2021-02-01 23:03:56 +02:00
Andrey Kleshchev 609a26b59a Merge branch 'master' of https://bitbucket.org/lindenlab/viewer/src/master into DRTVWR-515-maint
# Conflicts:
#	autobuild.xml (llca)
#	indra/llwindow/llwindow.h (SL-13507 vs SL-5894)
#	indra/newview/llscenemonitor.cpp (SL-14422)
#	indra/newview/llvovolume.cpp (SL-12069)
2021-02-01 22:28:15 +02:00
Brad Payne (Vir Linden) 665598a5ba Merge remote-tracking branch 'origin/master' into DRTVWR-517 2021-02-01 20:20:33 +00:00
Nat Goodspeed 21565a1f3f Increment viewer version to 6.4.13
following promotion of DRTVWR-513
2021-02-01 14:51:28 -05:00
Andrey Lihatskiy eac0f1857c Updated LLCA to codeticket build 555537 2021-02-01 09:22:53 +02:00
Andrey Kleshchev 6c2c8c62db SL-14793 Landmark fetching not cleaning request list on completion 2021-01-30 01:23:04 +02:00
Andrey Kleshchev b36082170e SL-14767 Expanded logging to be a bit more informative 2021-01-28 23:30:27 +02:00
Andrey Kleshchev d3169aa696 SL-14423 Ctrl+Alt+Shift+A is assigned to 2 things
Remapped debugging avatar textures (requires godlike agent) to Ctrl+Shift+Alt+K
2021-01-27 19:18:22 +02:00
Andrey Kleshchev abdfc65f56 SL-14424 Remove shortcut that conflicts with camera controls 2021-01-27 18:47:54 +02:00
Mnikolenko Productengine 9fc3014435 SL-14422 Crash at LLSceneMonitor::dumpToFile 2021-01-27 18:32:41 +02:00
Andrey Kleshchev 958991ec4d SL-14651 Keybinding's panel combobox can cause confusion 2021-01-26 23:26:56 +02:00
Andrey Kleshchev a3d31ca683 SL-14766 long unicode display names corrupt the conversation.log
Contribution by Beq Janus
2021-01-26 20:28:31 +02:00
Andrey Kleshchev 0e4faf7d9c SL-12198 Pull in updated version checker 2021-01-26 01:03:00 +02:00
Callum Prentice 7528855442 TeamCity not happy and only thing left to try is a dummy (whitespace) commit 2021-01-25 13:26:39 -08:00