public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vgiraud at neotion dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug cli/15642] New: Crash using 'rbreak'
Date: Tue, 18 Jun 2013 08:56:00 -0000	[thread overview]
Message-ID: <bug-15642-4717@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 15642
           Summary: Crash using 'rbreak'
           Product: gdb
           Version: 7.6
            Status: NEW
          Severity: minor
          Priority: P2
         Component: cli
          Assignee: unassigned at sourceware dot org
          Reporter: vgiraud at neotion dot com

Hi all,

I've found something strange trying to use 'rbreak'
I instantanetly get a segfault. A bt bring me in gdb code, here :
jimregexp.c:1021
static int regtry( regex_t *preg, const char *string )
{
    int i;

    preg->reginput = string;

    for (i = 0; i < preg->nmatch; i++) {
        preg->pmatch[i].rm_so = -1;
        preg->pmatch[i].rm_eo = -1;
    }
    if (regmatch(preg, 1)) {
        preg->pmatch[0].rm_so = string - preg->start;
        preg->pmatch[0].rm_eo = preg->reginput - preg->start; // It crash here
!!!
        return(1);
    } else
        return(0);
}

If I go back I see that the problem may come from here :
symtab.c:3386
static int
search_symbols_name_matches (const char *symname, void *user_data)
{
  struct search_symbols_data *data = user_data;

  return !data->preg_p || regexec (&data->preg, symname, 0, NULL, 0) == 0;
}

Signature of regexec :
int regexec(regex_t  *preg,  const  char *string, size_t nmatch, regmatch_t
pmatch[], int eflags)

Why NULL ?? It's clear that if pmatch is NULL preg->pmatch[0].rm_eo =
preg->reginput - preg->start; can't work !

I only load an .elf and type rbreak 1. I know it's not like that it work, but
it should not segfault.

Vivien !

-- 
You are receiving this mail because:
You are on the CC list for the bug.


             reply	other threads:[~2013-06-18  8:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-18  8:56 vgiraud at neotion dot com [this message]
2013-06-18 10:19 ` [Bug cli/15642] " vgiraud at neotion dot com
2013-06-18 14:00 ` tromey at redhat dot com
2022-12-05  2:57 ` tromey at sourceware dot org

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-15642-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).