anatol / google-coredumper Goto Github PK
View Code? Open in Web Editor NEWMirror of https://code.google.com/p/google-coredumper/ with Arch package fixes
License: BSD 3-Clause "New" or "Revised" License
Mirror of https://code.google.com/p/google-coredumper/ with Arch package fixes
License: BSD 3-Clause "New" or "Revised" License
The coredumper library can be compiled into applications to create core dumps of the running program, without having to terminate them. It supports both single- and multi-threaded core dumps, even if the kernel does not have native support for multi-threaded core files. This library is primarily intended to simplify debugging of long-running services. It is often inacceptable to suspend production services by attaching a debugger, nor is it possible to crash the service in order to generate a core file. By modifying an existing service to take advantage of the coredumper library, it is possible to expose an interface for obtaining snapshots of the running application. The library supports writing of core files to disk (e.g. triggered upon reception of a signal) but it can also generate in-memory core files. This makes it possible for web services to expose remote access to core files. The "examples" directory shows how to add a core file feature to an existing TFTP server. For an example of how to use on-disk core files, take a look at "src/coredump_unittest.c". The code has been tested on Linux x86/32, x86/64, and ARM. It is distributed from http://code.google.com/p/google-coredumper. It is available as a tar source archive, and in prebuilt form as Debian and RedHat packages. For detailed information on how to build and install this library, read the "INSTALL" file. On most systems, you will need to configure and build by running: ./configure && make You can then test whether the code works correctly on your system, by running: make check The check requires that you have access to development tools such as "readelf", and "gdb". If you decide to install from the tar file, you now need to run the following command as "root": make install Alternatively, you can build packages for your targeted distribution by running either: make deb or make rpm These commands generate installable package files. The packages will be located in the "packages/<DISTRIBUTION>" directory (e. g. packages/rh9 or packages/woody). The exact path name is printed at the end of the compilation. Follow your distribution's instructions on how to install new packages. For more information on how to use the library, read the manual pages for "GetCoreDump" and "WriteCoreDump". 15 February 2007
If you have this error, you need to open google-coredumper/trunk/src/linuxthreads.h and add line: #define _GNU_SOURCE
I've discovered that on some systems (newer kernels especially), core dump writing is failing with EFAULT while trying to read some of the process memory. Investigation shows that the memory segment in question is the "vvar" segment which contains directly-mapped kernel variables used with VDSO. In older systems that segment either didn't appear in the maps / smaps file at all, or else trying to read it succeeded. But in newer systems I'm seeing the first 4k read (vvar is always 8k AFAICT) succeed, but the second 4k read fails with EFAULT.
Reading various mailing lists etc. it seems like this memory segment isn't needed for a core file anyway, so I just skipped it.
My repository https://github.com/madscientist/google-coredumper is based on the version from AmadeusItGroup https://github.com/AmadeusITGroup/CoreDumper (has enhancements for RELRO support), plus a few fixes from other people and some of my own. My current master HEAD incorporates all the fixes I've found in various GitHub forks (but doesn't pull in support for "corepoint" from AmadeusItGroup).
The RELRO support changes the coredumper library to parse the proc smaps file instead of proc maps, so my fix involves reading the VmFlags value from smaps and omitting any memory segment which has the "dd" (VM_DONTDUMP) flag set.
If you wanted to keep this version, that reads the maps file instead, you'll need to check the type of the segment and omit it if the type is "[vvar]" (or something like that).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.