Programming :: GDB - Core Dump Analysis And Debug Info?
Oct 21, 2010
I am developing an application whose executable is generated inside a certain folder hierarchy (say: /DevPath/MyProject/bin). My source code is located in a different branch of this hierarchy (say: /DevPath/MyProject/src). When my app crashes, its core files are stored in /DevPath/MyProject. I'm developing the app on a pc, but running it on a separate platform in which i can only execute it. Folder hierarchy is the same as above on both computers. Usually, when a new executable version is ready, we update both the executable and the source code on the target platform, transferring all the new /DevPath/MyProject folder on it. But sometimes it can really be a bother, so we update only the executable.
1)In the case we only update the executable, keeping an old source code version, and the app generates a core file, can i trust the backtrace produced by gdb in this case? I.e., does gdb need the latest source code files or it just needs the debugging information?
2) (More radical question ) Do i really need to keep the source code on the target platform for core dump analysis or i just need the executable?
To analyse a coredump, I need to specify program name/path in GDB/KDevelop. Since the program name along with arguments is also within a core dump, I wonder if it doesn't keep the proper path of program that crashed and so asks for it?
I want to generate core dump files from my program when it crashes. Its a pretty big process and has about 10-11 threads in it.I have followed the documentation to enable core dump by setting ulimit to unlimited etc. I quickly tried "A demo program creating a core dump" from the following webpage, which succeeds in Segfault and dumping a core file in the directory that I configured.However, I tried running my original program and caused it to crash. I did this by making calls to kill(), raise() or the same null pointer access as shown in the webpage above. In each case, my program crashed but did not generate a core dump file. Am I missing something?My program is in C++ and my environment is Redhat 9.0 (kernel 2.4.20)
Going through the "Why do I NOT get a core dump?" section on the same webpage as above, I can see two potential problems. One - there are issues with the suid/sgid (bullet # 6). I am not able to change any settings with suid because my system does not contain either /proc/sys/fs/suid_dumpable or /proc/sys/kernel/suid_dumpableTwo, my program has threads in it and the bullet # 8 is the problem.
In one of our core dump we have the followings in the core back trace:
#0 0xb77bf947 in raise () from /lib/tls/libc.so.6 #1 0xb77c10c9 in abort () from /lib/tls/libc.so.6 #2 0xb77f56ba in __fsetlocking () from /lib/tls/libc.so.6 #3 0xb77fcf7f in mallopt () from /lib/tls/libc.so.6 #4 0xb77fd022 in free () from /lib/tls/libc.so.6
It occurred in a memory block free operation. From our analysis, there seems no issue relate the the memory block it self. The memory pointer pointed to the right memory block to be freed and the contents of the memory seems right (not corrupted), in one world, there is nothing obviously wrong. Does any one have any ideas what could be wrong when seeing about?
I ran GDB on a program and am receiving following errors, Code: anisha@linux-uitj:~/junk> g++ -g jk.cpp anisha@linux-uitj:~/junk> gdb a.out GNU gdb (GDB) SUSE (6.8.91.20090930-2.4) Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later [URL] This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-suse-linux". For bug reporting instructions, please see: [URL] ... Reading symbols from /home/anisha/junk/a.out...done. (gdb) b readline Breakpoint 1 at 0x400b90: file jk.cpp, line 19. (gdb) r Starting program: /home/anisha/junk/a.out Missing separate debuginfo for /lib64/ld-linux-x86-64.so.2 Try: zypper install -C "debuginfo(build-id)=591af1afa33f255704fb6a60859b93d00e205302" Missing separate debuginfo for /usr/lib64/libstdc++.so.6 Try: zypper install -C "debuginfo(build-id)=62220ad5c8941afb5d332c0c47d32f8beec8ac50" Missing separate debuginfo for /lib64/libm.so.6 Try: zypper install -C "debuginfo(build-id)=57fc1891d8d9f419fb8c7fc06a8285563b53a47e" Missing separate debuginfo for /lib64/libgcc_s.so.1 Try: zypper install -C "debuginfo(build-id)=0206e11fa8ca0db0633073adcbf1349a7871e1dc" Missing separate debuginfo for /lib64/libc.so.6 Try: zypper install -C "debuginfo(build-id)=c5a3dfd66bf61fcdec9bc22153b2fbd0d6697960" can't open input file (null) Program exited with code 01. (gdb)
I am trying to port some "C" code from Solaris to Linux. I have a Dell PowerEdge R610 with an Intel Xeon E5504 quad core processor running Red Hat Linux Enterprise 5.3. I am compiling in 64 bit mode. I have managed to get the code compiled and linked, but when I attempt to execute it, I get a core dump in one of the C library calls (like strcpy or printf.)
I have a static library that contains our own code that makes the call to the C library. If I move the library method into the source file with the main method and rename it to be certain that I am executing my method instead of the method in our library, the call succeeds. Eventually another static library call is made that results in a core dump in the shared object. I compile my library code into a static library with gcc as:
In my program, I fork() to get a child process. Because of some problem, child process terminates by a segmentation fault. Parent process is still running. I have compiled my code with -g option. I have done: ulimit -c unlimited. I am not getting core dump of the child process. How can I get the core dump of child process?
I am using RHEL 4.7 (32bit) on HP Proliant 380G6 series server. We are using Electric Cloud Agents on these servers. Nowadays we are facing some memory issues and its creates some kernel panic and then restarts the server. When i reported the issue to my application team, they asked me to come with the core dump. I googled it enough, then i set ulimit value as unlimited. (previously it was 0, then i made a entry in /etc/profile file as follows ulimit -c unlimited) But still whenever my server restarts due to that kernel panic, it couldnt generate the core dump. My application was installed on /opt
I have used Dump Command to dump the application files. For Full backup the level 0 is working fine. For incremental backup I used the level 1 or 2 it is getting the error as
DUMP: Only level 0 dumps are allowed on a subdirectory DUMP: The ENTIRE dump is aborted.
The code I used =============================== #!/bin/bash #Full Day Backup Script #application folders backup #test is the username now=$(date +"%d-%m-%Y") [Code]...
i just touch linux, may i know how can i convert the core dump file to a readable textfile, which include all the information, which is in core dump, such as all variables, threads information, call trace for each tasks, and so on. i know use the GDB can view this, but it won't dump all the informations to one text file. but sometimes, people want to view the core dump reason without Linux environment.
When I debug a program with GDB and hit a break point I get:
Missing separate debuginfo for /lib64/ld-linux-x86-64.so.2 Try: zypper install -C "debuginfo(build-id)=2b25d8329d1aa713a2cc61b5cb701f6f89c78022" Missing separate debuginfo for /lib64/libm.so.6 Try: zypper install -C "debuginfo(build-id)=f05646449077dfbf15d5f78251a3b25e0f955dd9" Missing separate debuginfo for /lib64/libc.so.6 Try: zypper install -C "debuginfo(build-id)=9b674b2caef1982db55e436bca814060e1705b7f"
When I install the suggested packages the debuginfo does not match the object files. I get:
warning: the debug information found in "/usr/lib/debug//lib64/libc-2.11.2.so.debug" does not match "/lib64/libc.so.6" (CRC mismatch). warning: the debug information found in "/usr/lib/debug/lib64/libc-2.11.2.so.debug" does not match "/lib64/libc.so.6" (CRC mismatch). Missing separate debuginfo for /lib64/libc.so.6 Try: zypper install -C "debuginfo(build-id)=9b674b2caef1982db55e436bca814060e1705b7f"
The last package is not found. Is this missing from the repositories?
I am a hobbyist interested in development and have recently decided to migrate from Windows to Linux and after trying out a number of distributions decided to use openSUSE. After getting somewhat more comfortable with Linux and openSUSE I decided to try and get comfortable with development on this platform.
And hence my problem: After compiling the simplest of programs (hello world) and trying to step through it with gdb I get this output: Missing separate debuginfo for /lib64/ld-linux-x86-64.so.2 Try: zypper install -C "debuginfo(buildid)=2b25d8329d1aa713a2cc61b5cb701f6f89c78022" Missing separate debuginfo for /lib64/libc.so.6 Try: zypper install -C "debuginfo(buildid)=9b674b2caef1982db55e436bca814060e1705b7f"
As soon as I type the command start in gdb. Naturally I tried the recommended zypper downloads to no avail. Furthermore I sought out the glibc debuginfo in the software manager and found nothing which I have not already installed.
On my system are:-devel-32bit glibc glibc-32bit glibc-devel glibc glibc-info glibc-locale glibc-locale-32bit glibc-profile glibc-profile-32bit gdb gdbm gdbm-32bit
All of these are the latest version from the standard 11.3 repositories. I believe these are all the requirements I should need to not have gdb give me errors but sadly that is not the case. Lastly I am running on a 64bit version of openSUSE 11.3.
I remotely access to my OPENsuse 11. I am using TightVNC program. There is nothing wrong with accessing. But I have to start an analysis program, an this analysis takes about 4 to 6 hours. Therefore, I want to disconnect and let my analysis continue.But after disconnecting from suse, the program i started stops to work. Does anybody know how not to kill the program while i am not connected?
My CPU has 2 cores, so I can see two parts in /proc/cpuinfo.But, I want to know if CPUs that support Hyper-Threading (or similar tech), will /proc/cpuinfo give CPU info per core or per thread (or call it sibling)?I only know that Windows Task Manager will give CPU usage statistics per thread if the CPU supports HT.
Assume someone bind a particular process to a particular CPU core(In multi core machine) by using sched_setaffinity() like functions. Then how we can get that process running core id and CPU core utilisation of that process on that running CPU core(Pragmatically or by a Linux command)?.
I am currently looking for tools for static/dynamic code analysis for embedded Linux system development (both device driver and user space apps). We will use Eclipse IDE and C++ lanuage. I hope the tools are easy-to-use, reliable, popular, better with good supports, and not-too-expensive. I already find a list of tools at WiKi, however, I don't have time to try them all. Could anyboy please recommend me a few? If you can tell me briefly about their pros and cons, that will be the bet.
downloaded a project from the Internet and tried to debug it, but run into a problem. i managed to copy the part where it build the executable I need. The problem is that I cannot use gdb with this executable for some reason. However, running the it without gdb seems to work ok. Below is what it shows when compiling and link.
I have a process which runs for a while and then due to some unknown reason ends abruptly without giving a core. I tried looking in the logs and after watching for a pattern am still not 100% sure of the reason. So I was wondering if there is a way to catch the signal which ends the process and print some values in the handler function. I have called the handler for SIGTERM and SIGABRT functions but none of these are getting triggered. I looked online and did not find any other option. Can you please suggest if tehre is any other signal that can be caught for this unknown abrupt termination.
I'm trying to write a C program that extends an array to any user inputed size.
Code: if (arraysize == 0) { arraysize = (int) pos + 1; a = (int *) calloc (arraysize,sizeof(int)); for (i = 0 ; i < arraysize ; i++ ) a[i] = -1; code....
The program dumps with that sequence of inputs everytime, but might dump an input before or after if different positions are requested. Interestingly, when I tested pos = 2000..2008, I got no dumps. So is realloc somehow trying to extend the array into bad space?
I have a html page that calls a c cgi script on my local server; how can i view the html page and debug the script at the same time? if i would give some input in a form on the html page then i want to debug the script with the entered data. my gues was with w3m and gdb but i don't know how its done...
It seems GDB can not expand or show the macro expansion or its definition under the GDB debug to while debugging the program. how to debug macros under GDB?
I have developed an application written in C, Linux well tested and stripped off all the symbols for final deployment. When I'm testing the stripped off version of the application in the field. Here the application has got crashed. Now how to debug the application.
is there a way to debug my library files from DDD? Basically a way to pass the paths to DDD so I can view the source etc. I'm having a segmentation nightmare, which only crops up about every 10 or so starts, I know it's in one file in a library. I could move the source file into my general code to debug, but am sure there's a way in DDD.