[gnu.gcc.bug] gcc 1.35 sun 3 os 4, -g option croaks

ulmo@ssyx.ucsc.edu (scritzifchisted ulmo qzutvchsxik) (06/06/89)

Script started on Tue Jun  6 07:20:56 1989
$ cat arg.c
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
main()
{
struct hostent *foo;
if(!(
foo=gethostbyname("ssyx.ucsc.edu")
))exit(-0x1);
puts(foo->h_name);
exit(0);
}

$ cc arg.c
$ a.out
ssyx.ucsc.edu

$ cc -O arg.c
$ a.out
ssyx.ucsc.edu

$ cc -g arg.c
$ a.out
ssyx.ucsc.edu

$ cc -g arg.c
$ a.out
ssyx.ucsc.edu

$ gcc arg.c
$ a.out
ssyx.ucsc.edu

$ gcc -O arg.c
$ a.out
ssyx.ucsc.edu

$ gcc -g arg.c
$ a.out
Memory fault

$ gcc -O -g arg.c
$ a.out
Memory fault

$ gcc -g -traditional arg.c
$ a.out
Memory fault

$ gcc -g -O -traditional arg.c
$ a.out
Memory fault

$ gcc -O arg.c
$ a.out
ssyx.ucsc.edu

$ gcc -v -O arg.c
gcc version 1.35
 /usr/public/lib/gcc/gcc-cpp -v -undef -D__GNUC__ -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__OPTIMIZE__ -D__HAVE_68881__ -Dmc68020 arg.c /tmp/cca17041.cpp
GNU CPP version 1.35
 /usr/public/lib/gcc/gcc-cc1 /tmp/cca17041.cpp -quiet -dumpbase arg.c -O -version -o /tmp/cca17041.s
GNU C version 1.35 (68k, MIT syntax) compiled by GNU C version 1.35.
 as -mc68020 -o arg.o /tmp/cca17041.s
 ld -e start -dc -dp /lib/crt0.o /lib/Mcrt1.o arg.o /usr/public/lib/gcc/gcc-gnulib -lc
$ a.out
ssyx.ucsc.edu
$

script done on Tue Jun  6 07:22:43 1989
Script started on Tue Jun  6 07:29:13 1989
$ gcc -g arg.c
$ gdb a.out
GDB 3.0, Copyright (C) 1988 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 /home/ssyx/ulmo/a.out...done.
Type "help" for a list of commands.
(gdb) break main
Breakpoint 1 at 0x22b2: file arg.c, line 9.
(gdb) si
The program is not being run.
(gdb) si
The program is not being run.
(gdb) run
Starting program: /home/ssyx/ulmo/a.out 

Bpt 1, main () (arg.c line 9)
9       ))exit(-0x1);
(gdb) si
0x22b6  9       ))exit(-0x1);
(gdb) si
0x26fe in gethostbyname ()
(gdb) si
0x2702 in gethostbyname ()
(gdb) si
0x2706 in gethostbyname ()
(gdb) si
0x270c in gethostbyname ()
(gdb) si
0x2710 in gethostbyname ()
(gdb) si
0x2712 in gethostbyname ()
(gdb) si
0x3288 in res_init ()
(gdb) si
0x328c in res_init ()
(gdb) si
0x3290 in res_init ()
(gdb) si
0x3294 in res_init ()
(gdb) si
0x3298 in res_init ()
(gdb) si

Program received signal 11, Segmentation fault
0x3298 in res_init ()
(gdb) si

Program terminated with signal 11, Segmentation fault
The inferior process no longer exists.
(gdb) quit
$
script done on Tue Jun  6 07:30:06 1989

Sorry I am not more proficient at any of this
(this morning I started gdb for the first time).