Gcore Error In Sourced Command File
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies error in sourced command file gdb of this site About Us Learn more about Stack Overflow the company
Gcore Example
Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges man gcore Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: missing separate debuginfos use debuginfo-install Sign up gdb stops in a command file if there is an error. How to continue despite the error? up vote 7 down vote favorite 2 I my real gdb script while analyzing a core file I try to dereference a pointer and get "Error in sourced command file: Cannot access memory at address " and then my gdb script stops. What I want is just to go on executing my gdb script without stopping. Is it possible? This is a test program and a test gdb script that demonstrates my problem. In this situation the pointer has NULL value but in a real situation the pointer will like have not null invalid value. This is test C program: #include
Documentation FAQ Hurd Documentation Running Mach Documentation GNU Mach MIG Documentation GNU MIG Debian GNU/Hurd GNU System Hurd NG GDB's gcore command doesn't work / needs to be implemented / ported in http://stackoverflow.com/questions/17923865/gdb-stops-in-a-command-file-if-there-is-an-error-how-to-continue-despite-the-er GDB: tschwinge@flubber:~ $ gcore 8371 [New Thread 8371.1] [New Thread 8371.2] [New Thread 8371.3] /media/data/home/tschwinge/core.cA0ICY:2: Error in sourced command file: Undefined command: "gcore". Try "help". gcore: failed to create core.8371 Will probably need to https://www.gnu.org/s/hurd/open_issues/gdb_gcore.html implement gdb/gdbarch.sh:gdb_signal_from_target, gdb/gdbarch.sh:gdb_signal_to_target. If someone is working in this area, they may want to port http://code.google.com/p/google-coredumper/, too. Tags: open issue gdb Links: crash server Copyright © 2009, 2011, 2013 Free Software Foundation, Inc. License: GFDL 1.2+ Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License. Last edited 2015-02-17 23:58:35 UTC
Avoid using gcore kgibm 0600027VAP | | Comments (2) | Visits (9028) Tweet This is part four in the series on understanding total virtual memory usage from a core dump on Linux (part 1, part 2, https://www.ibm.com/developerworks/community/blogs/kevgrig/entry/ibm_java_on_linux_avoid_using_gcore part 3). Previously, I recommended using a script to add a timestamp to a core file name when using gcore so that MAT could know when the dump was taken. Now, I'll make the http://comments.gmane.org/gmane.comp.gdb.devel/32725 case for a stronger recommendation to completely avoid using gcore and use IBM Java's built-in capabilities of taking a core dump instead. Gcore is simply a shell script available on some flavors of Linux: $ error in whereis gcore gcore: /usr/bin/gcore $ cat /usr/bin/gcore #!/bin/sh ... gdb -x $tmpfile -batch ... attach $pid gcore $name.$pid detach Gcore attaches to the process using gdb and runs the gdb gcore command and then detaches. The gcore command manually iterates through the memory sections available through the debugger and writes the ELF core file. Why is gcore not as good as IBM Java's capabilities? As we found in part 3, error in sourced even with 0xffff in /proc/PID/coredump_filter, we do not get all the virtual address sections that we see at runtime in /proc/PID/maps or /proc/PID/smaps. In that example, we actually got pretty close, but it was a trivial application. When I ran the same test on a full blown WAS Java process, even with a full coredump_filter, we only got about 15% of the total virtual size of the process.
When IBM Java creates a core file, it forks itself and kills the child process, thus using the kernel to produce the core unlike gdb: Linux does not provide an operating system API for generating a system dump from a running process. The JVM produces system dumps on Linux by using the fork() API to start an identical process to the parent JVM process. The JVM then generates a SIGSEGV signal in the child process. The SIGSEGV signal causes Linux to create a system dump for the child process. The parent JVM processes and renames the system dump, as required, by the -Xdump options, and might add additional data into the dump file. The system dump for the child process contains an exact copy of the memory areas used in the parent. The SDK dump viewer can obtain informa