TEX7%ICNUCEVM.CNUCE.CNR.IT@MITVMA.MIT.EDU (Stefano Diomedi) (07/14/89)
1.
Machine: DEC VAX
Operating system: ULTRIX 3.0
File: load.c
Function: load_average
The variable 'offset' is declared as 'signed' while the
nlist structure is defined in <nlist.h> as:
struct nlist {
char *n_name; /* for use when in-core */
unsigned char n_type; /* type flag, i.e. N_TEXT etc; see below */
char n_other; /* unused */
short n_desc; /* see <stab.h> */
unsigned long n_value; /* value of this symbol (or sdb offset) */
};
The address of "_avenrun" happens to be 2148358396 and offset takes instead
the values -2146608900 so that the following lseek fails.
Here it is:
(gdb) p nl
$1 = {{n_name = 0xc56 "_avenrun", n_type = 9 '\t', n_other = 0 '\000', n_desc =
(gdb) n
(gdb) p offset
$2 = -2146608900
(gdb)
As a patch I changed the declaration of 'offset' adding an 'unsigned',
initialized it to 0 and tested it against 0; I also added 'unsigned'
in the cast
2.
Machine: HP 9000/835
Operating system: HP-UX 3.10 (USG, USGr3)
File: glob.c
calls rindex and not strrchr
File: job.c
calls getdtablesize that doesn't exist
Regards
Stefano Diomedi
Pisa - Italy