From: Carl Worth <cworth@cworth.org>
To: nstraz@redhat.com, Michal Sojka <sojkam1@fel.cvut.cz>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH] Setup the GMimeStream only when needed
Date: Thu, 01 Apr 2010 14:31:04 -0700 [thread overview]
Message-ID: <87aatmj1wn.fsf@yoom.home.cworth.org> (raw)
In-Reply-To: <20100401143113.GE25669@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1182 bytes --]
On Thu, 1 Apr 2010 10:31:13 -0400, nstraz@redhat.com wrote:
> On Apr 1 16:21, Michal Sojka wrote:
> > On Thu, 01 Apr 2010, nstraz@redhat.com wrote:
> > thanks for the patch. After some investigation, it seems that you are
> > right. What I missed in your commit message is the reason for such
> > behaviour i.e. GMimeStream fseek()s in its write method to the position
> > recorded when the stream was created, so that in case there is somebody
> > else writing to the stream, the writes may overlap.
>
> Right, and in the case of writing to a pipe, the seek fails and the
> file position doesn't change. I found it comparing strace output of
> `notmuch show ... > file` and `notmuch show ... | cat > file.`
Ah, so the trigger of the bug is that we are currently interleaving
calls to printf with GMime writes to a stdout stream.
I'm happy to apply this patch to workaround the problem, (and I just did
push it with some of my own comments added to the commit message).
But isn't this a bug in GMime really? What possible use can it have for
doing an fseek on every stream write? That seems broken, and we should
report that to the GMime folks.
-Carl
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2010-04-01 21:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-01 13:47 [PATCH] Setup the GMimeStream only when needed nstraz
2010-04-01 14:21 ` Michal Sojka
2010-04-01 14:31 ` nstraz
2010-04-01 21:31 ` Carl Worth [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87aatmj1wn.fsf@yoom.home.cworth.org \
--to=cworth@cworth.org \
--cc=notmuch@notmuchmail.org \
--cc=nstraz@redhat.com \
--cc=sojkam1@fel.cvut.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).