From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4947 invoked by alias); 18 Jun 2013 08:56:50 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 4924 invoked by uid 48); 18 Jun 2013 08:56:49 -0000 From: "vgiraud at neotion dot com" To: gdb-prs@sourceware.org Subject: [Bug cli/15642] New: Crash using 'rbreak' Date: Tue, 18 Jun 2013 08:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: cli X-Bugzilla-Version: 7.6 X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: vgiraud at neotion dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-q2/txt/msg00432.txt.bz2 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.