google-coredumper returns Operation not permitted


Background: Downloaded google-coredumper-1.2.1.tar.gz from code.google.com. built the code and make install. Added library and function call to my application and execute. No core file, Logs state Operation not permitted. So I created a simple example and stepped through it and found that the library believes that the executable is already being traced. Any ideas?

#include <string> #include <stdio.h> #include <stdlib.h> #include "crashtest.h" #include <google/coredumper.h> #include <errno.h> #include <string.h> #include <signal.h> FILE * backtrace_file = NULL; #define SIZE 100 void CREATE_COREDUMP() { printf("NOTICE, Creating a core dump for debugging\n"); char extension[64]; time_t t = time((time_t*)NULL); tm * theTime = localtime(&t); snprintf( extension, sizeof(extension) - 1, "core.crashtest_02d_%02d_%02d_%02d", (theTime->tm_mday), (theTime->tm_hour), (theTime->tm_min) , (theTime->tm_sec) ); if (WriteCoreDump(extension) != 0) { std::string errmsg(extension); errmsg.append(" : "); errmsg.append(strerror(errno)); printf("WARNING, Failed to create coredump: %s\n", errmsg.c_str() ); } } static void mysighandler(int sig) { printf("ERROR, Somebody Segmentation Faulted. About to Exit\n"); CREATE_COREDUMP(); exit(0); } crashtest::crashtest() { char * errcond = NULL; memcpy(errcond, "Crash This", 10); } crashtest::~crashtest() {} int main(int argc, char** argv) { struct sigaction sa; sa.sa_flags = SA_SIGINFO; sigemptyset(&sa.sa_mask); sa.sa_handler = &mysighandler; sigaction(SIGSEGV, &sa, NULL); crashtest ct; return 0; }

The point of the exercise is that the main code generates a segmentation fault occasionally which does not make sense because all the values are initialized. Therefore I am trying to discover why there is a segmentation fault and would like to get a core to track down the offending line of code. I cannot just kill since the code is required to recover and continue. That is why google-coredumper is thought to be used.


According to <a href="http://www.gossamer-threads.com/lists/linux/kernel/622686" rel="nofollow">http://www.gossamer-threads.com/lists/linux/kernel/622686</a>, it seems that coredumper in its current state is not usable anymore:


I believe, if I interpret the data on kernel.org correctly, this change was made by Linus and shipped with 2.6.15.

Both perftools and coredumper need to locate all threads in the active application in order to work. As libpthread has had changing and poorly documented APIs to get this information, and as our intent is to support all kernel versions and all libc versions, we resorted to ptracing any process that is suspected to be one of our threads in order to determine if it actually is. This has the added benefit of finding <em>all</em> threads (including ones not managed by libpthread) and of temporarily suspending them, so that we have a stable memory image that we can inspect. Think of both tools as something like a lightweight in-process debugger.

Obviously, special care has to be taken to not ptrace our own thread, and to avoid any library calls that could deadlock.

Before the patch, attaching ptrace to my own threads was a valid operation. With this new patch, I can no longer do that.



  • Django: How-to convert naive datetime when time zone support is active?
  • Save Current Date into 3 Ints - C++ [closed]
  • How to catch this error NodeJs/Express?
  • Unable to connect to MongoLab “auth fails” error
  • MongoDB WriteError “code” : 9
  • best way to add char* prefix to existing char* in C [duplicate]
  • Concatenation of string and int results in segmentation fault in C
  • Private class members not fully encapsulated?
  • What can be reasons for `Error in .local(conn, statement, …)´ in dbWriteTable from package MonetDB.R
  • imap: “Unable to create selectable TCP socket” when sending email from a C++ program
  • How to install a bash function containing variables using a bash script? [duplicate]
  • Type Error in Jquery ajax function using submit handler
  • How do I create an indexes for “date”?
  • If no Silverlight, redirect
  • MongoDB jsonSchema validation additionalProperties
  • Having nodes with differing lengths of attributes, add edges if >=1 attribute is the same
  • Insert field with array size in mongo
  • How to validate url in Angular 5
  • Convert unix timestamp to date without system libs
  • Uncaught SyntaxError: Unexpected token < in solr
  • How to dynamically load two or more same or different components at the same view using dynamic cont
  • Validate text fields swift 3
  • surface(2d) fit in MATLAB with anonymous function
  • How do I convert a string in seconds to time in C++
  • StackTrace class methods not working in release mode
  • How to convert a time string in a Google AppEngine db.TimeProperty?
  • PyMongo - UserNotFound: Could not find user authenticated@admin
  • how do I build a protocol header and body over a tcp socket in C
  • Tensorflow ValueError: Only call `sparse_softmax_cross_entropy_with_logits` with named arguments (la
  • How to select data from xml by T-SQL?
  • Mongo server accepts credentials from shell, but not from Java/Scala interface
  • R - Keep log of all plots
  • OSStatus error -50 (invalid parameters) AudioQueueNewInput recording audio on iOS
  • How to work with AMMediaType for video filters
  • How to create a Unix-domain socket with specific access permissions
  • How to unpack 32bit integer packed in a QByteArray?
  • Building Qt project for C++11 standard
  • C++ friend class std::vector
  • Error in installing package: fatal error: stdlib.h: no such file or directory
  • Why is the size of this struct 32?