From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id sFIBBkJNZ2IpwQAAbAwnHQ (envelope-from ) for ; Tue, 26 Apr 2022 03:39:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id WNwkBkJNZ2KweAAA9RJhRA (envelope-from ) for ; Tue, 26 Apr 2022 03:39:14 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 743D4899E for ; Tue, 26 Apr 2022 03:39:13 +0200 (CEST) Received: from localhost ([::1]:53392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1njAAZ-0000Ut-VK for larch@yhetil.org; Mon, 25 Apr 2022 21:39:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59488) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njAAQ-0000Tc-AS for bug-guix@gnu.org; Mon, 25 Apr 2022 21:39:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42576) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1njAAQ-000766-1e for bug-guix@gnu.org; Mon, 25 Apr 2022 21:39:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1njAAP-000704-Vt for bug-guix@gnu.org; Mon, 25 Apr 2022 21:39:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#54728: [PATCH 2/2] gnu: valgrind: fix ld.so symbols not found Resent-From: Denis 'GNUtoo' Carikli Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 26 Apr 2022 01:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54728 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 54728@debbugs.gnu.org, ludo@gnu.org, maximedevos@telenet.be Received: via spool by 54728-submit@debbugs.gnu.org id=B54728.165093708226809 (code B ref 54728); Tue, 26 Apr 2022 01:39:01 +0000 Received: (at 54728) by debbugs.gnu.org; 26 Apr 2022 01:38:02 +0000 Received: from localhost ([127.0.0.1]:36468 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1njA9S-0006yK-CE for submit@debbugs.gnu.org; Mon, 25 Apr 2022 21:38:02 -0400 Received: from cyberdimension.org ([80.67.179.20]:60772 helo=gnutoo.cyberdimension.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1njA9Q-0006xv-Vt for 54728@debbugs.gnu.org; Mon, 25 Apr 2022 21:38:01 -0400 Received: from gnutoo.cyberdimension.org (localhost [127.0.0.1]) by cyberdimension.org (OpenSMTPD) with ESMTP id 20eb9008; Tue, 26 Apr 2022 01:31:54 +0000 (UTC) Received: from localhost.localdomain (localhost [::1]) by gnutoo.cyberdimension.org (OpenSMTPD) with ESMTP id 28a17dd9; Tue, 26 Apr 2022 01:31:54 +0000 (UTC) From: Denis 'GNUtoo' Carikli Date: Tue, 26 Apr 2022 03:39:11 +0200 Message-Id: <20220426013913.20117-1-GNUtoo@cyberdimension.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <2d69d3b032cea71f038fad9bacd7d060d323c110.camel@telenet.be> References: <2d69d3b032cea71f038fad9bacd7d060d323c110.camel@telenet.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1650937153; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=KsxfnC28/wKldSO8tveky1RfIgeAkO28/MsjhBGknfw=; b=YSprYK1i8/Aj3eYSBGI0m7TiK5ts3eMoVAZoEJ78jwPQ+E+4jmVOnolq4XoxiBkKr0zwc9 ATefnajDxcYw/gPToS7hj4dh2uwD4/IkTZrJYP4Xr7O8d/ygO4f9VhHM8+oP7BJ06kOKcb 7DOU9vf/S5FriYRiGqlrXg1I0UxnvNZhVr98pdtCZhxkQC56doroEVuvE+zN/xJtuKNrx5 CO/QVOcSoSe/SDTq3bCnHeStOtj9ALxght/CbpfjP/DRij1RQDtydSb7n+HWUDQ7v4r1Sq etElAmrfvr3qZWJKvHIRRnER/zp8BIXwLIYUIPVvNDndMvV1gdDEgyE7MAn7/A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650937153; a=rsa-sha256; cv=none; b=R6fSKOb+HxKiffbdvSLgEdOzUS5xQDDaqXD39AjT0mR6bvtrd9c0+RNMrd9EfinQuPjcjy WVM8GPx1/5w1mFNmDAiBBi43X0i0R9WyjG2FYHrp5WNTRunWmNrN3PTX7ewKeN4nI0yamg wqMkUMqEaInSp5sDV3GmxcaD5pecAPkkNuRpcFMakpz8LFuSZ/S+j30BuJzqYfyajOJqaz yHHECkWovwNIon1r9qAbEnORu42eRNJ0clgflUKFsTAGGcBFZjgISlHibHm2l0z35tRLx0 y0oQFfh9ijZaWs/9mrRwIoU6bXWjAoGtY0vxBDo7RSuCRUp5lv9PT/WyVu2kOg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.51 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 743D4899E X-Spam-Score: -1.51 X-Migadu-Scanner: scn1.migadu.com X-TUID: Os3gP+KJALX1 Hi, I've now managed to make a proper patch. I've used 'v2' for more clarity. I'll send the files used to test them in a subsequent mails. As for the tests, I've done them in Guix system, once installed valgrind works fine: > $ make check > valgrind -v --leak-check=full ./main > ==20324== Memcheck, a memory error detector > ==20324== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. > ==20324== Using Valgrind-3.18.1-42b08ed5bd-20211015 and LibVEX; rerun with -h for copyright info > ==20324== Command: ./main > ==20324== > --20324-- Valgrind options: > --20324-- -v > --20324-- --leak-check=full > --20324-- Contents of /proc/version: > --20324-- Linux version 5.16.20-gnu (guix@guix) (gcc (GCC) 10.3.0, GNU ld (GNU Binutils) 2.37) #1 SMP PREEMPT 1 > --20324-- > --20324-- Arch and hwcaps: X86, LittleEndian, x86-mmxext-sse1-sse2-sse3 > --20324-- Page sizes: currently 4096, max supported 4096 > --20324-- Valgrind library directory: /gnu/store/gkrqxqxs20mzxwxqpasy1q3w7a1v42w6-valgrind-3.18.1/libexec/valgrind > --20324-- Reading syms from /gnu/store/0iapawfss4xnxls622g23qpk4mwb9ihp-glibc-2.33/lib/ld-2.33.so > --20324-- Considering /gnu/store/wznq4d1i3znqjhcribfr2m9ljyyrsdyd-glibc-2.33-debug/lib/debug/gnu/store/0iapawfss4xnxls622g23qpk4mwb9ihp-glibc-2.33/lib/ld-2.33.so.debug .. > --20324-- .. CRC is valid > --20324-- Reading syms from /home/gnutoo/work/projects/guix/valgrind-test/main > --20324-- Reading syms from /gnu/store/gkrqxqxs20mzxwxqpasy1q3w7a1v42w6-valgrind-3.18.1/libexec/valgrind/memcheck-x86-linux > --20324-- object doesn't have a symbol table > --20324-- object doesn't have a dynamic symbol table > --20324-- Scheduler: using generic scheduler lock implementation. > --20324-- Reading suppressions file: /gnu/store/gkrqxqxs20mzxwxqpasy1q3w7a1v42w6-valgrind-3.18.1/libexec/valgrind/default.supp > ==20324== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-20324-by-gnutoo-on-??? > ==20324== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-20324-by-gnutoo-on-??? > ==20324== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-20324-by-gnutoo-on-??? > ==20324== > ==20324== TO CONTROL THIS PROCESS USING vgdb (which you probably > ==20324== don't want to do, unless you know exactly what you're doing, > ==20324== or are doing some strange experiment): > ==20324== /gnu/store/gkrqxqxs20mzxwxqpasy1q3w7a1v42w6-valgrind-3.18.1/libexec/valgrind/../../bin/vgdb --pid=20324 ...command... > ==20324== > ==20324== TO DEBUG THIS PROCESS USING GDB: start GDB like this > ==20324== /path/to/gdb ./main > ==20324== and then give GDB the following command > ==20324== target remote | /gnu/store/gkrqxqxs20mzxwxqpasy1q3w7a1v42w6-valgrind-3.18.1/libexec/valgrind/../../bin/vgdb --pid=20324 > ==20324== --pid is optional if only one valgrind process is running > ==20324== > --20324-- REDIR: 0x4021570 (ld-linux.so.2:strlen) redirected to 0x580a1f4a (???) > --20324-- REDIR: 0x40212d0 (ld-linux.so.2:index) redirected to 0x580a1f25 (???) > --20324-- Reading syms from /gnu/store/gkrqxqxs20mzxwxqpasy1q3w7a1v42w6-valgrind-3.18.1/libexec/valgrind/vgpreload_core-x86-linux.so > --20324-- object doesn't have a symbol table > --20324-- Reading syms from /gnu/store/gkrqxqxs20mzxwxqpasy1q3w7a1v42w6-valgrind-3.18.1/libexec/valgrind/vgpreload_memcheck-x86-linux.so > --20324-- object doesn't have a symbol table > ==20324== WARNING: new redirection conflicts with existing -- ignoring it > --20324-- old: 0x04021570 (strlen ) R-> (0000.0) 0x580a1f4a ??? > --20324-- new: 0x04021570 (strlen ) R-> (2007.0) 0x04043ca0 strlen > --20324-- Reading syms from /gnu/store/r7n4snily34ld9nm4crzc0z65jr2y26c-gcc-10.3.0-lib/lib/libgcc_s.so.1 > --20324-- object doesn't have a symbol table > --20324-- Reading syms from /gnu/store/0iapawfss4xnxls622g23qpk4mwb9ihp-glibc-2.33/lib/libc-2.33.so > --20324-- Considering /gnu/store/wznq4d1i3znqjhcribfr2m9ljyyrsdyd-glibc-2.33-debug/lib/debug/gnu/store/0iapawfss4xnxls622g23qpk4mwb9ihp-glibc-2.33/lib/libc-2.33.so.debug .. > --20324-- .. CRC is valid > ==20324== WARNING: new redirection conflicts with existing -- ignoring it > --20324-- old: 0x040f08c0 (memalign ) R-> (1011.0) 0x04043084 memalign > --20324-- new: 0x040f08c0 (memalign ) R-> (1017.0) 0x0404303d aligned_alloc > ==20324== WARNING: new redirection conflicts with existing -- ignoring it > --20324-- old: 0x040f08c0 (memalign ) R-> (1011.0) 0x04043084 memalign > --20324-- new: 0x040f08c0 (memalign ) R-> (1017.0) 0x04042ff6 aligned_alloc > ==20324== WARNING: new redirection conflicts with existing -- ignoring it > --20324-- old: 0x040f08c0 (memalign ) R-> (1011.0) 0x04043084 memalign > --20324-- new: 0x040f08c0 (memalign ) R-> (1017.0) 0x0404303d aligned_alloc > ==20324== WARNING: new redirection conflicts with existing -- ignoring it > --20324-- old: 0x040f08c0 (memalign ) R-> (1011.0) 0x04043084 memalign > --20324-- new: 0x040f08c0 (memalign ) R-> (1017.0) 0x04042ff6 aligned_alloc > --20324-- REDIR: 0x40f49e0 (libc.so.6:strncasecmp) redirected to 0x40351e6 (_vgnU_ifunc_wrapper) > --20324-- REDIR: 0x40fa870 (libc.so.6:memrchr) redirected to 0x40351e6 (_vgnU_ifunc_wrapper) > --20324-- REDIR: 0x410df30 (libc.so.6:wcslen) redirected to 0x40351e6 (_vgnU_ifunc_wrapper) > --20324-- REDIR: 0x410d5c0 (libc.so.6:__GI_strrchr) redirected to 0x4043730 (__GI_strrchr) > --20324-- REDIR: 0x410da60 (libc.so.6:__GI_strlen) redirected to 0x4043c20 (__GI_strlen) > --20324-- REDIR: 0x40efb60 (libc.so.6:malloc) redirected to 0x403e5ae (malloc) > Hello world > --20324-- REDIR: 0x40f0190 (libc.so.6:free) redirected to 0x40409fc (free) > ==20324== > ==20324== HEAP SUMMARY: > ==20324== in use at exit: 0 bytes in 0 blocks > ==20324== total heap usage: 1 allocs, 1 frees, 1,024 bytes allocated > ==20324== > ==20324== All heap blocks were freed -- no leaks are possible > ==20324== > ==20324== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 5 from 5) > --20324-- > --20324-- used_suppression: 5 dl-hack3-cond-1 /gnu/store/gkrqxqxs20mzxwxqpasy1q3w7a1v42w6-valgrind-3.18.1/libexec/valgrind/default.supp:1232 > ==20324== > ==20324== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 5 from 5) In addition it also works fine with either valgrind/interactive or valgrind-3.18 as dependency, when it is used in the tests of a package. I've used the 'make && ./pre-inst-env guix build -f libsamsung-ipc.scm' command for that (with a libsamsung-ipc.scm that is slightly modified since last time). Denis.