This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug corefiles/9825] New: gdb 6.8 cannot show backtrace from core file that it had generated on Linux


Attach to a running java process with gdb. Use the command generate-core-file to
generate the core file. Then detach from the process and use gdb to attach to
the core file. At this stage gdb is not able to show any backtrace from the
core. I typically use gcore to get the core instead of generating from gdb and
they both seem to have the same problem when I use gdb to attach to it later. 

Here is the OS version:
% uname -a
Linux fiazh 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:32:02 EDT 2006 x86_64 x86_64
x86_64 GNU/Linux
% cat /etc/redhat-release 
Red Hat Enterprise Linux ES release 4 (Nahant Update 4)

Here the Java version (however problem exists with 1.5 too):
% java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Server VM (build 10.0-b23, mixed mode)


Here is a sample run.

% javac GCCoreTest.java
% java GCCoreTest &
% gdb -p 26586
(gdb) backtrace
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xf7ef0775 in pthread_join () from /lib32/libpthread.so.0
#2  0x0804dce8 in ContinueInNewThread ()
#3  0x080497f6 in main ()
(gdb) generate-core-file
Saved corefile core.26586
(gdb) detach
Detaching from program: /home/fiaz/dev/tools/Linux/jdk/jdk1.6.0_07/bin/java,
process 26586
(gdb) quit

% gdb `which java` core.26586

warning: Couldn't recognize general-purpose registers in core file.

(no debugging symbols found)
Core was generated by `/home/fiaz/dev/tools/Linux/jdk/jdk1.6.0_07/bin/java'.
[New process 26587]
[New process 26588]
[New process 26589]
[New process 26590]
[New process 26591]
[New process 26592]
[New process 26593]
[New process 26594]
[New process 26595]
[New process 26596]
[New process 26597]
[New process 26598]
[New process 26599]
[New process 26586]

warning: Couldn't recognize general-purpose registers in core file.
#0  0x00000000 in ?? ()
(gdb) backtrace
#0  0x00000000 in ?? ()
(gdb) quit


Here is the java code -

public class GCoreTest {

    /**
     * @param args
     */
    public static void main(String[] args) {
    // TODO Auto-generated method stub
        try {
            Thread.sleep(1000000);
        } catch (InterruptedException ie) {}
        
        System.exit(0);
    }
}

-- 
           Summary: gdb 6.8 cannot show backtrace from core file that it had
                    generated on Linux
           Product: gdb
           Version: 6.8
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: corefiles
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: fiazhossain at yahoo dot com
                CC: gdb-prs at sourceware dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=9825

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]