Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Aug 2001 03:20:07 +0200
From:      Tor.Egge@fast.no
To:        jkf@research.bell-labs.com
Cc:        freebsd-current@FreeBSD.ORG, mflaster@research.bell-labs.com, eran@research.bell-labs.com
Subject:   Re: linux threads and fclose lock problem
Message-ID:  <200108290120.DAA65564@midten.fast.no>
In-Reply-To: Your message of "Tue, 28 Aug 2001 17:54:34 -0400 (EDT)"
References:  <200108282154.RAA15501@zydeco.research.bell-labs.com>

next in thread | previous in thread | raw e-mail | index | archive | help
----Next_Part(Wed_Aug_29_03:19:39_2001)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

> The following test program hangs on current from 8/20/2001.
> The program hangs in the fprintf to the function testThread(),
> instead of running to completion. If the call in main to fclose()
> of an unrelated file descriptor is removed the program runs to 
> completion.
> 
> >From tracing code, it appears that fclose.c locks the file, does some stuff,
> and then *tries* to unlock the file.  But while _flockfile is called,
> _funlockfile is *not*.  (The source for fclose.c calls FUNLOCKFILE(fp) -
> don't know where FUNLOCKFILE is defined.)

_funlockfile is called, but fp->_file is -1 so _funlockfile just
returned.  Under RELENG_4, fp->_file is set to -1 after the
FUNLOCKFILE() statement.

A patch for disabling uthread_file.c in the linuxthreads port for
FreeBSD 5.0-CURRENT is enclosed.  This causes the libc version of
_flockfile to be used.

- Tor Egge


----Next_Part(Wed_Aug_29_03:19:39_2001)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

? work
Index: files/uthread_file.c
===================================================================
RCS file: /home/ncvs/ports/devel/linuxthreads/files/uthread_file.c,v
retrieving revision 1.3
diff -u -r1.3 uthread_file.c
--- files/uthread_file.c	4 Jan 2000 00:05:22 -0000	1.3
+++ files/uthread_file.c	29 Aug 2001 01:12:32 -0000
@@ -45,6 +45,8 @@
 #include "spinlock.h"
 #include "restart.h"
 
+#if __FreeBSD__ == 4
+
 /*
  * Weak symbols for externally visible functions in this file:
  */
@@ -396,3 +398,5 @@
 	}
 	_SPINUNLOCK(&hash_lock);
 }
+
+#endif

----Next_Part(Wed_Aug_29_03:19:39_2001)----

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200108290120.DAA65564>