From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id B1D286DE14AD for ; Mon, 20 May 2019 19:32:18 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.037 X-Spam-Level: X-Spam-Status: No, score=-0.037 tagged_above=-999 required=5 tests=[AWL=-0.036, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3rkFaEJlgLzs for ; Mon, 20 May 2019 19:32:17 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 8B5686DE14AB for ; Mon, 20 May 2019 19:32:17 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1hSuZb-0007th-DG; Mon, 20 May 2019 22:32:15 -0400 Received: (nullmailer pid 17335 invoked by uid 1000); Tue, 21 May 2019 02:32:20 -0000 From: David Bremner To: Daniel Kahn Gillmor , Notmuch Mail Subject: Re: [PATCH] test: avoid hanging older gdb under GNU timeout and moreutils parallel In-Reply-To: <20190521010304.417-1-dkg@fifthhorseman.net> References: <87mujgab6j.fsf@fifthhorseman.net> <20190521010304.417-1-dkg@fifthhorseman.net> Date: Mon, 20 May 2019 23:32:20 -0300 Message-ID: <87sgt8tu4r.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 02:32:18 -0000 Daniel Kahn Gillmor writes: > > A marginally cleaner patch be to consistently use gdb with either one > of: > > * -tty /dev/null > * < /dev/null > > in all of T050, T060, and T070. But T070 can't use "< /dev/null" > because it needs stdin. And when i tried to use "-tty /dev/null" in > T050 and T060, i got test suite failures that i wasn't able to > understand. > I don't have any understanding to offer, but I wonder if most/all of our use of gdb could be replaced by writing simple shim libraries and using LD_PRELOAD. I did a quick proof of concept (at end) for one of the tests in T070-insert.sh. This would require switching at least some of the test to use the notmuch-shared binary. I don't know if relying on LD_PRELOAD is particularly portable. Various linux distros should be OK, and a quick look at the FreeBSD docs suggest it might be ok. MacOS would probably need some extra work, as usual. OTOH, I'm not sure how well (if at all) the gdb based tests work on MacOS. In practice the following would presumably be generated by the test script. /* gcc -Wall -O2 -fpic -shared -ldl -o shim.so shim.c */ /* LD_PRELOAD=../shim.sh ../../notmuch-shared --config=./notmuch-config insert < foo */ #include "notmuch.h" #include notmuch_status_t notmuch_database_index_file (notmuch_database_t *notmuch, const char *filename, notmuch_indexopts_t *indexopts, notmuch_message_t **message_ret) { printf("calling notmuch_database_index_file\n"); return NOTMUCH_STATUS_XAPIAN_EXCEPTION; }