From owner-freebsd-stable@FreeBSD.ORG Sun Oct 9 13:49:07 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD28B106564A for ; Sun, 9 Oct 2011 13:49:07 +0000 (UTC) (envelope-from v.haisman@sh.cvut.cz) Received: from service1.sh.cvut.cz (service1.sh.cvut.cz [IPv6:2001:718:2::214]) by mx1.freebsd.org (Postfix) with ESMTP id EBE338FC0A for ; Sun, 9 Oct 2011 13:49:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by service1.sh.cvut.cz (Postfix) with ESMTP id 455941247FE; Sun, 9 Oct 2011 15:49:06 +0200 (CEST) X-Spam-Score: -100.4 X-Spam-Level: X-Spam-Status: No, score=-100.4 tagged_above=-255 required=5 tests=[ALL_TRUSTED=-1.44, AWL=0.614, CRM114_HAM_00=, RATWARE_GECKO_BUILD=1.426, SMTPAUTH_SHDOMAIN=-100] Received: from service1.sh.cvut.cz ([127.0.0.1]) by localhost (service1.sh.cvut.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hBsBdcjHIhUz; Sun, 9 Oct 2011 15:48:58 +0200 (CEST) Received: from [10.0.0.1] (242.91.broadband5.iol.cz [88.100.91.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: v.haisman@sh.cvut.cz) by service1.sh.cvut.cz (Postfix) with ESMTP id 8692B1248C8; Sun, 9 Oct 2011 15:48:58 +0200 (CEST) Message-ID: <4E91A649.5060207@sh.cvut.cz> Date: Sun, 09 Oct 2011 15:48:57 +0200 From: =?UTF-8?B?VsOhY2xhdiBaZW1hbg==?= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: freebsd-stable@freebsd.org References: <4E8CC6BC.9040605@sh.cvut.cz> <20111006064038.CFB34B852@mail.bitblocks.com> <4E91A0C3.7030305@sh.cvut.cz> In-Reply-To: <4E91A0C3.7030305@sh.cvut.cz> X-Enigmail-Version: 1.3.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: valgrind on FreeBSD? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2011 13:49:07 -0000 Václav Zeman wrote, On 9.10.2011 15:25: > Bakul Shah wrote, On 6.10.2011 8:40: >> On Wed, 05 Oct 2011 23:06:04 +0200 =?UTF-8?B?VsOhY2xhdiBaZW1hbg==?= wrote: >>> Hi. >>> >>> No matter what I try, valgrind on 7.3-STABLE is giving me this, both Valgrind >>> ports: >>> >>> valgrind: Startup or configuration error: >>> Can't establish current working directory at startup >>> valgrind: Unable to start up properly. Giving up. >>> >>> What do I need to do to make it work? >> >> Try running valgrind under ktrace (& view with kdump). That >> will tell you what directory it is trying to access or what >> syscall fails and why. > Hi. > > So I have done that and more. I have first updated from 7.3 to 8.2 (RELENG_8 > actually). I have not managed to recompile all of the installed Ports yet, > but I made sure to recompile valgrind and its dependencies. The same thing > has happened! > > As I have said, I have done the ktrace and here is the interesting bit: > > 78028 valgrind NAMI "/usr/local/lib/valgrind/memcheck-amd64-freebsd" > 78028 memcheck-amd64-free RET execve 0 > 78028 memcheck-amd64-free CALL getpid > 78028 memcheck-amd64-free RET getpid 78028/0x130cc > 78028 memcheck-amd64-free CALL > __sysctl(0x39a91450,0x4,0x389a3800,0x39a91468,0,0) > 78028 memcheck-amd64-free SCTL "kern.proc.vmmap.78028" > 78028 memcheck-amd64-free RET __sysctl 0 > 78028 memcheck-amd64-free CALL > mmap(0x400009000,0x400000,PROT_READ|PROT_WRITE|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_ANON,0xffffffffffffffff,0) > 78028 memcheck-amd64-free RET mmap 17179906048/0x400009000 > 78028 memcheck-amd64-free CALL getrlimit(RLIMIT_DATA,0x39e6a780) > 78028 memcheck-amd64-free RET getrlimit 0 > 78028 memcheck-amd64-free CALL setrlimit(RLIMIT_DATA,0x39a919e0) > 78028 memcheck-amd64-free RET setrlimit 0 > 78028 memcheck-amd64-free CALL getrlimit(RLIMIT_STACK,0x39e6a790) > 78028 memcheck-amd64-free RET getrlimit 0 > 78028 memcheck-amd64-free CALL __getcwd(0x3882d700,0x3ff) > 78028 memcheck-amd64-free NAMI ".." > 78028 memcheck-amd64-free RET __getcwd -1 errno 2 No such file or directory > 78028 memcheck-amd64-free CALL write(0x2,0x3830b060,0x6c) > 78028 memcheck-amd64-free GIO fd 2 wrote 108 bytes > "valgrind: Startup or configuration error: > valgrind: Can't establish current working directory at startup > " > 78028 memcheck-amd64-free RET write 108/0x6c > 78028 memcheck-amd64-free CALL write(0x2,0x3830b060,0x33) > 78028 memcheck-amd64-free GIO fd 2 wrote 51 bytes > "valgrind: Unable to start up properly. Giving up. > " > 78028 memcheck-amd64-free RET write 51/0x33 > 78028 memcheck-amd64-free CALL exit(0x1) > > Now what? Why would the __getcwd call be failing with "No such file or > directory"? > It is the nullfs! I have /home mounted using nullfs to /usr/home: /usr/home /home nullfs rw,multilabel,acls 0 0 When I run valgrind from the /usr based directory, it works: shell::wilx:/usr/home/users/wilx/tmp/yttool> valgrind --tool=memcheck ./yttool ==34679== Memcheck, a memory error detector ==34679== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==34679== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info ==34679== Command: ./yttool ==34679== ==34679== ==34679== HEAP SUMMARY: ==34679== in use at exit: 20,395 bytes in 119 blocks ==34679== total heap usage: 6,719 allocs, 6,600 frees, 716,787 bytes allocated ==34679== ==34679== LEAK SUMMARY: ==34679== definitely lost: 0 bytes in 0 blocks ==34679== indirectly lost: 0 bytes in 0 blocks ==34679== possibly lost: 134 bytes in 4 blocks ==34679== still reachable: 20,261 bytes in 115 blocks ==34679== suppressed: 0 bytes in 0 blocks ==34679== Rerun with --leak-check=full to see details of leaked memory ==34679== ==34679== For counts of detected and suppressed errors, rerun with: -v ==34679== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) But when I run it from the nullfs mount, it fails: shell::wilx:/usr/home/users/wilx/tmp/yttool> cd $HOME/tmp/yttool shell::wilx:~/tmp/yttool> valgrind --tool=memcheck ./yttool valgrind: Startup or configuration error: valgrind: Can't establish current working directory at startup valgrind: Unable to start up properly. Giving up. -- VZ