threads/90392: libc stdio memory leak with pthread

David Xu davidxu at freebsd.org
Thu Dec 15 01:50:09 PST 2005


The following reply was made to PR threads/90392; it has been noted by GNATS.

From: David Xu <davidxu at freebsd.org>
To: bug-followup at freebsd.org, dhartmei at 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
 


More information about the freebsd-threads mailing list