Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site hao.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!teddy!panda!talcott!harvard!seismo!hao!pag From: pag@hao.UUCP (Peter Gross) Newsgroups: net.bugs.4bsd Subject: dbx dumps core on some fortran files Message-ID: <1345@hao.UUCP> Date: Mon, 21-Jan-85 18:18:03 EST Article-I.D.: hao.1345 Posted: Mon Jan 21 18:18:03 1985 Date-Received: Wed, 23-Jan-85 06:06:07 EST Distribution: net Organization: High Altitude Obs./NCAR, Boulder CO Lines: 84 Index: src/ucb/dbx/object.c 4.2BSD FIX Description: dbx will dump core on initialization when debugging a fortran file that has a common block with the same name as the source file. Repeat-By: 1. Create a file with the name "srcf.f". Put this 3 line fortran file in it: common /srcf/ test stop end 2. Compile the following program with: f77 -g srcf.f 3. Invoke dbx: dbx a.out dbx will crash (bus error) and dump core. Fix: *** /tmp/,RCSt1020632 Mon Jan 21 16:00:47 1985 --- object.c Mon Jan 21 15:00:24 1985 *************** *** 1,6 /* Copyright (c) 1982 Regents of the University of California */ ! static char sccsid[] = "@(#)object.c 1.13 8/16/83"; /* * Object code interface, mainly for extraction of symbolic information. --- 1,6 ----- /* Copyright (c) 1982 Regents of the University of California */ ! static char *rcsid = "$Header: object.c,v 1.14 85/01/21 14:58:04 pag Exp $"; /* * Object code interface, mainly for extraction of symbolic information. *************** *** 4,9 /* * Object code interface, mainly for extraction of symbolic information. */ #include "defs.h" --- 4,16 ----- /* * Object code interface, mainly for extraction of symbolic information. + * + * $Log: object.c,v $ + * Revision 1.14 85/01/21 14:58:04 pag + * Bug fix from Graham Murphy: dbx would bomb on initialization when + * a common block name was the same as the program source file + * name. + * */ #include "defs.h" *************** *** 294,300 if (curcomm) { curcomm->symvalue.common.chain = commchain; } ! curcomm = lookup(n); if (curcomm == nil) { curcomm = insert(n); curcomm->class = COMMON; --- 301,307 ----- if (curcomm) { curcomm->symvalue.common.chain = commchain; } ! find(curcomm, n) where curcomm->class == COMMON endfind(curcomm); if (curcomm == nil) { curcomm = insert(n); curcomm->class = COMMON; If you don't know the fix, don't include this section or "Fix:". Comments: Bug discovered and fixed by Graham Murphy, a visitor to HAO. --peter gross hao!pag