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 cli/15642] New: Crash using 'rbreak'


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.


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