Go to the documentation of this file.
37 #if defined(HAVE_PTHREAD)
44 #include <glog/logging.h>
46 #ifdef HAVE_LIB_GFLAGS
47 #include <gflags/gflags.h>
48 using namespace GFLAGS_NAMESPACE;
59 stderr,
"0x%px is dying\n",
60 static_cast<const void*
>(
reinterpret_cast<const char*
>(pthread_self())));
63 volatile int b = 1 /
a;
64 fprintf(stderr,
"We should have died: b=%d\n",
b);
69 if (write(STDOUT_FILENO,
data,
size) < 0) {
74 int main(
int argc,
char **argv) {
75 #if defined(HAVE_STACKTRACE) && defined(HAVE_SYMBOLIZE)
77 #ifdef HAVE_LIB_GFLAGS
84 LOG(
INFO) <<
"create the log file";
85 LOG(
INFO) <<
"a message before segv";
87 int *
a = (
int*)0xDEAD;
90 fprintf(stderr,
"looping\n");
92 }
else if (
command ==
"die_in_thread") {
93 #if defined(HAVE_PTHREAD)
96 pthread_join(thread,
NULL);
98 fprintf(stderr,
"no pthread\n");
101 }
else if (
command ==
"dump_to_stdout") {
104 }
else if (
command ==
"installed") {
105 fprintf(stderr,
"signal handler installed: %s\n",
int main(int argc, char **argv)
static void * DieInThread(void *)
ROSLIB_DECL std::string command(const std::string &cmd)
GLsizei const GLchar *const * string
void InstallFailureWriter(void(*writer)(const char *data, size_t size))
bool IsFailureSignalHandlerInstalled()
GLboolean GLboolean GLboolean b
void InstallFailureSignalHandler()
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
void ParseCommandLineFlags(int *argc, char **argv)
void InitGoogleLogging(const char *argv0)
GLboolean GLboolean GLboolean GLboolean a
static void WriteToStdout(const char *data, size_t size)
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:58