Geant4
10.00.p01
|
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <libgen.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <errno.h>
#include <assert.h>
#include <signal.h>
#include <execinfo.h>
#include <sys/syscall.h>
#include <pthread.h>
#include "tls.hh"
#include "memoryprotection/UDSignals.h"
#include "memoryprotection/MemorySegment.h"
Go to the source code of this file.
Macros | |
#define | MAXTHREADS 128 |
Functions | |
static pid_t | gettid () |
void * | AllocateInProtectedHeap (size_t size) |
static void | AllocateProtectedHeap (size_t totalSize, size_t pagesize) |
static int | readFile (char *filename, char *buf, int maxSize) |
static char * | readhex (char *string, long *value) |
static char * | readMapsLine (char *string, void **start, void **end, int *writable, char *filename) |
static void * | getPageNumber (void *theAddress) |
static void | setuphandler0 () |
static void | setuphandler1 () |
static void | setuphandler2 () |
static void | SetUpAllProtect () |
static void | UnSetUpAllProtect () |
void | PhaseChange () |
static void | record_stackframe () |
static void | show_stackframe () |
static void | handler0 (int, siginfo_t *, void *) |
static void | handler1 (int, siginfo_t *, void *) |
static void | handler2 (int, siginfo_t *, void *) |
void | BuildProtectedMemory (size_t totalHeap) |
void | addThread () |
void | setuphandlers () |
void | starttracer () |
void | finishtracer () |
void | StartDetection () |
void | FinishDetection () |
Variables | |
static char * | startPosition = 0 |
static char * | currentPosition = 0 |
static char * | nextPosition = 0 |
static char * | endPosition = 0 |
static size_t | pagesize |
static int | logpagesize |
static char | application [1024] |
static int | phase = 0 |
static G4ThreadLocal void * | trace [100] |
static int | outputFile = -1 |
static int | trace_size |
static int | isCalled = 0 |
int | numberOfThreads = 0 |
pid_t | threads [MAXTHREADS] |
pid_t | tracerpid |
#define MAXTHREADS 128 |
Definition at line 456 of file ProtectedMemory.cc.
Referenced by addThread().
void addThread | ( | ) |
Definition at line 462 of file ProtectedMemory.cc.
References assert, gettid(), MAXTHREADS, numberOfThreads, and threads.
void* AllocateInProtectedHeap | ( | size_t | size | ) |
Definition at line 36 of file ProtectedMemory.cc.
References currentPosition, endPosition, malloc(), nextPosition, and startPosition.
|
static |
Definition at line 55 of file ProtectedMemory.cc.
References currentPosition, endPosition, malloc(), nextPosition, pagesize, and startPosition.
Referenced by BuildProtectedMemory().
void BuildProtectedMemory | ( | size_t | totalHeap | ) |
Definition at line 183 of file ProtectedMemory.cc.
References AllocateProtectedHeap(), application, endPosition, getPageNumber(), logpagesize, nextPosition, outputFile, pagesize, phase, readFile(), readMapsLine(), and show_stackframe().
Referenced by starttracer().
void FinishDetection | ( | ) |
Definition at line 525 of file ProtectedMemory.cc.
References assert.
void finishtracer | ( | ) |
Definition at line 505 of file ProtectedMemory.cc.
References assert, outputFile, tracerpid, and UnSetUpAllProtect().
|
static |
Definition at line 98 of file ProtectedMemory.cc.
References logpagesize.
Referenced by BuildProtectedMemory().
|
static |
Definition at line 24 of file ProtectedMemory.cc.
Referenced by addThread().
|
static |
Definition at line 133 of file ProtectedMemory.cc.
References assert, isCalled, and SetUpAllProtect().
Referenced by setuphandler0().
|
static |
Definition at line 152 of file ProtectedMemory.cc.
References assert, record_stackframe(), and UnSetUpAllProtect().
Referenced by setuphandler1().
|
static |
Definition at line 174 of file ProtectedMemory.cc.
References SetUpAllProtect().
Referenced by setuphandler2().
void PhaseChange | ( | ) |
Definition at line 104 of file ProtectedMemory.cc.
References outputFile, and phase.
|
static |
Definition at line 369 of file ProtectedMemory.cc.
Referenced by BuildProtectedMemory().
|
static |
Definition at line 389 of file ProtectedMemory.cc.
Referenced by readMapsLine().
|
static |
Definition at line 403 of file ProtectedMemory.cc.
References readhex().
Referenced by BuildProtectedMemory().
|
static |
Definition at line 119 of file ProtectedMemory.cc.
References outputFile, trace, and trace_size.
Referenced by handler1().
|
static |
Definition at line 421 of file ProtectedMemory.cc.
Referenced by handler0(), and handler2().
|
static |
Definition at line 577 of file ProtectedMemory.cc.
References handler0().
Referenced by setuphandlers().
|
static |
Definition at line 588 of file ProtectedMemory.cc.
References handler1().
Referenced by setuphandlers().
|
static |
Definition at line 599 of file ProtectedMemory.cc.
References handler2().
Referenced by setuphandlers().
void setuphandlers | ( | ) |
Definition at line 570 of file ProtectedMemory.cc.
References setuphandler0(), setuphandler1(), and setuphandler2().
Referenced by starttracer().
|
static |
Definition at line 125 of file ProtectedMemory.cc.
References trace, and trace_size.
Referenced by BuildProtectedMemory().
void StartDetection | ( | ) |
Definition at line 516 of file ProtectedMemory.cc.
void starttracer | ( | ) |
Definition at line 474 of file ProtectedMemory.cc.
References application, BuildProtectedMemory(), numberOfThreads, setuphandlers(), threads, and tracerpid.
|
static |
Definition at line 440 of file ProtectedMemory.cc.
Referenced by finishtracer(), and handler1().
|
static |
Definition at line 92 of file ProtectedMemory.cc.
Referenced by BuildProtectedMemory(), and starttracer().
|
static |
Definition at line 32 of file ProtectedMemory.cc.
Referenced by AllocateInProtectedHeap(), AllocateProtectedHeap(), G4UnknownDecay::DecayIt(), G4Decay::DecayIt(), and G4RadioactiveDecay::DecayIt().
|
static |
Definition at line 34 of file ProtectedMemory.cc.
Referenced by AllocateInProtectedHeap(), AllocateProtectedHeap(), BuildProtectedMemory(), G4MultiNavigator::ComputeStep(), and G4PathFinder::DoNextLinearStep().
|
static |
Definition at line 131 of file ProtectedMemory.cc.
Referenced by handler0(), and StartDetection().
|
static |
Definition at line 85 of file ProtectedMemory.cc.
Referenced by BuildProtectedMemory(), and getPageNumber().
|
static |
Definition at line 33 of file ProtectedMemory.cc.
Referenced by AllocateInProtectedHeap(), AllocateProtectedHeap(), and BuildProtectedMemory().
int numberOfThreads = 0 |
Definition at line 457 of file ProtectedMemory.cc.
Referenced by addThread(), and starttracer().
|
static |
Definition at line 101 of file ProtectedMemory.cc.
Referenced by BuildProtectedMemory(), finishtracer(), main(), PhaseChange(), and record_stackframe().
|
static |
Definition at line 84 of file ProtectedMemory.cc.
Referenced by AllocateProtectedHeap(), and BuildProtectedMemory().
|
static |
Definition at line 96 of file ProtectedMemory.cc.
Referenced by BuildProtectedMemory(), PhaseChange(), and G4QMDGroundStateNucleus::samplingMomentum().
|
static |
Definition at line 31 of file ProtectedMemory.cc.
Referenced by AllocateInProtectedHeap(), AllocateProtectedHeap(), G4Transportation::AlongStepGetPhysicalInteractionLength(), G4CoupledTransportation::AlongStepGetPhysicalInteractionLength(), G4MonopoleTransportation::AlongStepGetPhysicalInteractionLength(), G4ITTransportation::AlongStepGetPhysicalInteractionLength(), and G4ITTransportation::ComputeStep().
pid_t threads[MAXTHREADS] |
Definition at line 458 of file ProtectedMemory.cc.
Referenced by addThread(), and starttracer().
|
static |
Definition at line 100 of file ProtectedMemory.cc.
Referenced by record_stackframe(), and show_stackframe().
|
static |
Definition at line 102 of file ProtectedMemory.cc.
Referenced by record_stackframe(), and show_stackframe().
pid_t tracerpid |
Definition at line 459 of file ProtectedMemory.cc.
Referenced by finishtracer(), and starttracer().