bool AddressSpaceIsUnlimited();
void SetAddressSpaceUnlimited();
void AdjustStackSize(void *attr);
-void PrepareForSandboxing(__sanitizer_sandbox_arguments *args);
+void PlatformPrepareForSandboxing(__sanitizer_sandbox_arguments *args);
void SetSandboxingCallback(void (*f)());
void InitializeCoverage(bool enabled, const char *coverage_dir);
(internal_strcmp(flag, "auto") == 0 && ReportSupportsColors());
}
-static void (*sandboxing_callback)();
-void SetSandboxingCallback(void (*f)()) {
- sandboxing_callback = f;
-}
-
void ReportErrorSummary(const char *error_type, const StackTrace *stack,
const char *alt_tool_name) {
#if !SANITIZER_GO
CommonSanitizerReportMutex.CheckLocked();
}
+static void (*sandboxing_callback)();
+void SetSandboxingCallback(void (*f)()) {
+ sandboxing_callback = f;
+}
+
} // namespace __sanitizer
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_sandbox_on_notify,
__sanitizer_sandbox_arguments *args) {
- __sanitizer::PrepareForSandboxing(args);
+ __sanitizer::PlatformPrepareForSandboxing(args);
if (__sanitizer::sandboxing_callback)
__sanitizer::sandboxing_callback();
}
}
void MaybeReexec() {}
-void PrepareForSandboxing(__sanitizer_sandbox_arguments *args) {}
+void PlatformPrepareForSandboxing(__sanitizer_sandbox_arguments *args) {}
void DisableCoreDumperIfNecessary() {}
void InstallDeadlySignalHandlers(SignalHandlerType handler) {}
void StartReportDeadlySignal() {}
#include "sanitizer_platform_limits_solaris.h"
#include "sanitizer_posix.h"
#include "sanitizer_procmaps.h"
-#include "sanitizer_stacktrace.h"
-#include "sanitizer_symbolizer.h"
#include <errno.h>
#include <fcntl.h>
return result;
}
-void PrepareForSandboxing(__sanitizer_sandbox_arguments *args) {
+void PlatformPrepareForSandboxing(__sanitizer_sandbox_arguments *args) {
// Some kinds of sandboxes may forbid filesystem access, so we won't be able
// to read the file mappings from /proc/self/maps. Luckily, neither the
// process will be able to load additional libraries, so it's fine to use the
// cached mappings.
MemoryMappingLayout::CacheMemoryMappings();
- // Same for /proc/self/exe in the symbolizer.
-#if !SANITIZER_GO
- Symbolizer::GetOrInit()->PrepareForSandboxing();
-#endif
}
#if SANITIZER_ANDROID || SANITIZER_GO
void Flush();
// Attempts to demangle the provided C++ mangled name.
const char *Demangle(const char *name);
- void PrepareForSandboxing();
// Allow user to install hooks that would be called before/after Symbolizer
// does the actual file/line info fetching. Specific sanitizers may need this
// Platform-specific default demangler, must not return nullptr.
const char *PlatformDemangle(const char *name);
- void PlatformPrepareForSandboxing();
static Symbolizer *symbolizer_;
static StaticSpinMutex init_mu_;
return PlatformDemangle(name);
}
-void Symbolizer::PrepareForSandboxing() {
- BlockingMutexLock l(&mu_);
- PlatformPrepareForSandboxing();
-}
-
bool Symbolizer::FindModuleNameAndOffsetForAddress(uptr address,
const char **module_name,
uptr *module_offset,
return DemangleSwiftAndCXX(name);
}
-void Symbolizer::PlatformPrepareForSandboxing() {}
-
static SymbolizerTool *ChooseExternalSymbolizer(LowLevelAllocator *allocator) {
const char *path = common_flags()->external_symbolizer_path;
const char *binary_name = path ? StripModuleName(path) : "";
return name;
}
-void Symbolizer::PlatformPrepareForSandboxing() {
- // Do nothing.
-}
-
namespace {
struct ScopedHandle {
ScopedHandle() : h_(nullptr) {}
UNIMPLEMENTED();
}
-void PrepareForSandboxing(__sanitizer_sandbox_arguments *args) {
-}
+void PlatformPrepareForSandboxing(__sanitizer_sandbox_arguments *args) {}
bool StackSizeIsUnlimited() {
UNIMPLEMENTED();
} // extern "C"
} // namespace __tsan
-
-namespace __sanitizer {
-
-void SymbolizerPrepareForSandboxing() {
- // Nothing to do here for Go.
-}
-
-} // namespace __sanitizer