From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by sourceware.org (Postfix) with ESMTPS id 197093840C1E for ; Fri, 15 Jan 2021 07:30:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 197093840C1E Received: by mail-io1-xd2f.google.com with SMTP id z5so16358533iob.11 for ; Thu, 14 Jan 2021 23:30:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:from:date:message-id :subject:to; bh=W/jyAXwbx2i3KdGBmW1SkDkBL+zX9G56rCD3GYOMrD4=; b=OUAgi9tIiLK0AfESN6bXNfJ+h9Ijg4HeYmTV9oKincNBDFmq8DzWvwwgauIX7ySwko d847Lc7TirCmjcmzqw0dY4FPXFST0ctQhn/f7LUrOrOi7DkXXjy3tpujIQRzPcZu88tw JykWNXF1eAZlDm7pkNXD8mcdymO5Ha3K6o5c0Xou5j5fypRGtg2H+4NVp2jCjZALa9Jw /cLied05Eoa72YI44db9CLmttF3yvYKmhb7nKQfLixP8lFe0V3RwpM3n1I89qo/v/aJ0 PG1A/gkMfa4o1nFKqrf1sX8oOGW9nqZmBfYBq4MT7mkqHwFd66bkMGLCQ7SK7Wv3Xvet JiOQ== X-Gm-Message-State: AOAM530x4+C8N5HLRRkhQaXG5mcZyWXaN0+yd0/K7zD3X1DroGZD4uPL uTd1vPFiP5VMDGLCvAzPrAjhb0huKhVvKPXWX+08lV4MOfQ= X-Google-Smtp-Source: ABdhPJz2iqhpPHYTWzpbNFkJYvbkxLK038W/rIn5Ln3pK1z/LOpt7Dh22fEGqnUpRCGQUd66TXa3Jkz7qKl84ULUPdI= X-Received: by 2002:a92:8495:: with SMTP id y21mr9516889ilk.55.1610695822379; Thu, 14 Jan 2021 23:30:22 -0800 (PST) MIME-Version: 1.0 Reply-To: noloader@gmail.com From: Jeffrey Walton Date: Fri, 15 Jan 2021 02:30:11 -0500 Message-ID: Subject: GDB loading incorrect version library To: gdb@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2021 07:30:24 -0000 Hi Everyone, I'm trying to investigate a Bash crash when Bash is instrumented with Asan. I've got Bash and all of its dependencies built/installed at ~/ok2delete-asan. All of them are built with Asan. GDB startup shows: $ gdb ~/ok2delete-asan/bin/bash gdb: /usr/local/lib/libncursesw.so.6: no version information available (required by gdb) It appears GDB is not loading the proper version of Ncurses: (gdb) shell readelf -d ~/ok2delete-asan/bin/bash | grep -E 'RPATH|RUNPATH' 0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN/../lib:/home/jwalton/ok2delete-asan/lib] And (slightly trimmed): (gdb) shell ldd ~/ok2delete-asan/bin/bash linux-vdso.so.1 (0x00007ffde6bfc000) libasan.so.5 => /usr/lib/x86_64-linux-gnu/libasan.so.5 libiconv.so.2 => /home/jwalton/ok2delete-asan/bin/../lib/libiconv.so.2 libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 libtinfow.so.6 => /home/jwalton/ok2delete-asan/bin/../lib/libtinfow.so.6 libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib64/ld-linux-x86-64.so.2 All of the warez built use the same RUNPATH. How do I tell GDB to use the RUNPATH set in the binary? Thanks in advance.