mirror of
https://github.com/EQEmu/Server.git
synced 2026-12-04 15:22:18 +00:00
Crash handler: don't hang on a corrupted heap; fix guild tribute names (#5130)
This commit is contained in:
1 parent
c9c8747ac9
commit
a572b03f56
9 files changed
+33
-10
No files matched your search
+14
-1
@@ -243,13 +243,26 @@ void set_exception_handler() {
|
||||
#include <unistd.h>
|
||||
#include <sys/fcntl.h>
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#include <signal.h>
|
||||
#ifdef __FreeBSD__
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
static volatile sig_atomic_t crash_in_progress = 0;
|
||||
|
||||
void print_trace()
|
||||
{
|
||||
// The dump below is not async-signal-safe (popen, malloc, logging). If the crash came from heap
|
||||
// corruption inside malloc, it can deadlock on the allocator lock and the process never exits, holding
|
||||
// its launcher slot. So: a second fault while dumping exits at once, and an alarm kills the process
|
||||
// if the dump has not finished in time.
|
||||
if (crash_in_progress) {
|
||||
_exit(1);
|
||||
}
|
||||
crash_in_progress = 1;
|
||||
signal(SIGALRM, SIG_DFL);
|
||||
alarm(60);
|
||||
|
||||
bool does_gdb_exist = Strings::Contains(Process::execute("gdb -v"), "GNU");
|
||||
if (!does_gdb_exist) {
|
||||
LogCrash(
|
||||
|
||||
@@ -85,7 +85,7 @@ void DatabaseUpdate::CheckDbUpdates()
|
||||
}
|
||||
|
||||
int custom_database_version = UpdateManifest(manifest_entries_custom, v.custom_database_version, b.custom_database_version);
|
||||
if (custom_database_version > v.server_database_version) {
|
||||
if (custom_database_version > v.custom_database_version) {
|
||||
LogInfo(
|
||||
"Updates ran successfully, setting database version to [{}] from [{}]",
|
||||
custom_database_version,
|
||||
|
||||
@@ -313,9 +313,9 @@ int8 EQ::ItemInstance::AvailableAugmentSlot(int32 augment_type) const
|
||||
return INVALID_INDEX;
|
||||
}
|
||||
|
||||
bool EQ::ItemInstance::IsAugmentSlotAvailable(int32 augment_type, uint8 slot) const
|
||||
bool EQ::ItemInstance::IsAugmentSlotAvailable(int32 augment_type, uint8 slot, bool allow_occupied) const
|
||||
{
|
||||
if (!m_item || !m_item->IsClassCommon() || GetItem(slot)) {
|
||||
if (!m_item || !m_item->IsClassCommon() || (!allow_occupied && GetItem(slot))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace EQ
|
||||
bool IsAugmentable() const;
|
||||
bool AvailableWearSlot(uint32 aug_wear_slots) const;
|
||||
int8 AvailableAugmentSlot(int32 augment_type) const;
|
||||
bool IsAugmentSlotAvailable(int32 augment_type, uint8 slot) const;
|
||||
bool IsAugmentSlotAvailable(int32 augment_type, uint8 slot, bool allow_occupied = false) const;
|
||||
inline int GetAugmentType() const { return m_item ? m_item->AugType : 0; }
|
||||
inline uint32 GetAugmentRestriction() const { return m_item ? m_item->AugRestrict : 0; }
|
||||
|
||||
|
||||
Reference in new issue
Block a user