From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5888 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Bug on fstat()? Date: Sun, 24 Aug 2014 17:05:39 -0400 Message-ID: <20140824210539.GT12888@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1408914363 4470 80.91.229.3 (24 Aug 2014 21:06:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Aug 2014 21:06:03 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5894-gllmg-musl=m.gmane.org@lists.openwall.com Sun Aug 24 23:05:57 2014 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 1XLez2-0000Xf-Pe for gllmg-musl@plane.gmane.org; Sun, 24 Aug 2014 23:05:52 +0200 Original-Received: (qmail 9877 invoked by uid 550); 24 Aug 2014 21:05:52 -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 9866 invoked from network); 24 Aug 2014 21:05:51 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:5888 Archived-At: On Sun, Aug 24, 2014 at 10:51:09PM +0200, piranna@gmail.com wrote: > The values that fstat() is returning are: > > { dev: 2051, > mode: 33261, > nlink: 1, > uid: 1000, > gid: 1000, > rdev: 0, > blksize: 8, > ino: 584753551390482400, > size: 17592186044477, > blocks: 1485010404567043000, > atime: Sun Aug 24 2014 22:33:06 GMT+0200 (CEST), > mtime: Sun Aug 24 2014 22:33:06 GMT+0200 (CEST), > ctime: Thu Jan 01 1970 01:00:00 GMT+0100 (CET), > birthtime: Thu Jan 01 1970 01:00:00 GMT+0100 (CET) } > > As you can see, is giving a size of 164GBs for a file of just 68 > characters :-) ino, blocks and blksize have some strange values too, > but the other fields seems to be normal. As I told you, fstat() give a > correct output while compiling Node.js with glibc. > > I'm using musl with the musl-gcc wrapper, and since it was giving me > problems related to some includes not available, I've done some (not > very clean, I know) symbolic links to them: > > sudo ln -s /usr/include/linux > /usr/include/i386-linux-musl/linux > sudo ln -s /usr/include/i386-linux-gnu/asm /usr/include/i386-linux-musl/asm > sudo ln -s /usr/include/asm-generic > /usr/include/i386-linux-musl/asm-generic > > Any advice about what could be happening? How could I be able to solve it? What prefix is musl-gcc installed in? And have you done anything to modify it or added additional include paths for it? The above symlinks don't make sense for a typical out-of-the-box installation. I suspect you've somehow gotten -I/usr/include added to the CFLAGS during build (either doing it yourself, or as a result of a broken build script) if adding symlinks to /usr/include made a difference, in which case you may be using glibc's headers, not musl's, and thus getting broken results. Rich