From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2189 Path: news.gmane.org!not-for-mail From: Paul Schutte Newsgroups: gmane.linux.lib.musl.general Subject: Possible file stream bug Date: Wed, 24 Oct 2012 21:36:28 +0200 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d042f9f2aead78004ccd3335b X-Trace: ger.gmane.org 1351107399 13857 80.91.229.3 (24 Oct 2012 19:36:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Oct 2012 19:36:39 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2190-gllmg-musl=m.gmane.org@lists.openwall.com Wed Oct 24 21:36:48 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1TR6ky-0005JN-7d for gllmg-musl@plane.gmane.org; Wed, 24 Oct 2012 21:36:48 +0200 Original-Received: (qmail 24292 invoked by uid 550); 24 Oct 2012 19:36:40 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 24284 invoked from network); 24 Oct 2012 19:36:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=Tw02TAOAHMi5en/ADPz0LcBF5aZkZVVWpZiKhkhvo0s=; b=F2b1vt8aGkJFk1aI/xMDGOi5nWdw09D+/55MyUug7mgtQrYAh8+a9xQXXp6/r4y+SP MDGnPFySj8q7dP3yfYAIqFeuI36WjHO4uadbMiuhbvmFnYLAfJl/r7nOzcl+OO0OoZnU U6T6OI9zSs6ZZWfWts24FA5wqtPJAWzB5szW8FyyODUytNthzUGPZn9KQTkqJrdGRpbC nZtCaG6w6aVW41Xs1zblCpnp3jgrXfiAl+zc+75jAWFGgQTxdDC1zO1NiBXWftN5JJh/ /C1khzG9wCvrArnqlU0qs7iJ7MInaLKAOaNosisz662FMXk6yuqhU5UNK1bWC/MTvGVe lkkA== Xref: news.gmane.org gmane.linux.lib.musl.general:2189 Archived-At: --f46d042f9f2aead78004ccd3335b Content-Type: text/plain; charset=ISO-8859-1 Hi I compiled and linked libwebserver-0.5.3 against musl. It would just strangely break halfway through a request. After hours of searching, I found the problem. I can demonstrate it with the following code: #include #include int main() { FILE *fstream; fclose(stdout); fstream=freopen("/dev/tty","w",stdout); if (fstream==NULL) { fprintf(stderr,"freopen failed\n"); } printf("test this\n"); return 0; } This snippet works fine when using glibc. Regards Paul --f46d042f9f2aead78004ccd3335b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi

I compiled and linked libwebserver-0.5.3 against musl.

It = would just strangely break halfway through a request. After hours of search= ing, I found the problem.

I can demonstrate it with the following co= de:

#include <unistd.h>
#include <stdio.h>

int main()= {
=A0=A0=A0 FILE *fstream;

=A0=A0=A0 fclose(stdout);

=A0= =A0=A0 fstream=3Dfreopen("/dev/tty","w",stdout);
=A0=A0=A0 if (fstream=3D=3DNULL) {
=A0=A0=A0 =A0=A0=A0 fprintf(stderr,"freopen failed\n");
=A0=A0= =A0 }

=A0=A0=A0 printf("test this\n");
=A0=A0=A0
=A0=A0=A0 return 0;
}

This snippet works fine when using glibc.=

Regards
Paul


--f46d042f9f2aead78004ccd3335b--