From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2205 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Difference between -O2 and -g Date: Thu, 25 Oct 2012 22:32:54 -0400 Message-ID: <20121026023254.GU254@brightrain.aerifal.cx> References: <20121026014022.GT254@brightrain.aerifal.cx> 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 1351218790 16231 80.91.229.3 (26 Oct 2012 02:33:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Oct 2012 02:33:10 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2206-gllmg-musl=m.gmane.org@lists.openwall.com Fri Oct 26 04:33:19 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 1TRZjU-0005id-Oa for gllmg-musl@plane.gmane.org; Fri, 26 Oct 2012 04:33:12 +0200 Original-Received: (qmail 12250 invoked by uid 550); 26 Oct 2012 02:33:04 -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 12242 invoked from network); 26 Oct 2012 02:33:04 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2205 Archived-At: On Fri, Oct 26, 2012 at 10:04:46AM +0800, Brian Wang wrote: > > One very simple way to get a picture of what's going on in a program > > is to run it under strace. Try saving strace logs for both the working > > version and the broken version and comparing them either manually or > > with the diff utility (although the latter may be difficult unless you > > filter out the addresses and other contnets that will naturally > > differ, so it might be easier to visually inspect). If you don't > > already have an strace built for your target, I think Aboriginal Linux > > has static binaries you can use. > > I have previously built my static strace. > I could not decipher what went wrong. Please find the strace logs for > the three binaries in question. > The source code is basically the same, except for the musl ones, > printf calls are sprinkled here and there > as my desperate attempt. The good and bad traces diverge at this line, which only happens in the good one: writev(2, [{"CreateColormap : good end\n", 26}, {NULL, 0}], 2) = 26 So search the source for that string and see what condition is causing that code to be reached or not reached. Rich