Subject: lib/2360: cc error in libc
To: None <gnats-bugs@NetBSD.ORG>
From: None <ivanenko@ctpa03.mit.edu>
List: netbsd-bugs
Date: 04/30/1996 14:13:15
>Number:         2360
>Category:       lib
>Synopsis:       cc 2.7.2 can not compile  libc.so
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 30 14:50:01 1996
>Last-Modified:
>Originator:     Taras Ivanenko
>Organization:
	MIT
>Release:        960429
>Environment:
	
System: NetBSD ctps01.mit.edu 1.1 NetBSD 1.1 (ctp-sun-slc-disk) #0: Wed Mar 20 22:54:14 EST 1996 ivanenko@ctps03.mit.edu:/usr/src/sys/arch/sparc/compile/ctp-sun-slc-disk sparc


>Description:
	I have upgraded gcc to 2.7.2, rebuild libraries with new includes 
and new compiler and tried to rebuild compiler again. The make depend process stops at genatttr. After some inverstigation I localized the problem to fopen() call. Sometimes this call hangs, sometimes dumps core. Definitely, something is wrong with a shared library. I checked that the static library works and that the correct version of dynamic library is loaded.

>How-To-Repeat:
This code is sufficient to demonstrate the problem: (file x.c)
#include <stdio.h>

main(){
FILE *f = fopen("x.c","r");
fclose(f);
return 0;
}

cc -o x x.c; ./x

>Fix:
	cc -static fixes the problem
>Audit-Trail:
>Unformatted: