Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

mu munging subject lines #390

Closed
stsquad opened this Issue · 11 comments

2 participants

@stsquad

As can be evidenced by the following thread:
http://thread.gmane.org/gmane.comp.emulators.qemu/259445

My replies seem to have swallowed up a space and joined stuff together. What processing does the subject line go through during a reply?

@djcb
Owner

None, really.

In any case, if it's in mu4e, it should happen too when you send the same message elsewhere. Can you try what happens if you do that?

@stsquad

Hmm it looks like something weird going on with mu:

10:36 alex@zen/x86_64 [cur] >mu find "subject:Remove" | grep "nop from qemu"
Tue 04 Mar 2014 17:04:10 GMT Richard Henderson <rth@twiddle.net> [Qemu-devel] [PATCH 10/10] tcg-aarch64: Remove nop from qemu_stslow pathh
10:36 alex@zen/x86_64 [cur] >grep "Remove nop from qemu_st" *
1393952980.29146_7.zen,U=28234:2,S
93:  tcg-aarch64: Remove nop from qemu_st slow path
1393952980.29146_9.zen,U=28236:2,S
62:Subject: [Qemu-devel] [PATCH 10/10] tcg-aarch64: Remove nop from qemu_st
1394100578.6653_2.zen,U=28665:2,S
99:>   tcg-aarch64: Remove nop from qemu_st slow path
153:=A0 tcg-aarch64: Remove nop from qemu_st slow path<br>
@stsquad

Hmm this may be the maildir fetcher. Looking at the actual Maildir file in question:

Subject: [Qemu-devel] [PATCH 10/10] tcg-aarch64: Remove nop from qemu_st                                                                     
»       slow path

The subject has been split with a newline and tab. I'll have to look up what the RFC says about such things.

@stsquad

It seems RFC822 3.4.2 allows it, it should be treated as a single space, see http://www.w3.org/Protocols/rfc822/3_Lexical.html#z1

@stsquad

OK digging deeper into the rabbit hole, given the following message header:

2:53 alex@zen/x86_64 [new] >grep -A 2 Subject 1384873113.22754_4864.zen\,U\=72\:2\,                                                         
Subject: [Qemu-devel] [PULL 04/15] configure: disable clang
        -Wstring-plus-int warning
X-BeenThere: qemu-devel@nongnu.org

And digging into gdb backtraces on find I get:

(gdb) s
_M_data (this=0x7fffffffe360) at /usr/include/c++/4.8/bits/basic_string.h:293
293           { return  _M_dataplus._M_p; }
(gdb) p _M_dataplus._M_p
$9 = 0x68fe18 "[Qemu-devel] [PULL 04/15] configure: disable clang-Wstring-plus-int warningg"
(gdb) bt
#0  _M_data (this=0x7fffffffe360) at /usr/include/c++/4.8/bits/basic_string.h:293
#1  _M_rep (this=0x7fffffffe360) at /usr/include/c++/4.8/bits/basic_string.h:301
#2  size (this=0x7fffffffe360) at /usr/include/c++/4.8/bits/basic_string.h:716
#3  empty (this=0x7fffffffe360) at /usr/include/c++/4.8/bits/basic_string.h:812
#4  mu_msg_doc_get_str_field (self=self@entry=0x68f490, mfid=mfid@entry=11 '\v') at mu-msg-doc.cc:80
#5  0x000000000041aa43 in get_str_field (self=0x68f600, mfid=<optimised out>) at mu-msg.c:282
#6  0x000000000041b0de in mu_msg_get_field_string (self=<optimised out>, mfid=<optimised out>) at mu-msg.c:549
#7  0x000000000040c205 in display_field (mfid=11 '\v', msg=0x68f600) at mu-cmd-find.c:359
#8  output_plain_fields (threads=<optimised out>, color=1, fields=<optimised out>, msg=0x68f600) at mu-cmd-find.c:477
#9  output_plain (msg=msg@entry=0x68f600, iter=iter@entry=0x673b20, opts=opts@entry=0x640e40 <MU_CONFIG>, err=err@entry=0x7fffffffe4c8)
at mu-cmd-find.c:495
#10 0x000000000040c9ab in output_query_results (err=0x7fffffffe4c8, opts=0x640e40 <MU_CONFIG>, iter=0x673b20) at mu-cmd-find.c:617
#11 process_query (err=0x7fffffffe4c8, opts=0x640e40 <MU_CONFIG>, query=0x673460 "\"maildir:/linaro/qemu\" \"AND\" \"subject:clang\"", 
xapian=0x671290) at mu-cmd-find.c:646
#12 execute_find (err=0x7fffffffe4c8, opts=0x640e40 <MU_CONFIG>, store=<optimised out>) at mu-cmd-find.c:673
#13 mu_cmd_find (store=<optimised out>, opts=0x640e40 <MU_CONFIG>, err=0x7fffffffe4c8) at mu-cmd-find.c:757
#14 0x000000000040fcbb in with_store (func=0x40c440 <mu_cmd_find>, opts=0x640e40 <MU_CONFIG>, read_only=<optimised out>, err=0x7fffffffe4c8)
at mu-cmd.c:547
#15 0x0000000000409c5b in main (argc=1, argv=0x7fffffffe5c8) at mu.cc:122

(gdb)

Which leads me to believe either Xapian is fed the wrong data at indexing time or something else broke.

@djcb
Owner

can you attach the raw message, ie. as it lives in your maildir? thanks.

@stsquad

example_mail

I had to rename it to .png to allow github to upload it.

@stsquad

The function cleanup_maybe (called from mu_msg_file_get_str_field) is what squashes the tab:

Breakpoint 6, cleanup_maybe (str=0x32b7160 "[Qemu-devel] [PULL 04/15] configure: disable clang\t-Wstring-plus-int warning", do_free=0x7fffffffd91c) at mu-msg-file.c:606
606     {
(gdb) n
609             if (!str)
(gdb) n
612             if (!g_utf8_validate(str, -1, NULL)) {
(gdb) n
622             mu_str_remove_ctrl_in_place (s);
(gdb) p s
$12 = 0x32b7160 "[Qemu-devel] [PULL 04/15] configure: disable clang\t-Wstring-plus-int warning"
(gdb) n
624             return s;
(gdb) p s
$13 = 0x32b7160 "[Qemu-devel] [PULL 04/15] configure: disable clang-Wstring-plus-int warningg"
@stsquad

I'm wondering if the fault ultimately lies with gmime? Having dug through their unit tests I can't see any examples of "multiline" subjects in their testsuite...

@stsquad

See pull request #422

@djcb
Owner

Ok, merged the pull request, closing this.

@djcb djcb closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.