After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 485005 - gmime causes endless 100% cpu utilization for some emails
gmime causes endless 100% cpu utilization for some emails
Status: RESOLVED FIXED
Product: gmime
Classification: Other
Component: general
0.2.x
Other Linux
: Normal normal
: ---
Assigned To: Jeffrey Stedfast
Jeffrey Stedfast
: 490074 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-10-09 11:08 UTC by Tamás Németh
Modified: 2007-12-02 17:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
problematic file (mail) (1.01 KB, message/rfc822)
2007-11-06 13:53 UTC, Tamás Németh
  Details
possible fix (869 bytes, patch)
2007-11-06 19:25 UTC, Jeffrey Stedfast
none Details | Review
Patched rpm, but no positive results for me (716.38 KB, patch)
2007-11-07 17:16 UTC, Tamás Németh
none Details | Review
strace beagle-extract-content /beagle/1191841883.13274.RPjw4 (164.16 KB, text/plain)
2007-11-07 17:23 UTC, Tamás Németh
  Details
strace beagle-extract-content /beagle/1108158121.18206.VP5fq\:2\,S (163.46 KB, text/plain)
2007-11-07 17:24 UTC, Tamás Németh
  Details
485005.2.patch (566 bytes, patch)
2007-11-12 17:20 UTC, Jeffrey Stedfast
none Details | Review

Description Tamás Németh 2007-10-09 11:08:35 UTC
The file was a mail in a kmail folder. It's status was:

Filtering status (2h35m26s ago): determining filter for file:///home/tamas/.kde/share/apps/kmail/mail/webmaster/cur/1191841883.13274.RPjw4

beagle-extract-content was also unable to parse the file.

The file is as follows (base64 encoded):

begin-base64 644 1191841883.13274.RPjw4
UmV0dXJuLVBhdGg6IDx3d3dydW5AYmlzbWFyY2subnltZS5odT4KWC1Pcmln
aW5hbC1Ubzogd2VibWFzdGVyQG55bWUuaHUKRGVsaXZlcmVkLVRvOi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0IEp1bCAyMDA2IDE1OjI3OjExICswMjAwIChD
RVNUKQpTdGF0dXM6IFIKWC1TdGF0dXM6IE5DClgtS01haWwtRW5jcnlwdGlv
blN0YXRlOiAgClgtS01haWwtU2lnbmF0dXJlU3RhdGU6ICAKWC1LTWFpbC1N
RE4tU2VudDogIAoKSm9iIGJlZ2luOiAwNC0wNy0wNiAwMzoyNzoxMQo=
====
Comment 1 Debajyoti Bera 2007-10-09 11:37:13 UTC
Can you try "beagle-extract-content --mimetype=message/rfc822 /path/to/file"? It worked for me here.
Comment 2 Tamás Németh 2007-10-09 11:46:49 UTC
I tried the following:

tamas@milleniumfalcon:~/beagle> beagle-extract-content --mimetype=message/rfc822 1191841883.13274.RPjw4

The output was:

Filename: file:///home/tamas/beagle/1191841883.13274.RPjw4
Debug: Loaded 53 filters from /usr/lib/beagle/Filters/Filters.dll

And it hang forever with 100% cpu utilization. By the way I use openSUSE 10.3.
Comment 3 Debajyoti Bera 2007-10-09 11:57:41 UTC
Ok, I tried using the branch for 0.2.18 and still it runs fine. This could be some problem with the OpenSUSE gmime-sharp or some other local patch in the OpenSUSE 10.3.

Joe, do you know anything offhand ?


----output of extract-content (0.2.18 is made out of 0.2.16 svn branch)-----

Filename: file:///home/debajyoti/1191841883.13274.RPjw4
Debug: Loaded 53 filters from /usr/share/devel/beagle-gnome/branches/beagle-0.2.16/Filters/Filters.dll
Filter: Beagle.Filters.FilterMail (determined in .60s)
MimeType: message/rfc822

Properties:
  Timestamp = 2007-10-09 11:26:07 (Utc)
  dc:title = Job No: 1 Job begin
  fixme:date = 20060704132711
  fixme:from = Webmaster hrlevl teszt <webmaster@nyme.hu>
  fixme:from_address = webmaster@nyme.hu
  fixme:from_name = Webmaster hrlevl teszt
  fixme:msgid = 20060704132711.084A0CB3@bismarck.nyme.hu
  fixme:to = webmaster@nyme.hu
  fixme:to_address = webmaster@nyme.hu

Content:
Job begin: 04-07-06 03:27:11

HotContent:
(no hot content)

Text extracted in .05s
Comment 4 Debajyoti Bera 2007-10-31 20:52:59 UTC
*** Bug 490074 has been marked as a duplicate of this bug. ***
Comment 5 Tamás Németh 2007-11-06 11:51:21 UTC
I figured out that if I change the subject line from:
Subject: =??Q?Job_No:_1_Job_begin?=
to something like:
Subject: Job_No:_1_Job_begin
then beagle is able to index the file!

I forgot to mention that i run openSUSE 10.3 on i386 (32 bit)
Comment 6 Debajyoti Bera 2007-11-06 13:33:11 UTC
Markus, Nemeth,
Do you use non-english language or encoding ?
Nemeth, the "?" in the email is really english "?" or the base64 changed it to english "?". If there is no funky encoding involved, then I dont see any way beagle could be using gmime incorrectly. Then this bug should really be investigated by the gmime people.

