summaryrefslogtreecommitdiff
path: root/indra/llcommon/lluriparser.cpp
diff options
context:
space:
mode:
authorAnsariel <ansariel.hiller@phoenixviewer.com>2024-04-11 21:59:38 +0200
committerAnsariel <ansariel.hiller@phoenixviewer.com>2024-04-11 21:59:38 +0200
commitd0102af56d3b1d5b1d9bf3c8eb9aeea77028b70e (patch)
treee31cee85f651a874c4b6edc7491efa0cb2ec93d5 /indra/llcommon/lluriparser.cpp
parent17e1f3692c5c1e9cbc6ba6895b312a8baae9aec2 (diff)
parentda9a1dcb55548a249ff7a1255f3e518696b81245 (diff)
Merge branch 'main' of https://github.com/secondlife/viewer into DRTVWR-600-maint-A
# Conflicts: # indra/llcommon/llapp.cpp # indra/llcommon/llapp.h # indra/llimage/llimageworker.cpp # indra/llui/llcontainerview.cpp # indra/llui/llcontainerview.h # indra/llui/llkeywords.cpp # indra/llui/lltabcontainer.cpp # indra/llui/lltextbase.cpp # indra/newview/llappviewer.cpp # indra/newview/llfavoritesbar.cpp # indra/newview/llfavoritesbar.h # indra/newview/llfloaterimnearbychathandler.cpp # indra/newview/llfloaterpreference.cpp # indra/newview/llhudnametag.h # indra/newview/llinventorypanel.cpp # indra/newview/llinventorypanel.h # indra/newview/llmeshrepository.cpp # indra/newview/lloutfitgallery.cpp # indra/newview/lloutfitslist.cpp # indra/newview/llpaneleditwearable.cpp # indra/newview/llpanelprofilepicks.cpp # indra/newview/llpanelvoicedevicesettings.h # indra/newview/llpreviewscript.cpp # indra/newview/llpreviewscript.h # indra/newview/llselectmgr.cpp # indra/newview/lltranslate.cpp # indra/newview/llviewerassetupload.cpp # indra/newview/llviewermessage.cpp
Diffstat (limited to 'indra/llcommon/lluriparser.cpp')
-rw-r--r--indra/llcommon/lluriparser.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/indra/llcommon/lluriparser.cpp b/indra/llcommon/lluriparser.cpp
index e4f229dd16..f79a98a56d 100644
--- a/indra/llcommon/lluriparser.cpp
+++ b/indra/llcommon/lluriparser.cpp
@@ -164,8 +164,10 @@ void LLUriParser::extractParts()
#if LL_DARWIN
typedef void(*sighandler_t)(int);
jmp_buf return_to_normalize;
+static int sLastSignal = 0;
void uri_signal_handler(int signal)
{
+ sLastSignal = signal;
// Apparently signal handler throwing an exception doesn't work.
// This is ugly and unsafe due to not unwinding content of uriparser library,
// but unless we have a way to catch this as NSexception, jump appears to be the only option.
@@ -179,8 +181,10 @@ S32 LLUriParser::normalize()
if (!mRes)
{
#if LL_DARWIN
- sighandler_t last_handler;
- last_handler = signal(SIGILL, &uri_signal_handler); // illegal instruction
+ sighandler_t last_sigill_handler, last_sigbus_handler;
+ last_sigill_handler = signal(SIGILL, &uri_signal_handler); // illegal instruction
+ last_sigbus_handler = signal(SIGBUS, &uri_signal_handler);
+
if (setjmp(return_to_normalize))
{
// Issue: external library crashed via signal
@@ -194,8 +198,9 @@ S32 LLUriParser::normalize()
// if this can be handled by NSexception, it needs to be remade
llassert(0);
- LL_WARNS() << "Uriparser crashed with SIGILL, while processing: " << mNormalizedUri << LL_ENDL;
- signal(SIGILL, last_handler);
+ LL_WARNS() << "Uriparser crashed with " << sLastSignal << " , while processing: " << mNormalizedUri << LL_ENDL;
+ signal(SIGILL, last_sigill_handler);
+ signal(SIGBUS, last_sigbus_handler);
return 1;
}
#endif
@@ -203,7 +208,8 @@ S32 LLUriParser::normalize()
mRes = uriNormalizeSyntaxExA(&mUri, URI_NORMALIZE_SCHEME | URI_NORMALIZE_HOST);
#if LL_DARWIN
- signal(SIGILL, last_handler);
+ signal(SIGILL, last_sigill_handler);
+ signal(SIGBUS, last_sigbus_handler);
#endif
if (!mRes)
@@ -226,7 +232,7 @@ S32 LLUriParser::normalize()
}
}
- if(mTmpScheme)
+ if(mTmpScheme && mNormalizedUri.size() > 7)
{
mNormalizedUri = mNormalizedUri.substr(7);
mTmpScheme = false;