🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #10173

Bug in value_x_unop ()

#10173
From: Bryan Boreham
Date: Sun, 08 Apr 1990 17:19
36 lines
2054 bytes
This line:

  argvec[0] = value_struct_elt (arg1, argvec+1, tstr, static_memfuncp, "structure");

should probably pass the *address* of static_memfuncp, to match the
declaration of value_struct_elt in valops.c.  Lint would have told you
this :-)

Here's an example of the bug in action -- sorry it's a bit contrived
and dependent on a particular line-number in a file, but hopefully
you'll get the idea.

kewill% gdb gdb
GDB 3.5, Copyright (C) 1989 Free Software Foundation, Inc.
There is ABSOLUTELY NO WARRANTY for GDB; type "info warranty" for details.
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "info copying" to see the conditions.
Reading symbol data from /usr.MC68020/local/src/gdb-3.5/gdb...done.
(gdb) b dbxread.c:2024
Reading in symbols for dbxread.c...done.
Breakpoint 1 at 0x1e462: file dbxread.c, line 2024.
(gdb) run -q gdb
Starting program: /usr.MC68020/local/src/gdb-3.5/gdb -q gdb
Reading symbol data from /usr.MC68020/local/src/gdb-3.5/gdb...
Bpt 1, read_dbx_symtab (desc=4, stringtab=(char *) 0x84c10 , stringtab_size=2633
71, nlistlen=31973, inclink=0, text_addr=8192, text_size=294912) (dbxread.c line
 2024)
2024          if (bufp->n_type == N_SLINE) continue;
(gdb) p *bufp
$1 = {n_un = {n_name = 0x4 <Address 0x4 out of bounds>, n_strx = 4}, n_type = 4
'\004', n_other = 0 '\000', n_desc = 0, n_value = 8224}
(gdb) p sizeof $
Segmentation fault (core dumped)


Bryan.
Technical Details
Message-ID: <9004081719.AA22662@kewill.uucp>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!relay.eu.net!kewill!bryan

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5053,e6f29187ab3317ce,start
X-Google-Attributes: gidf5053,public
X-Google-ArrivalTime: 1990-04-08 23:41:48 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!relay.eu.net!kewill!bryan
From: kewill!bryan@relay.eu.net (Bryan Boreham)
Newsgroups: gnu.gdb.bug
Subject: Bug in value_x_unop ()
Message-ID: <9004081719.AA22662@kewill.uucp>
Date: 8 Apr 90 17:19:43 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 36
Posted: Sun Apr  8 18:19:43 1990