Date: Thu, 15 Dec 2005 09:50:04 GMT From: David Xu <davidxu@freebsd.org> To: freebsd-threads@FreeBSD.org Subject: Re: threads/90392: libc stdio memory leak with pthread Message-ID: <200512150950.jBF9o46W039280@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR threads/90392; it has been noted by GNATS. From: David Xu <davidxu@freebsd.org> To: bug-followup@freebsd.org, dhartmei@freebsd.org Cc: Subject: Re: threads/90392: libc stdio memory leak with pthread Date: Thu, 15 Dec 2005 17:45:11 +0800 This definitely is a bug in libc, in fact, not only memory leak, but also deadlock. Functions like fscanf, vfscanf will deadlock itself in threaded program, because __svfscanf() calls fread() which will recursively lock the FILE itself! Try following in threaded program: fscanf(stdin, s, "%3c", t); It should deadlock itself. I am fixing it now. David Xu
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200512150950.jBF9o46W039280>