From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23686 invoked by alias); 3 Nov 2004 12:08:23 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 23440 invoked from network); 3 Nov 2004 12:08:20 -0000 Received: from unknown (HELO webmail.streamline-computing.com) (82.133.39.164) by sourceware.org with SMTP; 3 Nov 2004 12:08:20 -0000 Received: from amavis by webmail.streamline-computing.com with scanned-ok (Exim 3.35 #1 (Debian)) id 1CPJx1-00004z-00; Wed, 03 Nov 2004 12:09:19 +0000 Received: from webmail.streamline-computing.com ([127.0.0.1]) by localhost (webmail [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 31124-10; Wed, 3 Nov 2004 12:09:18 +0000 (GMT) Received: from [82.133.39.162] (helo=[192.168.1.74]) by webmail.streamline-computing.com with esmtp (Exim 3.35 #1 (Debian)) id 1CPJx0-00004r-00; Wed, 03 Nov 2004 12:09:18 +0000 Subject: Re: [PATCH] Seg fault whilst stepping when watch set [ping!] [in breakpoint.c] From: David Lecomber To: Eli Zaretskii , patches In-Reply-To: <01c4c123$Blat.v2.2.2$ffbe6360@zahav.net.il> References: <1097972182.22738.7.camel@localhost.localdomain> <1098720391.1935.0.camel@delmo.priv.wark.uk.streamline-computing.com> <1099347096.31287.3.camel@cpc1-oxfd5-5-0-cust86.oxfd.cable.ntl.com> <01c4c095$Blat.v2.2.2$3f440920@zahav.net.il> <1099385491.31287.19.camel@cpc1-oxfd5-5-0-cust86.oxfd.cable.ntl.com> <01c4c123$Blat.v2.2.2$ffbe6360@zahav.net.il> Content-Type: text/plain Message-Id: <1099483707.7521.27.camel@delmo.priv.wark.uk.streamline-computing.com> Mime-Version: 1.0 Date: Wed, 03 Nov 2004 12:08:00 -0000 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Scanned by Amavis on Capitan at streamline-computing.com X-SW-Source: 2004-11/txt/msg00039.txt.bz2 Hi Eli, Breakpoint 1, 0x08089e8a in main () (gdb) step Single stepping until exit from function main, which has no line number information. sample () at f90demo.f90:72 72 CALL MPI_INIT(ierr) Current language: auto; currently fortran (gdb) watch i Hardware watchpoint 2: i (gdb) n Error in re-setting breakpoint 2: No symbol "i" in current context. {seg fault...} and in the other GDB: Program received signal SIGSEGV, Segmentation fault. evaluate_subexp (expect_type=0x0, exp=0x0, pos=0xbfffef34, noside=EVAL_NORMAL) at eval.c:71 71 return (*exp->language_defn->la_exp_desc->evaluate_exp) #0 evaluate_subexp (expect_type=0x0, exp=0x0, pos=0xbfffef34, noside=EVAL_NORMAL) at eval.c:71 #1 0x080d3fa9 in evaluate_expression (exp=0x0) at eval.c:161 #2 0x080c4341 in insert_bp_location (bpt=0x82d8458, tmp_error_stream=0x82de608, disabled_breaks=0xbfffefd0, process_warning=0xbfffefd4, hw_breakpoint_error=0xbfffefd8) at breakpoint.c:949 #3 0x080c45a7 in insert_breakpoints () at breakpoint.c:1149 #4 0x080f43cd in keep_going (ecs=0xbffff0d0) at infrun.c:2716 #5 0x080f2f47 in handle_inferior_event (ecs=0xbffff0d0) at infrun.c:2543 #6 0x080f270b in wait_for_inferior () at infrun.c:991 #7 0x080f253d in proceed (addr=1, siggnal=TARGET_SIGNAL_DEFAULT, step=1) at infrun.c:814 #8 0x080efe9b in step_1 (skip_subroutines=1, single_inst=0, count_string=0x0) at infcmd.c:688 (gdb) p exp $1 = (struct expression *) 0x0 Looking at frame 2: #2 0x080c4341 in insert_bp_location (bpt=0x82d8458, tmp_error_stream=0x82de608, disabled_breaks=0xbfffefd0, process_warning=0xbfffefd4, hw_breakpoint_error=0xbfffefd8) at breakpoint.c:949 949 v = evaluate_expression (bpt->owner->exp); (gdb) p *bpt $5 = {next = 0x82de5d8, loc_type = bp_loc_hardware_watchpoint, owner = 0x835f3f0, inserted = 0 '\0', duplicate = 0 '\0', address = 0, section = 0x0, shadow_contents = '\0' , requested_address = 0} (gdb) p *(bpt->owner) $6 = {next = 0x83ac680, type = bp_hardware_watchpoint, enable_state = bp_enabled, disposition = disp_donttouch, number = 2, loc = 0x82d8458, line_number = 0, source_file = 0x0, silent = 0 '\0', ignore_count = 0, commands = 0x0, frame_id = {stack_addr = 0, code_addr = 0, special_addr = 0, stack_addr_p = 0, code_addr_p = 0, special_addr_p = 0}, cond = 0x0, addr_string = 0x0, language = language_fortran, input_radix = 10, cond_string = 0x0, exp_string = 0x835d408 "i", exp = 0x0, exp_valid_block = 0x841723c, val = 0x835f8d8, val_chain = 0x0, related_breakpoint = 0x83ac680, watchpoint_frame = {stack_addr = 3221223780, code_addr = 134526326, special_addr = 0, stack_addr_p = 1, code_addr_p = 1, special_addr_p = 0}, thread = -1, hit_count = 0, dll_pathname = 0x0, triggered_dll_pathname = 0x0, forked_inferior_pid = 0, exec_pathname = 0x0, ops = 0x0, from_tty = 0, flag = 0, pending = 0} So bpt->owner->exp is clearly null, which makes it a bad idea to evaluate it ;-) > If the binary is short, then you could alternatively mail it to me as > a binary attachment together with the source and instructions how to > reproduce the crash. Curiously on Fedora 2 I get a seg fault, and Error in re-setting breakpoint 2: No symbol "i" in current context. But on Redhat 9, I get no segfault but do see the above error repeated 3 times.. With my patch, it works fine, for me ;-) d.