X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 67C7DDC007C for ; Wed, 9 Jul 2014 04:39:52 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id et14so8569966pad.27 for ; Tue, 08 Jul 2014 21:39:51 -0700 (PDT) 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) Received: from newbook ([50.0.227.219]) by mx.google.com with ESMTPSA id zc10sm210889038pac.46.2014.07.08.21.39.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Jul 2014 21:39:50 -0700 (PDT) Date: Tue, 8 Jul 2014 21:39:47 -0700 From: Isaac Dunham To: musl@lists.openwall.com;, alpine-devel@lists.alpinelinux.org Subject: [alpine-devel] Attempting to debug C++ library and command via valgrind Message-ID: <20140709043946.GA1787@newbook> X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) 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 --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---