From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/977 Path: news.gmane.org!not-for-mail From: orc Newsgroups: gmane.linux.lib.musl.general Subject: bug? sysinfo() and getopt_long() misbehavior Date: Fri, 8 Jun 2012 00:51:48 +0800 Message-ID: <20120608005148.7d82c40b@sibserver.ru> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1339088033 9139 80.91.229.3 (7 Jun 2012 16:53:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 7 Jun 2012 16:53:53 +0000 (UTC) Cc: Rich Felker To: musl@lists.openwall.com Original-X-From: musl-return-978-gllmg-musl=m.gmane.org@lists.openwall.com Thu Jun 07 18:53:52 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 1Scfy1-0001H3-IR for gllmg-musl@plane.gmane.org; Thu, 07 Jun 2012 18:53:49 +0200 Original-Received: (qmail 6025 invoked by uid 550); 7 Jun 2012 16:53:45 -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 5671 invoked from network); 7 Jun 2012 16:53:41 -0000 X-Mailer: claws-mail Xref: news.gmane.org gmane.linux.lib.musl.general:977 Archived-At: I have built a musl-enabled system and encountered some bugs: - sysinfo() incorrectly works. The result is busybox' free misbehaving: % ./busybox free -m total used free shared buffers Mem: 476 476 0 183 10489 -/+ buffers: 17592186034402 10489 Swap: 10135 10135 0 gdb shows garbage in struct after free calls sysinfo() with musl. Reproducible with: % cat procs.c #include #include int main(void) { struct sysinfo info; if(sysinfo(&info) == 0) printf("procs: %d\n", info.procs); return 0; } % gcc procs.c # glibc % ./a.out procs: 120 % musl-gcc procs.c # musl % ./a.out procs: -149225472 - (did not investigated properly) possible getopt_long() misbehavior, or just miscompile. The result is that iptables and gnu sed misbehaving at command line arguments: % sed -i '/test/d' ttnosuchfile sed: can't find label for jump to `tnosuchfile' % sed '/test/d' -i ttnosuchfile sed: can't read -i: No such file or directory sed: can't read ttnosuchfile: No such file or directory # iptables -vnL iptables v1.4.12.1: unknown arguments found on commandline Try `iptables -h' or 'iptables --help' for more information. # iptables --version iptables v1.4.12.1: unknown arguments found on commandline Try `iptables -h' or 'iptables --help' for more information. Both sed and iptables were compiled with -D_GNU_SOURCE defined. Unfortunately I don't actually know how to fix these two.