From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4ea1::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id UIt6CbeVyGGCFQEAgWs5BA (envelope-from ) for ; Sun, 26 Dec 2021 17:17:59 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id kKB2A7eVyGFjOQAAG6o9tA (envelope-from ) for ; Sun, 26 Dec 2021 17:17:59 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (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 4885B36988 for ; Sun, 26 Dec 2021 17:17:58 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 1A6965F72B; Sun, 26 Dec 2021 16:17:53 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 2B51B5F720 for ; Sun, 26 Dec 2021 16:17:50 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 16C075FC42; Sun, 26 Dec 2021 11:17:49 -0500 (EST) Received: (nullmailer pid 2079473 invoked by uid 1000); Sun, 26 Dec 2021 16:17:48 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH] test: add known broken test for thread fusion bug Date: Sun, 26 Dec 2021 12:17:16 -0400 Message-Id: <20211226161716.2079457-1-david@tethera.net> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Message-ID-Hash: RGZJSXIP2PMDRPCXM7MXQGVI44VBUSWP X-Message-ID-Hash: RGZJSXIP2PMDRPCXM7MXQGVI44VBUSWP 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=1640535478; 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:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=NBkf/npz5meTfzZI+gJeMLKZmOR9a49t2bKcVwbtb6k=; b=pCRi2OOkNZgE3k7Bl5dKAiQoZI2n2zrguVJJZjQyC4QvqGmZ11vXqhPL3XUp3ouodcbQyB /G5MMxQOTVFBS/0o/7B/pHUbLLqQZ7FboOwbqTidsATzR1JimXyROyXtfKwDvIsdi3hl2R yGewcaUR4keQvHHcnxPped+zf51HZgz+tZ/Om08wTR/J3BCVnGw5p/97t7ZhRPswa40QJr utCB5CmKNqkkkHVIgM7En7xelxda9ibZxTohxzPdSEPseHQ/oIa5GsE6UOvQrNSTm7rWRJ aCMQIRFckhO9xGEXN746t+OpAtLbberGezS+ghTzGSU6d0GBGrKQ+8dWcp6wuw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640535478; a=rsa-sha256; cv=none; b=u3L5yUV1tJph1f8PF7dpvB52e/SvNqRqsH1qjISDHFVrtM9z/K0QUuVj9nZ06f2z0IKUoe mTPSGTw8eG+HGA9K85Rxcp6JFGN+0GAA/Hj7PoCGqmakvBe6bILHUflaZhBNZCTncgqFnj 17+N0Ey/qumlBc7akwN9tjAJrAP14q3xsYvwYEQVRRyXJhCdydWkH6AJbUPiT+wPhUVrAM vTcGWdRzBGmG02rJ9qqJcuQqZU4vyztC7nWuOc3Qtvlw5zFPB2HHQoXaD6tiGXre9PJ6F8 e1sTB6M+3ae4hE+uipX2AcBhVV6SAUh7hSWiN4Uca8bTgzAoE3cILEbCBUQz5A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.68 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 4885B36988 X-Spam-Score: -1.68 X-Migadu-Scanner: scn0.migadu.com X-TUID: CauxaDCQuK3F This particular bug is apparently caused by the malformed (according to RFC5822 section 3.6.4) In-reply-to field of id:5422.1299798393@alphaville.usa.hp.com. --- test/T265-thread-fusing.sh | 21 ++++ .../cur/1397885606.000217.mbox:2,S | 67 +++++++++++ .../cur/1397885606.000218.mbox:2, | 67 +++++++++++ .../cur/1397885606.000232.mbox:2,S | 105 ++++++++++++++++++ 4 files changed, 260 insertions(+) create mode 100755 test/T265-thread-fusing.sh create mode 100644 test/corpora/threading/thread-fusing/cur/1397885606.000217.mbox:2,S create mode 100644 test/corpora/threading/thread-fusing/cur/1397885606.000218.mbox:2, create mode 100644 test/corpora/threading/thread-fusing/cur/1397885606.000232.mbox:2,S diff --git a/test/T265-thread-fusing.sh b/test/T265-thread-fusing.sh new file mode 100755 index 00000000..057f961a --- /dev/null +++ b/test/T265-thread-fusing.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +test_description="thread fusing" +. $(dirname "$0")/test-lib.sh || exit 1 + +add_email_corpus threading + +test_begin_subtest "all messages are indexed" +notmuch search --output=messages folder:thread-fusing | sort > OUTPUT +cat < EXPECTED +id:5422.1299798393@alphaville.usa.hp.com +id:8162.1298993875@alphaville.dokosmarshall.org +id:87wrkidfrh.fsf@pinto.chemeng.ucl.ac.uk +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Two threads are detected" +test_subtest_known_broken +output=$(notmuch search to:org-mode | wc -l) +test_expect_equal "${output}" 2 + +test_done diff --git a/test/corpora/threading/thread-fusing/cur/1397885606.000217.mbox:2,S b/test/corpora/threading/thread-fusing/cur/1397885606.000217.mbox:2,S new file mode 100644 index 00000000..02356e0a --- /dev/null +++ b/test/corpora/threading/thread-fusing/cur/1397885606.000217.mbox:2,S @@ -0,0 +1,67 @@ +X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on shi.workgroup +Delivery-date: Tue, 01 Mar 2011 16:45:42 +0100 +Delivered-To: GMX delivery to telegraph@gmx.net +From: Eric S Fraga +To: Emacs Org mode mailing list +User-Agent: Gnus/5.110014 (No Gnus v0.14) Emacs/24.0.50 (gnu/linux) +X-Face: av6A"vZ{AypDB`d^.T35oG%$E*Qh]4F)K=*$-NHz5{7WZfAFQFB]F@gf}l9`XLs9(iD?D/! nafKE,S#G!4W/flj=9(U{]t'lP,,5~:s*~;kKR +Date: Tue, 01 Mar 2011 15:25:38 +0000 +Message-ID: <87wrkidfrh.fsf@pinto.chemeng.ucl.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain +X-UCL-MailScanner-Information: Please contact the UCL Helpdesk, helpdesk@ucl.ac.uk for more information +X-UCL-MailScanner: Found to be clean +X-UCL-MailScanner-From: e.fraga@ucl.ac.uk +X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) +X-Received-From: 144.82.108.33 +Subject: [O] [bug] infinite loop exporting to latex with lists +X-BeenThere: emacs-orgmode@gnu.org +X-Mailman-Version: 2.1.5 +Precedence: list +List-Id: "General discussions about Org-mode." +List-Unsubscribe: , +List-Archive: +List-Post: +List-Help: +List-Subscribe: , +Errors-To: emacs-orgmode-bounces+telegraph=gmx.net@gnu.org +X-GMX-Antivirus: 0 (no virus found) +X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=5D7Q89H36p4WX0t+AtsdW7Rkpq2CocXbjmEjLnML/Jh/D5PE3azF+tWbav9NfRPdBjN7A hu2kMqFTMtXwLrawGj72VauG7H+vnQAR+OuQR9OR0XCVwaIInzy4fEfJqoaNwHPgkYGDpJSbT4Wu eSUcQ==V1; +Status: O +Content-Length: 858 +Lines: 33 + +Content-Length: 837 + +Hello, + +with the following simple file, + +--8<---------------cut here---------------start------------->8--- +* A question + +For this project: + +1. Draw a graph. + + +--8<---------------cut here---------------end--------------->8--- + +I get an infinite loop (i.e. emacs hangs until C-g) when I try to export +this to latex. Using debug on quit, I find it always hangs in +=org-list-context=. Help! + +I cannot think of anything I have changed etc. It only happens where +there is a list and this list can be any length >= 1. + +-- +: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 +: using Org-mode version 7.4 (release_7.4.562.gc895) + +_______________________________________________ +Emacs-orgmode mailing list +Please use `Reply All' to send replies to the list. +Emacs-orgmode@gnu.org +http://lists.gnu.org/mailman/listinfo/emacs-orgmode + + diff --git a/test/corpora/threading/thread-fusing/cur/1397885606.000218.mbox:2, b/test/corpora/threading/thread-fusing/cur/1397885606.000218.mbox:2, new file mode 100644 index 00000000..afb77619 --- /dev/null +++ b/test/corpora/threading/thread-fusing/cur/1397885606.000218.mbox:2, @@ -0,0 +1,67 @@ +X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on shi.workgroup +Delivery-date: Tue, 01 Mar 2011 16:45:41 +0100 +Delivered-To: GMX delivery to telegraph@gmx.net +To: Eric S Fraga +From: Nick Dokos +Subject: Re: [O] [bug] infinite loop exporting to latex with lists +In-reply-to: Message from Eric S Fraga of "Tue, 01 Mar 2011 15:25:38 GMT." <87wrkidfrh.fsf@pinto.chemeng.ucl.ac.uk> +References: <87wrkidfrh.fsf@pinto.chemeng.ucl.ac.uk> +X-Mailer: MH-E 8.2; nmh 1.3; GNU Emacs 24.0.50 +Date: Tue, 01 Mar 2011 10:37:55 -0500 +Message-id: <8162.1298993875@alphaville.dokosmarshall.org> +X-detected-operating-system: by eggs.gnu.org: Solaris 10 (1203?) +X-Received-From: 206.46.173.1 +Cc: nicholas.dokos@hp.com, Emacs Org mode mailing list +X-BeenThere: emacs-orgmode@gnu.org +X-Mailman-Version: 2.1.5 +Precedence: list +Reply-To: nicholas.dokos@hp.com +List-Id: "General discussions about Org-mode." +List-Unsubscribe: , +List-Archive: +List-Post: +List-Help: +List-Subscribe: , +Errors-To: emacs-orgmode-bounces+telegraph=gmx.net@gnu.org +X-GMX-Antivirus: 0 (no virus found) +X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=5D7Q89H36p4WX0t+AtsdW2ORvUlAfcdSIdQlIL3FTSFQDxQiodii41fjuqHQd8jenp0+N dNY0CcAB8WAv7r3OtvsaDOOiC4T8TWFW3c0h9kbMpE0/ou/MWvK8X//VR9J5RqCotAZER8h4O06e mC19Q==V1; +Status: O +Content-Length: 783 +Lines: 35 + +Content-Length: 762 + +Eric S Fraga wrote: + +> Hello, +> +> with the following simple file, +> +> * A question +> +> For this project: +> +> 1. Draw a graph. +> +> +> +> I get an infinite loop (i.e. emacs hangs until C-g) when I try to export +> this to latex. Using debug on quit, I find it always hangs in +> =org-list-context=. Help! +> +> I cannot think of anything I have changed etc. It only happens where +> there is a list and this list can be any length >= 1. +> + +Suvayu reported a hang earlier today and Nicolas pushed a fix - maybe +try pulling latest? + +Nick + +_______________________________________________ +Emacs-orgmode mailing list +Please use `Reply All' to send replies to the list. +Emacs-orgmode@gnu.org +http://lists.gnu.org/mailman/listinfo/emacs-orgmode + + diff --git a/test/corpora/threading/thread-fusing/cur/1397885606.000232.mbox:2,S b/test/corpora/threading/thread-fusing/cur/1397885606.000232.mbox:2,S new file mode 100644 index 00000000..b03c0265 --- /dev/null +++ b/test/corpora/threading/thread-fusing/cur/1397885606.000232.mbox:2,S @@ -0,0 +1,105 @@ +X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on shi.workgroup +Delivery-date: Fri, 11 Mar 2011 00:08:47 +0100 +Delivered-To: GMX delivery to telegraph@gmx.net +To: Eric S Fraga +From: Nick Dokos +Subject: Re: [O] dates before 1970 +In-Reply-To: Message from Eric S Fraga of "Thu, 10 Mar 2011 21:00:16 GMT." <87ei6en127.fsf@ucl.ac.uk> +References: <87ei6en127.fsf@ucl.ac.uk> +X-Mailer: MH-E 8.2; nmh 1.3; GNU Emacs 24.0.50 +Date: Thu, 10 Mar 2011 18:06:33 -0500 +Message-ID: <5422.1299798393@alphaville.usa.hp.com> +X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) +X-Received-From: 15.201.24.20 +Cc: nicholas.dokos@hp.com, Emacs Org mode mailing list +X-BeenThere: emacs-orgmode@gnu.org +X-Mailman-Version: 2.1.5 +Precedence: list +Reply-To: nicholas.dokos@hp.com +List-Id: "General discussions about Org-mode." +List-Unsubscribe: , +List-Archive: +List-Post: +List-Help: +List-Subscribe: , +Errors-To: emacs-orgmode-bounces+telegraph=gmx.net@gnu.org +X-GMX-Antivirus: 0 (no virus found) +X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=5D7Q89H36p4U4jfdfC5HDevlx1X2sAZgAaLl3DbFfW0PXxL7WgvovMFXXSEPrACW/b9IW Qp+GhEViZlUW4mdBntgP1X8KwB5tjHCA/yxSZMYzm4ZTjPJ5/Fr7D0QgNt/3lmuFSuOJGxtBQaM0 OMz0Q==V1; +Status: O +Content-Length: 2565 +Lines: 73 + +Content-Length: 2543 + +Eric S Fraga wrote: + +> This is a sort of bug report but possibly more a curiosity... +> +> I imagine this has something to do with time 0 in Unix but I cannot seem +> to be able to enter any date earlier than 1 Jan 1970 using C-c! (say). +> However, once I have entered a date (later than that), I can use +> S- on the year to get to the date I want. This seems rather +> inconsistent? +> +> To be precise, I get the wrong date recorded if I try: +> +> C-c ! 1968-12-10 RET +> +> (where C-c ! is =org-time-stamp-inactive=). +> The result is =[2011-12-10 Sat]= +> +> The bug is not so much that I cannot input dates I want but that the +> inactive timestamp generated is *incorrect* and yet there is no error +> message. +> + +Good one! The culprit is org-read-date-analyze which near the end contains +this snippet of code: + +,---- +| ... +| (if (< year 100) (setq year (+ 2000 year))) +| (if (< year 1970) (setq year (nth 5 defdecode))) ; not representable +| (setq org-read-date-analyze-futurep futurep) +| (list second minute hour day month year))) +`---- + +The trouble is that the caller (org-read-date) takes the result and +does a round-trip through the emacs time encode/decode functions to make +sure the result is sane. Dates before 1970 would break that (I get (0 9 +10 26 11 2033 6 nil -18000)) so it seems it wraps around to 2033 or so). + +In addition, most callers of org-read-date call it with a non-nil +to-time argument: that makes it return an emacs-encoded time (which is +then manipulated as such and which I believe has to satisfy the >=1970 +requirement). + +So I'd guess raising an exception might be the simplest way to deal with +this. Here's a patch to try out: + +--8<---------------cut here---------------start------------->8--- +diff --git a/lisp/org.el b/lisp/org.el +index 92f2406..b9acf11 100644 +--- a/lisp/org.el ++++ b/lisp/org.el +@@ -14718,7 +14718,8 @@ user." + (nth 2 tl)) + (setq org-time-was-given t)) + (if (< year 100) (setq year (+ 2000 year))) +- (if (< year 1970) (setq year (nth 5 defdecode))) ; not representable ++; (if (< year 1970) (setq year (nth 5 defdecode))) ; not representable ++ (if (< year 1970) (error "Year must be >= 1970")) + (setq org-read-date-analyze-futurep futurep) + (list second minute hour day month year))) +--8<---------------cut here---------------end--------------->8--- + +I think it does not break anything but I'm not sure I like it much. + +Patchwork note: this should not be applied without a lot more thought +and experimentation. + +Nick + + + + -- 2.34.1