Re: [notmuch] [PATCH] Setup the GMimeStream only when needed
[notmuch-archives.git] / 7b / 9144a30e7ec8846b998d4d01bb74a91004de75
1 Return-Path: <cworth@cworth.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 943E74196F0\r
6         for <notmuch@notmuchmail.org>; Thu,  1 Apr 2010 14:31:07 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.89\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.89 tagged_above=-999 required=5\r
12         tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, T_MIME_NO_TEXT=0.01]\r
13         autolearn=ham\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id qGxOGVSL8EAJ; Thu,  1 Apr 2010 14:31:05 -0700 (PDT)\r
17 Received: from yoom.home.cworth.org (localhost [127.0.0.1])\r
18         by olra.theworths.org (Postfix) with ESMTP id 2948B431FC1;\r
19         Thu,  1 Apr 2010 14:31:05 -0700 (PDT)\r
20 Received: by yoom.home.cworth.org (Postfix, from userid 1000)\r
21         id A14F1254390; Thu,  1 Apr 2010 14:31:04 -0700 (PDT)\r
22 From: Carl Worth <cworth@cworth.org>\r
23 To: nstraz@redhat.com, Michal Sojka <sojkam1@fel.cvut.cz>\r
24 In-Reply-To: <20100401143113.GE25669@redhat.com>\r
25 References: <20100401134721.GD25669@redhat.com>\r
26         <87wrwr45k5.fsf@steelpick.2x.cz> <20100401143113.GE25669@redhat.com>\r
27 Date: Thu, 01 Apr 2010 14:31:04 -0700\r
28 Message-ID: <87aatmj1wn.fsf@yoom.home.cworth.org>\r
29 MIME-Version: 1.0\r
30 Content-Type: multipart/signed; boundary="=-=-=";\r
31         micalg=pgp-sha1; protocol="application/pgp-signature"\r
32 Cc: notmuch@notmuchmail.org\r
33 Subject: Re: [notmuch] [PATCH] Setup the GMimeStream only when needed\r
34 X-BeenThere: notmuch@notmuchmail.org\r
35 X-Mailman-Version: 2.1.13\r
36 Precedence: list\r
37 List-Id: "Use and development of the notmuch mail system."\r
38         <notmuch.notmuchmail.org>\r
39 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
40         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
41 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
42 List-Post: <mailto:notmuch@notmuchmail.org>\r
43 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
44 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
46 X-List-Received-Date: Thu, 01 Apr 2010 21:31:07 -0000\r
47 \r
48 --=-=-=\r
49 Content-Transfer-Encoding: quoted-printable\r
50 \r
51 On Thu, 1 Apr 2010 10:31:13 -0400, nstraz@redhat.com wrote:\r
52 > On Apr  1 16:21, Michal Sojka wrote:\r
53 > > On Thu, 01 Apr 2010, nstraz@redhat.com wrote:\r
54 > > thanks for the patch. After some investigation, it seems that you are\r
55 > > right. What I missed in your commit message is the reason for such\r
56 > > behaviour i.e. GMimeStream fseek()s in its write method to the position\r
57 > > recorded when the stream was created, so that in case there is somebody\r
58 > > else writing to the stream, the writes may overlap.\r
59 >=20\r
60 > Right, and in the case of writing to a pipe, the seek fails and the\r
61 > file position doesn't change.  I found it comparing strace output of\r
62 > `notmuch show ... > file` and `notmuch show ... | cat > file.`\r
63 \r
64 Ah, so the trigger of the bug is that we are currently interleaving\r
65 calls to printf with GMime writes to a stdout stream.\r
66 \r
67 I'm happy to apply this patch to workaround the problem, (and I just did\r
68 push it with some of my own comments added to the commit message).\r
69 \r
70 But isn't this a bug in GMime really? What possible use can it have for\r
71 doing an fseek on every stream write? That seems broken, and we should\r
72 report that to the GMime folks.\r
73 \r
74 =2DCarl\r
75 \r
76 --=-=-=\r
77 Content-Type: application/pgp-signature\r
78 \r
79 -----BEGIN PGP SIGNATURE-----\r
80 Version: GnuPG v1.4.10 (GNU/Linux)\r
81 \r
82 iD8DBQFLtRCY6JDdNq8qSWgRAjH4AJ9rN03sPZU3Cph2q/n2jaZ/tth1EQCgiOx0\r
83 gT4opUw2BPTyk5tt6eL4V8I=\r
84 =sEx1\r
85 -----END PGP SIGNATURE-----\r
86 --=-=-=--\r