Commit Graph

115 Commits (master)

Author SHA1 Message Date
Ansariel dac7725c40 Merge branch 'release/2024.12-ForeverFPS' of https://github.com/secondlife/viewer
# Conflicts:
#	indra/newview/llappviewer.cpp
#	indra/newview/llviewerobjectlist.cpp
#	indra/newview/skins/default/xui/en/panel_preferences_setup.xml
#	indra/newview/skins/default/xui/ja/panel_preferences_setup.xml
2025-02-03 16:11:21 +01:00
Andrey Kleshchev fd577e3bfc #3400 Reimplement LLError marker for crash statistics 2025-01-30 01:35:49 +02:00
Ansariel 8758495d11 Merge branch 'release/2024.12-ForeverFPS' of https://github.com/secondlife/viewer
# Conflicts:
#	indra/llcommon/llerror.cpp
#	indra/llmath/v4math.h
#	indra/llui/lltransutil.cpp
#	indra/newview/llface.cpp
#	indra/newview/llstartup.cpp
#	indra/newview/llvovolume.cpp
2025-01-26 00:07:35 +01:00
Andrey Kleshchev ad375d6116 viewer#3088 Report out of memory as a separate 'category' 2025-01-22 16:06:30 +02:00
Brad Linden 92e25ef738 Attempt to get better file/line info for LL_ERRS crashes in bugsplat. (#2447)
secondlife/viewer#2445
2024-10-17 01:35:23 +01:00
Beq 3432012aef Revert "Attempt to get better file/line info for LL_ERRS..." needs new tpv_havok
This reverts commit 205e259d42.
2024-10-05 18:32:50 +01:00
Brad Linden 205e259d42 Attempt to get better file/line info for LL_ERRS crahses in bugsplat. (#2447)
secondlife/viewer#2445
2024-10-05 00:12:28 +01:00
Beq b3d8cde4a3 Revert "Attempt to get better file/line info for LL_ERRS crahses in bugsplat. (#2447)"
This reverts commit 34389c6cc2.
This would require another TPV physics update
2024-09-04 01:06:35 +01:00
Brad Linden 34389c6cc2 Attempt to get better file/line info for LL_ERRS crahses in bugsplat. (#2447)
secondlife/viewer#2445
2024-09-04 00:23:23 +01:00
Brad Linden f15228023f
Attempt to get better file/line info for LL_ERRS crahses in bugsplat. (#2447)
secondlife/viewer#2445
2024-08-28 16:20:25 -07:00
Ansariel 5f1a19af72 Merge remote-tracking branch 'LL/marchcat/x-ws-merge'
# Conflicts:
#	autobuild.xml
#	indra/linux_crash_logger/llcrashloggerlinux.cpp
#	indra/newview/llappviewerlinux_api.h
#	indra/newview/llappviewerlinux_api_dbus.cpp
#	indra/newview/llappviewerlinux_api_dbus.h
#	indra/newview/llavatarpropertiesprocessor.h
#	indra/newview/llcallbacklist.cpp
#	indra/newview/llimpanel.h
2024-05-01 12:30:57 +02:00
Andrey Lihatskiy 1b68f71348 #824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed 2024-04-29 07:56:09 +03:00
Andrey Kleshchev 78ce375dda SL-17896 Don't crash silently if files are missing or out of memory
Under debug LL_ERRS will show a message as well, but release won't show
anything and will quit silently so show a notification when applicable.
2024-03-05 00:29:35 +02:00
Ansariel ab2675497b Merge branch 'DRTVWR-591-maint-X' of https://github.com/secondlife/viewer
# Conflicts:
#	indra/llimage/llimagebmp.cpp
#	indra/llimage/llimagetga.cpp
#	indra/llui/lltransutil.cpp
#	indra/newview/llappviewer.cpp
#	indra/newview/llpanelprofile.cpp
2024-01-05 14:31:37 +01:00
Andrey Kleshchev 51088cde7f SL-17896 Don't crash silently if files are missing or out of memory
Under debug LL_ERRS will show a message as well, but release won't show
anything and will quit silently so show a notification when applicable.
2024-01-04 21:13:06 +02:00
Ansariel 6c389316f1 Merge branch 'DRTVWR-559' of https://github.com/secondlife/viewer
# Conflicts:
#	autobuild.xml
#	indra/llcommon/llerror.cpp
#	indra/llrender/llrender.h
#	indra/newview/VIEWER_VERSION.txt
2023-10-27 13:00:41 +02:00
Ansariel 70db255e02 Merge branch 'master' of https://vcs.firestormviewer.org/viewer-merges/phoenix-firestorm-ll-master
# Conflicts:
#	.github/workflows/build.yaml
#	autobuild.xml
#	indra/llcommon/llerror.cpp
#	indra/llcommon/tests/workqueue_test.cpp
#	indra/newview/VIEWER_VERSION.txt
2023-10-27 11:52:59 +02:00
Ansariel 39a6735fc9 Merge branch 'main' of https://github.com/secondlife/viewer
# Conflicts:
#	.gitignore
#	autobuild.xml
#	indra/cmake/APR.cmake
#	indra/newview/CMakeLists.txt
#	indra/newview/installers/windows/installer_template.nsi
#	indra/newview/viewer_manifest.py
#	indra/test/namedtempfile.h
2023-10-26 15:49:12 +02:00
Brad Linden 673b3309dd Merge remote-tracking branch 'origin/main' into DRTVWR-559 2023-10-25 16:12:13 -07:00
Nat Goodspeed 651353560b SL-20476: Don't let the compiler know we intend to crash.
clang has gotten smart enough to recognize an inline attempt to store to
address zero. Fool it by storing to an address passed as a parameter, and pass
nullptr from a different source file.
2023-10-17 14:56:10 -04:00
Ansariel 289fb458f3 Merge branch 'master' of https://vcs.firestormviewer.org/phoenix-firestorm
# Conflicts:
#	doc/contributions.txt
#	indra/llprimitive/llmaterial.h
#	indra/newview/VIEWER_VERSION.txt
#	indra/newview/lldrawpool.cpp
#	indra/newview/lldrawpoolalpha.cpp
#	indra/newview/llfilepicker.cpp
#	indra/newview/llfilepicker.h
#	indra/newview/llpanelface.cpp
#	indra/newview/llviewermenufile.cpp
#	indra/newview/llvovolume.cpp
2023-07-18 10:59:02 +02:00
Brad Linden f975cfd736 Merge remote-tracking branch 'origin/main' into DRTVWR-559 2023-07-17 13:37:03 -07:00
Ansariel e900da3597 Merge branch 'DRTVWR-580-maint-T' of https://github.com/secondlife/viewer
# Conflicts:
#	indra/llcharacter/llkeyframemotion.cpp
#	indra/llcommon/llerrorthread.cpp
#	indra/llui/lllayoutstack.cpp
#	indra/newview/app_settings/settings.xml
#	indra/newview/llfilepicker.cpp
2023-05-23 13:57:36 +02:00
Nat Goodspeed 27ee831e38 SL-19744: Remove LLErrorThread and LLAppViewer::handleViewerCrash() 2023-05-23 04:28:58 +03:00
Ansariel 9057bfc995 Merge branch 'DRTVWR-559' of https://github.com/secondlife/viewer
# Conflicts:
#	indra/llcommon/llcallstack.h
#	indra/llinventory/llsettingssky.cpp
#	indra/llmath/llvolume.cpp
#	indra/llwindow/llwindowwin32.cpp
#	indra/newview/llappviewer.cpp
#	indra/newview/llappviewerwin32.cpp
#	indra/newview/llmeshrepository.cpp
#	indra/newview/llmeshrepository.h
#	indra/newview/llviewerstats.cpp
#	indra/newview/llvoavatar.cpp
2023-05-05 12:35:33 +02:00
Nat Goodspeed 2a10bd406c DRTVWR-559: Replace debugLoggingEnabled() function with LL_DEBUGS().
The trouble with debugLoggingEnabled() is that it locked mutexes and searched
maps every time that call was reached. LL_DEBUGS() has the same functionality
(albeit with idiosyncratic syntax) but performs expensive lookups only once
per session, caching the result in a local static variable.
2023-05-03 09:55:31 -04:00
Ansariel 5323ccf3b3 Merge branch 'DRTVWR-559' of https://github.com/secondlife/viewer
# Conflicts:
#	indra/llcommon/llprofiler.h
#	indra/llcommon/llprofilercategories.h
#	indra/llcommon/lluuid.cpp
#	indra/newview/app_settings/settings.xml
#	indra/newview/featuretable.txt
#	indra/newview/llagent.cpp
#	indra/newview/llface.cpp
#	indra/newview/llviewerobject.cpp
#	indra/newview/llviewertexture.cpp
2023-03-20 11:14:08 +01:00
Brad Linden 8564da5831 Improved detail for llvertexbuffer attribute mask assertion failure in DRTVWR-559 2023-03-06 11:38:24 -08:00
Ansariel 271ba51734 Disable C6011 code analyses warning for now popping up everywhere because of the LL_ENDL / LLERROR_CRASH macro 2023-01-17 18:54:20 +01:00
Ansariel f0352ff093 Merge branch 'master' of https://vcs.firestormviewer.org/phoenix-firestorm 2022-02-16 09:49:24 +01:00
Nicky 755c765263 Call std::abort in llassert_always. LL_ERRS will already terminate/crass the processes, but putting a [noreturn] function, even if never reached, makes it obvious to the compiler that the program will abort. 2022-02-10 10:34:36 +01:00
Ansariel 7427b46ea5 Merge branch 'DRTVWR-546' of https://bitbucket.org/lindenlab/viewer
# Conflicts:
#	.gitignore
#	indra/cmake/Copy3rdPartyLibs.cmake
#	indra/llcommon/llcommon.cpp
#	indra/llcommon/llerror.cpp
#	indra/llcommon/llprofiler.h
#	indra/llcommon/llthread.cpp
#	indra/llimage/llimageworker.cpp
#	indra/llprimitive/llmodel.h
#	indra/llrender/llfontgl.cpp
#	indra/llrender/llfontgl.h
#	indra/llrender/llgl.cpp
#	indra/llrender/llvertexbuffer.cpp
#	indra/llrender/llvertexbuffer.h
#	indra/llwindow/llwindowmacosx.h
#	indra/llwindow/llwindowwin32.cpp
#	indra/llwindow/llwindowwin32.h
#	indra/newview/app_settings/settings.xml
#	indra/newview/llappviewer.cpp
#	indra/newview/llappviewer.h
#	indra/newview/lldrawpoolavatar.cpp
#	indra/newview/lldrawpoolavatar.h
#	indra/newview/lldynamictexture.cpp
#	indra/newview/llfloatermodelpreview.cpp
#	indra/newview/llimview.cpp
#	indra/newview/llmeshrepository.h
#	indra/newview/llmodelpreview.cpp
#	indra/newview/llnetmap.cpp
#	indra/newview/llskinningutil.cpp
#	indra/newview/llskinningutil.h
#	indra/newview/llspatialpartition.cpp
#	indra/newview/llteleporthistory.cpp
#	indra/newview/llviewerdisplay.cpp
#	indra/newview/llviewerobject.cpp
#	indra/newview/llviewerobjectlist.cpp
#	indra/newview/llviewertexture.cpp
#	indra/newview/llviewertexturelist.cpp
#	indra/newview/llviewerwindow.cpp
#	indra/newview/llvoicevivox.cpp
#	indra/newview/llvosky.cpp
#	indra/newview/llvovolume.cpp
2021-11-12 15:21:52 +01:00
Dave Parks 675514bdb3 SL-16093 Don't force the console window to be open on developer builds because it causes frame stalls while logging. 2021-09-27 23:56:06 +00:00
Ansariel 9e415cdbb2 Merge branch 'DRTVWR-516-maint' of https://bitbucket.org/lindenlab/viewer 2021-05-25 11:03:48 +02:00
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 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
Nicky Dasmijn f116ea4cb7 Merge remote-tracking branch 'fs/master' into fs-vs2017-d476
(Note: This removed our changed dullahan, but that's okay as it is
vs2013)
2020-07-20 09:58:30 +02:00
Nicky Dasmijn 98718bfe7d Supress PVS Studio warnings. 2020-06-14 20:41:23 +02:00
Nat Goodspeed 6e5242f0a4 DRTVWR-476: Fix LLError::Log::classname(T*) template function.
First, the signature classname(const T*) was wrong: that function could only
accept a pointer to const T. The expression classname(someptr) where someptr
was a pointer to non-const SomeType displayed "SomeType*" because it could
only match classname(const T&), where T was SomeType*.

classname(T* const) is what we should have written, meaning "const pointer to
T" rather than "pointer to const T."

Second, the previous implementation failed to handle the case in which the
pointer was nullptr.
2020-05-14 08:50:39 -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 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
Brad Kittenbrink a6f31e9167 Fixed variadic macro usage in LL_ERRS_IF and LL_WARNS_IF and improved LLError::shouldLogToStderr() behavior under xcode. 2020-03-25 18:39:21 -04:00
Ansariel d93b92ec1d Merge viewer-bear 2018-09-12 20:13:12 +02:00
Oz Linden f1d4e788e7 SL-967 simplify viewer log file field syntax
MAINT-8991: only escape log message characters once, add unit test
remove extra log line created by LL_ERRS
document that tags may not contain spaces
2018-08-29 16:43:45 -04:00
Ansariel 8c083cf771 Merge Firestorm LGPL 2016-12-05 22:40:59 +01:00
Ansariel c182741596 Merge viewer-lynx 2016-11-16 09:55:54 +01:00
Ansariel 13e2832747 Merge Firestorm LGPL 2016-10-12 14:10:48 +02:00
Ansariel 68a8141cd6 Merge bento-box 2016-10-04 12:49:38 +02:00
Brad Payne (Vir Linden) 8d6bb9ee4e SL-451 - SSE-optimized matrix multiply, used in initSkinningMatrixPalette() 2016-09-28 15:43:07 -04:00