This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Re: read/thread/deadlock
>>>>> marc writes:
>> Description:
> perl compiled with thread support freezes in the testsuite on the t/io/read.t test. attaching
> to the process gives me the following backtrace:
> #0 0x4005bdc1 in __syscall_rt_sigsuspend ()
> #1 0x4005ada8 in __sigsuspend (set=0xbffff568) at ../sysdeps/unix/sysv/linux/sigsuspend.c:44
> #2 0x40168479 in __pthread_lock (lock=0x8110eb8) at restart.h:32
> #3 0x4016643d in __pthread_mutex_lock (mutex=0x8110ea8) at mutex.c:84
> #4 0x40167ea7 in __flockfile (stream=0x8110e10) at lockfile.c:32
> #5 0x4008bae4 in _IO_seekoff (fp=0x8110e10, offset=0, dir=0, mode=3) at ioseekoff.c:41
> #6 0x4008c474 in fseek (fp=0x8110e10, offset=0, whence=0) at fseek.c:39
> #7 0x80ec3bf in Perl_do_seek ()
> incidently, fseek locks the stream before calling ioseekfoff, which tries to
> do the same. after removing the lock, the testsuite stopped again at various other
> tests, similar diagnose.
>> How-To-Repeat:
> compile perl with support for threads, make test.
I just compiled perl 5.00502 with thread-support using egcs-1.1 and
using a glibc 2.1 from 980814 (later than 2.0.95), Linux 2.113 on
i486. make check did pass the whole perl testsuite (including
io/read).
I do hope that the appended patch fixes your problem. The patch
should be in glibc 2.0.95.
Andreas
P.S. Please fix your mail address - marc@laendle isn't working.
1998-07-22 11:43 Ulrich Drepper <drepper@cygnus.com>
* libio/fileops.c (_IO_file_sync): Don't lock stream here.
Reported by Thorsten Kukuk.
Index: libio/fileops.c
===================================================================
RCS file: /egcs/carton/cvsfiles/libc/libio/fileops.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- fileops.c 1998/07/09 14:40:15 1.34
+++ fileops.c 1998/07/22 16:51:57 1.35
@@ -434,8 +434,6 @@
_IO_size_t delta;
int retval = 0;
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
- _IO_flockfile (fp);
/* char* ptr = cur_ptr(); */
if (fp->_IO_write_ptr > fp->_IO_write_base)
if (_IO_do_flush(fp)) return EOF;
@@ -460,8 +458,6 @@
fp->_offset = _IO_pos_BAD;
/* FIXME: Cleanup - can this be shared? */
/* setg(base(), ptr, ptr); */
- _IO_funlockfile (fp);
- _IO_cleanup_region_end (0);
return retval;
}
--
Andreas Jaeger aj@arthur.rhein-neckar.de jaeger@informatik.uni-kl.de
for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de