Subject: Re: bin/30143
To: None <nathanw@netbsd.org, gnats-admin@netbsd.org,>
From: Arto Huusko <arto.huusko@utu.fi>
List: netbsd-bugs
Date: 05/06/2005 07:09:01
The following reply was made to PR kern/30143; it has been noted by GNATS.

From: Arto Huusko <arto.huusko@utu.fi>
To: gnats-bugs@NetBSD.org
Cc: nathanw@wasabisystems.com
Subject: Re: bin/30143
Date: Fri, 06 May 2005 10:08:23 +0300

 Nathan J. Williams wrote:
 > armihu@utu.fi writes:			
 > 
 >>>Description:
 >>
 >>gdb does not work with threaded programs. At least trying to get a
 >>stack trace from a core dump does not work, but fails with something
 >>like this:
 >>
 >>#0  0x080486fe in test (x=Cannot access memory at address 0xbfbfe810
 > 
 > From looking at this on my system, I think this is a problem with the
 > core-dumping code. Can you send me the output of "ls -l test.core" and
 > "readelf -a test.core"? I believe the offsets given in the header are
 > larget than the file itself, and I am investigating why.
 
 With -lpthread, ls -l test.core:
 
 -rw-------  1 arto  users  229376 May  6 10:03 test.core
 
 readelf -a test.core:
 
 ELF Header:
    Magic:   7f 45 4c 46 01 01 01 00 00 00 ca ca cc 44 f5 cb
    Class:                             ELF32
    Data:                              2's complement, little endian
    Version:                           1 (current)
    OS/ABI:                            UNIX - System V
    ABI Version:                       0
    Type:                              CORE (Core file)
    Machine:                           Intel 80386
    Version:                           0x1
    Entry point address:               0x0
    Start of program headers:          52 (bytes into file)
    Start of section headers:          0 (bytes into file)
    Flags:                             0x0
    Size of this header:               52 (bytes)
    Size of program headers:           32 (bytes)
    Number of program headers:         23
    Size of section headers:           0 (bytes)
    Number of section headers:         0
    Section header string table index: 0
 
 There are no sections in this file.
 
 Program Headers:
    Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
    LOAD           0x001000 0x08048000 0x00000000 0x00000 0x01000 R E 0x1000
    LOAD           0x001000 0x08049000 0x00000000 0x03000 0x03000 RW  0x1000
    LOAD           0x004000 0xbdb1a000 0x00000000 0x01000 0x01000 RW  0x1000
    LOAD           0x005000 0xbdb1b000 0x00000000 0x00000 0xa8000 R E 0x1000
    LOAD           0x005000 0xbdbc3000 0x00000000 0x07000 0x07000 RW  0x1000
    LOAD           0x00c000 0xbdbca000 0x00000000 0x0e000 0x0e000 RW  0x1000
    LOAD           0x01a000 0xbdbd8000 0x00000000 0x11000 0x11000 R E 0x1000
    LOAD           0x02b000 0xbdbe9000 0x00000000 0x01000 0x01000 RW  0x1000
    LOAD           0x02c000 0xbdbea000 0x00000000 0x01000 0x01000 RW  0x1000
    LOAD           0x02d000 0xbdbeb000 0x00000000 0x08000 0x08000 RW  0x1000
    LOAD           0x035000 0xbdbf3000 0x00000000 0x00000 0x01000 R E 0x1000
    LOAD           0x035000 0xbdbf4000 0x00000000 0x00000 0x0a000 R E 0x1000
    LOAD           0x035000 0xbdbfe000 0x00000000 0x01000 0x01000 RW  0x1000
    LOAD           0x036000 0xbdbff000 0x00000000 0x01000 0x01000 RW  0x1000
    LOAD           0x037000 0xbdc00000 0x00000000 0x00000 0x1e00000   0x1000
    LOAD           0x037000 0xbfa00000 0x00000000 0x01000 0x01000 RW  0x1000
    LOAD           0x038000 0xbfa01000 0x00000000 0x01000 0x01000     0x1000
    LOAD           0x039000 0xbfa02000 0x00000000 0x0e000 0x0e000 RW  0x1000
    LOAD           0x047000 0xbfa10000 0x00000000 0x00000 0x1b0000 RW  0x1000
    LOAD           0x047000 0xbfbc0000 0x00000000 0x10000 0x10000 RW  0x1000
    LOAD           0x057000 0xbfbd0000 0x00000000 0x00000 0x20000 RW  0x1000
    LOAD           0x057000 0xbfbf0000 0x00000000 0x10000 0x10000 RW  0x1000
    NOTE           0x000314 0x00000000 0x00000000 0x0019c 0x00000 R   0x4
 
 There is no dynamic segment in this file.
 
 There are no relocations in this file.
 
 There are no unwind sections in this file.
 
 No version information found in this file.
 
 Notes at offset 0x00000314 with length 0x0000019c:
    Owner         Data size       Description
    NetBSD-CORE           0x000000a0      NetBSD procinfo structure
    NetBSD-CORE@1         0x00000040      PT_GETREGS (reg structure)
    NetBSD-CORE@1         0x0000006c      PT_GETFPREGS (fpreg structure)
 
 
 Without -lpthread, ls -l test.core:
 
 -rw-------  1 arto  users  200704 May  6 10:07 test.core
 
 And readelf -a test.core:
 
 ELF Header:
    Magic:   7f 45 4c 46 01 01 01 00 00 00 ca ca 9c 41 f5 cb
    Class:                             ELF32
    Data:                              2's complement, little endian
    Version:                           1 (current)
    OS/ABI:                            UNIX - System V
    ABI Version:                       0
    Type:                              CORE (Core file)
    Machine:                           Intel 80386
    Version:                           0x1
    Entry point address:               0x0
    Start of program headers:          52 (bytes into file)
    Start of section headers:          0 (bytes into file)
    Flags:                             0x0
    Size of this header:               52 (bytes)
    Size of program headers:           32 (bytes)
    Number of program headers:         14
    Size of section headers:           0 (bytes)
    Number of section headers:         0
    Section header string table index: 0
 
 There are no sections in this file.
 
 Program Headers:
    Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
    LOAD           0x001000 0x08048000 0x00000000 0x00000 0x01000 R E 0x1000
    LOAD           0x001000 0x08049000 0x00000000 0x01000 0x01000 RW  0x1000
    LOAD           0x002000 0xbdb2e000 0x00000000 0x00000 0xa8000 R E 0x1000
    LOAD           0x002000 0xbdbd6000 0x00000000 0x07000 0x07000 RW  0x1000
    LOAD           0x009000 0xbdbdd000 0x00000000 0x0e000 0x0e000 RW  0x1000
    LOAD           0x017000 0xbdbeb000 0x00000000 0x08000 0x08000 RW  0x1000
    LOAD           0x01f000 0xbdbf3000 0x00000000 0x00000 0x01000 R E 0x1000
    LOAD           0x01f000 0xbdbf4000 0x00000000 0x00000 0x0a000 R E 0x1000
    LOAD           0x01f000 0xbdbfe000 0x00000000 0x01000 0x01000 RW  0x1000
    LOAD           0x020000 0xbdbff000 0x00000000 0x01000 0x01000 RW  0x1000
    LOAD           0x021000 0xbdc00000 0x00000000 0x00000 0x1e00000     0x1000
    LOAD           0x021000 0xbfa00000 0x00000000 0x00000 0x1f0000 RW  0x1000
    LOAD           0x021000 0xbfbf0000 0x00000000 0x10000 0x10000 RW  0x1000
    NOTE           0x0001f4 0x00000000 0x00000000 0x0019c 0x00000 R   0x4
 
 There is no dynamic segment in this file.
 
 There are no relocations in this file.
 
 There are no unwind sections in this file.
 
 No version information found in this file.
 
 Notes at offset 0x000001f4 with length 0x0000019c:
    Owner         Data size       Description
    NetBSD-CORE           0x000000a0      NetBSD procinfo structure
    NetBSD-CORE@1         0x00000040      PT_GETREGS (reg structure)
    NetBSD-CORE@1         0x0000006c      PT_GETFPREGS (fpreg structure)