public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "alexander.andrianov at oracle dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug corefiles/14944] New: "Couldn't find general-purpose registers in core file." while reading 32-bit core files on Solaris 11.
Date: Tue, 11 Dec 2012 15:32:00 -0000	[thread overview]
Message-ID: <bug-14944-4717@http.sourceware.org/bugzilla/> (raw)

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

             Bug #: 14944
           Summary: "Couldn't find general-purpose registers in core
                    file." while reading 32-bit core files on Solaris 11.
           Product: gdb
           Version: 7.5
            Status: NEW
          Severity: normal
          Priority: P2
         Component: corefiles
        AssignedTo: unassigned@sourceware.org
        ReportedBy: alexander.andrianov@oracle.com
    Classification: Unclassified


Starting with version 7.1 reading of 32-bit core files on Solaris is not
working properly. This issue is reproducible with GDB built with both Oracle
Solaris Studio or gcc 4.5.2. 

The issue also exists in the current snapshot of source files. 

Consider the following code generating segfault:

$cat ~/work/segfault/segfault.c 
#include <stdio.h>
#include <string.h>

int main(void)
{
    printf("Warning: Segmentation Fault should occur\n");
    char *dest = 0x0;
    memcpy (dest, "lol", 3);
    return 0;
}

If we compile segfault.c with -m32 option and run to generate core file, GDB is
not able to read the core file properly.


$./gdb ~/work/segfault/segfault.i386 -c ~/work/segfault/core.i386
GNU gdb (GDB) 7.5.50.20121129-cvs
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "i386-pc-solaris2.11".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from ~/work/segfault/segfault.i386...done.

warning: Couldn't find general-purpose registers in core file.
Core was generated by `./segfault.i386'.

warning: Couldn't find general-purpose registers in core file.
#0  <unavailable> in ?? ()
(gdb) quit


At the same time, GDB compiled with -g option (CFLAGS=-g) works properly:


#./gdb ~/work/segfault/segfault.i386 -c ~/work/segfault/core.i386
GNU gdb (GDB) 7.5.50.20121129-cvs
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "i386-pc-solaris2.11".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from ~/work/segfault/segfault.i386...done.
[New LWP 1]
Core was generated by `./segfault.i386'.
Program terminated with signal 11, Segmentation fault.
#0  0xbfe3c2b4 in memcpy () from /usr/lib/libc.so.1
(gdb) quit


The problem was introduced after these changes:

    2010-01-04  Daniel Gutson  <dgutson@codesourcery.com>

            * bfd.m4 (BFD_HAVE_SYS_PROCFS_TYPE): Define _STRUCTURE_PROC
            before including procfs.h.
            (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Likewise.
            * configure.in: Added autoconf probe for the pr_fpreg member.
            * configure: Regenerated.
            * config.in: Regenerated.
            * elf.c: Define _STRUCTURE_PROC before including procfs.h.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


             reply	other threads:[~2012-12-11 15:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-11 15:32 alexander.andrianov at oracle dot com [this message]
2012-12-11 17:09 ` [Bug corefiles/14944] " palves at redhat dot com
2012-12-11 17:12 ` palves at redhat dot com
2012-12-11 19:06 ` alexander.andrianov at oracle dot com
2012-12-11 19:09 ` palves at redhat dot com
2012-12-12 11:28 ` alexander.andrianov at oracle dot com
2012-12-12 11:55 ` palves at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-14944-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).