gmime contains several test programs, e.g. there is gmime/tests/test-parser.c. If you want, you can download that test program and run it with the path to the bad file as argument. Maybe that will help in figuring out why gmime is taking forever on these emails.
Comment 7 Tamás Németh 2007-11-06 13:53:04 UTC
Created attachment 98660 [details]
problematic file (mail)
Comment 8 Tamás Németh 2007-11-06 14:03:02 UTC
I attached the file tu this bug report, but you also can extract it from byte to byte from the base64 encoded version above. As you can see this way, the question marks in the Subject line are really question marks (0x3f). The From line itself is actually coded 8 bit iso8859-2, because it is in hungarian. It does not show the encoding however, and I guess it may be incorrect this way, isn't it? I'm not an RFC822 expert at all, but I feel that this mail is malformed at many points. Maybe the program, which generated the mail was not capable of handling the iso8859-2 encoding.
Comment 9 Jeffrey Stedfast 2007-11-06 19:25:33 UTC
Created attachment 98675 [details] [review]
possible fix

I wasn't able to reproduce the problem on my OpenSuSE 1.3 machine w/ gmime-2.2.10, so I'm not sure that this patch actually fixes the problem... but it's the only thing I can see in the code which /may/ be related.
Comment 10 Jeffrey Stedfast 2007-11-06 19:26:14 UTC
that hould read OpenSuSE 10.3
Comment 11 Debajyoti Bera 2007-11-06 19:38:36 UTC
Not sure but that could be the problem. If any of the reporters could try beagle with gmime+the above patch (gmime is extremely easy to build), we can try to fix this forever.
Comment 12 Tamás Németh 2007-11-07 17:14:09 UTC
Dear Jeff!

 I did the following.

I downloaded and installed http://download.opensuse.org/distribution/10.3/repo/src-oss/suse/src/gmime-2.2.10-35.src.rpm in order to be able to reproduce the openSUSE gmime rpms. I did so, but I did't use the build script by SuSE, just the raw rpmbuild program like this.
cd /usr/src/packages/SPECS
rpmbuild -ba gmime.spec

After building the rpms I replaced the already installed original gmime-sharp, libgmime-2_0-2 and gmime packages with the respective (and hopefully totally identical) ones generated by me just now.

I tested beagle by copying my mail file and Markus Ehrnsperger's file from Bug 490074 to my home directory and the symptoms were the same as with the original openSUSE 10.3 version of gmime.

After doing so, I modified /usr/src/packages/SPECS/gmime.spec the following way:

-I increased the release number to 36.
-I downloaded your patch as
   /usr/src/packages/SOURCES/gnome-bugzilla-id-485005.patch
   and added the following line ti gmime.spec.
   Patch2:         gnome-bugzilla-id-485005.patch
-At the %prep section I added: %patch2 -p0

After doing so I build the version 36 counterparts of my gmime rpm packages and replaced the old ones with the brand new ones (hopefully) including your patch.

And now the symptoms are the same for both problematic file:((((

PS: To tell the truth, I haven't even heard about rpmbuild so far, so it's possible that I made a mistake. Whether or not is this the case, the building of the version 36 rpms went without problem and I attach the src rpm to this bug report for anyone to be able to reproduce the rpms with your patch.
Comment 13 Tamás Németh 2007-11-07 17:16:09 UTC
Created attachment 98731 [details] [review]
Patched rpm, but no positive results for me
Comment 14 Tamás Németh 2007-11-07 17:23:49 UTC
Created attachment 98732 [details]
strace beagle-extract-content /beagle/1191841883.13274.RPjw4
Comment 15 Tamás Németh 2007-11-07 17:24:45 UTC
Created attachment 98733 [details]
strace beagle-extract-content /beagle/1108158121.18206.VP5fq\:2\,S
Comment 16 Tamás Németh 2007-11-07 17:29:06 UTC
Dear Jeff!

 I attached the outputs of stracing beagle-extract-content on both problematic files. By the way, how can it be possible that you can not reproduce the symptom on your openSUSE 10.3 machine??? Don't you run the 32 bit intel version? Or you have some piece of code compiled by hand, replacing some binaries of the original rpms? Or you have installed one of the RC versions instead of the final openSUSE 10.3?
Comment 17 Jeffrey Stedfast 2007-11-12 17:19:52 UTC
aha, found the problem... it was a bug with the --enable-rfc2047-workarounds code path.
Comment 18 Jeffrey Stedfast 2007-11-12 17:20:38 UTC
Created attachment 98977 [details] [review]
485005.2.patch

this really fixes it
Comment 19 Tamás Németh 2007-11-13 09:46:48 UTC
OK, I added both patches to the openSUSE src.rpm, built the actual rpms and installed them. Now beagled is able to index both problematic files, I can find them via the SuSE style KDE menu and via kerry beagle too. beagle-extract-content also easily parses the files.

Great job! I say thank you in the name of the community.

You may possibly change this bug's status to fixed.

When will these patches find their way to openSUSE (and official gmime) packages?
Comment 20 Debajyoti Bera 2007-12-02 02:29:09 UTC
Changing product and summary. Jeffrey, mark it as fixed if the patch has been checked in.
Comment 21 Jeffrey Stedfast 2007-12-02 17:44:55 UTC
the fix is in the 2.2.11 release of GMime