From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5419 Path: news.gmane.org!not-for-mail From: Isaac Dunham Newsgroups: gmane.linux.lib.musl.general,gmane.linux.distributions.alpine.devel Subject: Attempting to debug C++ library and command via valgrind Date: Tue, 8 Jul 2014 21:39:47 -0700 Message-ID: <20140709043946.GA1787@newbook> 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 1404880812 23736 80.91.229.3 (9 Jul 2014 04:40:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Jul 2014 04:40:12 +0000 (UTC) To: musl@lists.openwall.com;, alpine-devel@lists.alpinelinux.org Original-X-From: musl-return-5424-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jul 09 06:40:07 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 1X4jfq-0004UW-GJ for gllmg-musl@plane.gmane.org; Wed, 09 Jul 2014 06:40:06 +0200 Original-Received: (qmail 5432 invoked by uid 550); 9 Jul 2014 04:40: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 5420 invoked from network); 9 Jul 2014 04:40:04 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=LZDKYlkotRQ2x07NT0VnUzLcihqAfqTR4n7tjDARPfc=; b=A531TACkDAsi2j3E8AcEDdy0GEtyt0/t9gpuroVKR9G427r5zrBbY5Tti9AkbaRM+P QON3rgecRUG1MDTEIIOmhagXGjnxqgQU+BtAa0JEpj1baRr2KofUJ99/jUHXrQ3fcApz 0BXEqyf02uLryReTsSf+LWFNfJ7T3Uua/VlMjaBamMsXJa9z5RVB0DlY9eOOiJoSwg9T uW7fbS1NAY7g6H+TxKQXZ8ywom9vfpiyRf/HJyh+Daa5OVwV6dw7rwHqzOgRZTCCv0La oihhvF7N0FzA2GQxesDjfxFa3uuLCpIkZ33cCPcB6EUbqN4EXKEYfhOjqHQsjDY4GUQ+ psjA== X-Received: by 10.70.56.42 with SMTP id x10mr9199662pdp.74.1404880791071; Tue, 08 Jul 2014 21:39:51 -0700 (PDT) Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Xref: news.gmane.org gmane.linux.lib.musl.general:5419 gmane.linux.distributions.alpine.devel:2052 Archived-At: Hello, I've been trying to get Sword 1.7.3 (crosswire.org/sword) running on Alpine. Sword is a library for free bible software that comes with a few utilities. It builds fine and runs with few issues, but I'm having a bit of trouble figuring out one of the bugs: valgrind was recommended, but I can't get valgrind to run the command properly. I was asked to provide the output of roughly this command (adjusting for Windows/*nix differences): valgrind --leak-check=full --track-origins=yes \ --keep-stacktraces=alloc-and-free \ utilities/diatheke/.libs/diatheke -b KJV -k Ps117 But when I do this, diatheke errors out: ----- $ valgrind --leak-check=full --track-origins=yes --keep-stacktraces=all oc-and-free diatheke -b KJV -k Ps117 ==5743== Memcheck, a memory error detector ==5743== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==5743== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info ==5743== Command: diatheke -b KJV -k Ps117 ==5743== diatheke: cannot load -b: No such file or directory ==5743== ==5743== HEAP SUMMARY: ==5743== in use at exit: 0 bytes in 0 blocks ==5743== total heap usage: 0 allocs, 0 frees, 0 bytes allocated ==5743== ==5743== All heap blocks were freed -- no leaks are possible ==5743== ==5743== For counts of detected and suppressed errors, rerun with: -v ==5743== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) ----- Comparing this to the default output below, my guess is that the command line parsing is not happening when run from valgind. The bug I'm trying to track down (background): diatheke is a utility that comes with Sword that shows all verses or passages in a bible or book that match a key (such as a reference); the basic command line looks like this: diatheke -b book -k reference The bug is that the last passage/verse gets repeated: $ diatheke -b KJV -k Ps117 Psalms 117:1: O praise the LORD, all ye nations: praise him, all ye people. Psalms 117:2: For his merciful kindness is great toward us: and the truth of the LORD endureth for ever. Praise ye the LORD. : For his merciful kindness is great toward us: and the truth of the LORD endureth for ever. Praise ye the LORD. (KJV) Currently running Alpine edge with linux-vanilla as kernel. All binaries are built using abuild; the system CFLAGS were "-Os -pipe -fomit-frame-pointer", but the package adds "-O3". I got the same results after changing CFLAGS in abuild.comf to "-g -pipe". If the build scripts are desired, I can supply them. Thanks, Isaac Dunham