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 uEUALxAGjGN6ugAAbAwnHQ (envelope-from ) for ; Sun, 04 Dec 2022 03:29:36 +0100 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 mBX7LhAGjGOaFwAA9RJhRA (envelope-from ) for ; Sun, 04 Dec 2022 03:29:36 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 999882FF95 for ; Sun, 4 Dec 2022 03:29:36 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 10A635FC0E; Sun, 4 Dec 2022 02:29:17 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id E98E75FBC8 for ; Sun, 4 Dec 2022 02:29:14 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 15D8E5FBC6; Sat, 3 Dec 2022 21:29:13 -0500 (EST) Received: (nullmailer pid 1551665 invoked by uid 1000); Sun, 04 Dec 2022 02:29:09 -0000 From: David Bremner To: Thomas Schneider , notmuch@notmuchmail.org Subject: [PATCH 2/3] test: add known broken test for exception handling in _n_m_delete Date: Sat, 3 Dec 2022 22:28:56 -0400 Message-Id: <20221204022857.1551514-3-david@tethera.net> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20221204022857.1551514-1-david@tethera.net> References: <20221204022857.1551514-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: YQ3H73VPSFNVQ7SMYRCF5BC5SCU2UDX2 X-Message-ID-Hash: YQ3H73VPSFNVQ7SMYRCF5BC5SCU2UDX2 X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670120976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=wA0J9y0OnFcheNGiuLooH+oFt9PORMnMr9BZD2FDXqc=; b=LMosrp7m/Xehk9i0ZiLYCNtRlWflyk+s/KCAPUkxdSlC8btRXlFATURPh1yx+cxGbZYgkV r8wauuQgG68Xm3kW7dJhYlaQFq3yUQC2AtpYlVFad2jh9tX8oG7lnanYbTyERR/Y8wgQx3 hXOTEJfCh3eS6oMqm68OZjoTA+G1tO+33dZlTs08kNrOUW2/7VH7fip9EESoHB6ZcX0Wqq HUNc/gQ62l/B71J51hT2HUGLquvQoKQl2KrLXXEW7sXjsSjtHuf2yod+zZcJ1Ebov0LaiI m2Ln7xTzxd5qJzcUIBVEG0ucHnFCoCzyDzj3mfMK4faAw9JxDBcBdSc+P5TiYA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670120976; a=rsa-sha256; cv=none; b=ADiwtCZG6TyZk+rHuoNrdSXaRfTIJdEg4YS7k3R4RiD+wdAfey0Ao/uA88BVjsHDOzowAX 0l50zeYHCOAHi6Z8osYnX1lQbqjxSO9MeupR8kz+KSHY2AHiHk9t6Sqpb4m3Y/rPI6J+e3 CAJpTYp8atysOzNSkve4K2P/h4ane5LrsO7/5ce74sGPJw75k046963mT7e66apNJXHUHQ l7UP81+vlDViq6mfNefqOv0MwAdECtUrQ5KMU+xBqm0XOMkom0jX4RMxQIa3DRozGfD7vc OcrRYeSqOaiV4ncyj9yXMSLHptiHL230VY6gTnKyydqAJlXO3sYzcH+rwuobQA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.21 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 999882FF95 X-Spam-Score: -1.21 X-Migadu-Scanner: scn0.migadu.com X-TUID: DF/bKGuGLV36 In [1], Thomas Schneider reported an uncaught Xapian exception when running out of disk space. We generate the same exception via database corruption. [1]: id:wwuk039sk2p.fsf@chaotikum.eu --- test/T566-lib-message.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test/T566-lib-message.sh b/test/T566-lib-message.sh index 511d56ca..562ab05a 100755 --- a/test/T566-lib-message.sh +++ b/test/T566-lib-message.sh @@ -516,4 +516,32 @@ cat < EXPECTED EOF test_expect_equal_file EXPECTED OUTPUT +TERMLIST_PATH=(${MAIL_DIR}/.notmuch/xapian/termlist.*) +test_begin_subtest "remove message with corrupted db" +test_subtest_known_broken +backup_database +cat c_head0 - c_tail <<'EOF' | test_private_C ${MAIL_DIR} ${TERMLIST_PATH} + { + notmuch_status_t status; + + int fd = open(argv[2],O_WRONLY|O_TRUNC); + if (fd < 0) { + fprintf (stderr, "error opening %s\n", argv[1]); + exit (1); + } + + stat = _notmuch_message_delete (message); + printf ("%d\n", stat == NOTMUCH_STATUS_XAPIAN_EXCEPTION); + } +EOF +cat < EXPECTED +== stdout == +1 +== stderr == +A Xapian exception occurred at message.cc:XXX: EOF reading block YYY +EOF +sed 's/EOF reading block [0-9]*/EOF reading block YYY/' < OUTPUT > OUTPUT.clean +test_expect_equal_file EXPECTED OUTPUT.clean +restore_database + test_done -- 2.35.2