Dependency Graph

Dependency Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0001022SOGoSOPEpublic2011-05-10 19:58
Reporterbuzzdee Assigned Toludovic  
PrioritynormalSeveritycrashReproducibilitysometimes
Status resolvedResolutionfixed 
Product Version1.3.4 
Fixed in Version1.3.8 
Summary0001022: specific mail crashes sogo in SOPE NGMimeRFC822DateHeaderFieldParser
Description

attached mail crashed sogo with following backtrace:

(gdb) bt
#0 -[NGMimeRFC822DateHeaderFieldParser parseValue:ofHeaderField:] (self=0x88f076b8, _cmd=0x2e295b70, _data=0x8503cbe8, _field=0x0)
at NGMimeRFC822DateHeaderFieldParser.m:130
0000001 0x0e2be8b8 in -[NGImap4ResponseParser _parseEnvelope] (self=0x7e96a5c8, _cmd=0x2e295bb0) at NGImap4ResponseParser.m:1544
0000002 0x0e2c81ff in -[NGImap4ResponseParser _parseNumberUntaggedResponse:] (self=0x7e96a5c8, cmd=0x2e295a00, result=0x7d0c7988)
at NGImap4ResponseParser.m:1697
0000003 0x0e2c6d71 in -[NGImap4ResponseParser parseResponseForTagId:exception:] (self=0x7e96a5c8, _cmd=0x2e296c98, tag=10, ex=0xcfbdb084)
at NGImap4ResponseParser.m:685
0000004 0x0e2d0837 in -[NGImap4Client processCommand:withTag:withNotification:logText:] (self=0x7f89fb88, _cmd=0x2e2970b0, _command=0x839a9008,
_tag=Variable "_tag" is not available.
) at NGImap4Client.m:1508
0000005 0x0e2c9a26 in -[NGImap4Client processCommand:] (self=0x7f89fb88, _cmd=0x2e296cb8, _command=0x839a9008) at NGImap4Client.m:1579
0000006 0x0e2cbbce in -[NGImap4Client fetchUids:parts:] (self=0x7f89fb88, _cmd=0x2e2a08c8, _uids=0x87f803e8, _parts=0x7d281888)
at NGImap4Client.m:865
0000007 0x0e2f878f in -[NGImap4Connection fetchUIDs:inURL:parts:] (self=0x8451ae48, _cmd=0x2fa8f9c0, _uids=0x87f803e8, _url=0x7e96a068,
_parts=0x7d281888) at NGImap4Connection.m:541
0000008 0x0faa1da0 in -[SOGoMailFolder fetchUIDs:parts:] (self=0x7c19d488, _cmd=0x24b28038, _uids=0x87f803e8, _parts=0x7d281888)
at SOGoMailFolder.m:555
0000009 0x04b316f5 in -[UIxMailListActions getHeadersForUIDs:inFolder:] (self=0x84518648, _cmd=0x24b27fe8, uids=0x87f803e8, mailFolder=0x7c19d488)
at UIxMailListActions.m:597
0000010 0x04b314ea in -[UIxMailListActions getHeadersAction] (self=0x84518648, _cmd=0x7f29e758) at UIxMailListActions.m:722
0000011 0x0849b195 in -[NSObject performSelector:] (self=0x84518648, _cmd=0x2265e2f0, aSelector=0x7f29e758) at NSObject.m:1831
0000012 0x026c6020 in -[WODirectAction performActionNamed:] (self=0x84518648, _cmd=0x226b71a0, _actionName=0x84518d08) at WODirectAction.m:101
0000013 0x0275b9ab in -[SoActionInvocation callOnObject:withPositionalParametersWhenNotNil:inContext:] (self=0x87f80388, _cmd=0x226b71b8,
_client=0x7c19d488, _positionalArgs=0x0, _ctx=0x81f67808) at SoActionInvocation.m:300
0000014 0x0275b7ce in -[SoActionInvocation callOnObject:inContext:] (self=0x87f80388, _cmd=0x226b7148, _client=0x7c19d488, _ctx=0x81f67808)
at SoActionInvocation.m:316
0000015 0x0275b853 in -[SoActionInvocation callOnObject:withPositionalParametersWhenNotNil:inContext:] (self=0x8700c028, _cmd=0x226b71b8,
_client=0x7c19d488, _positionalArgs=0x0, _ctx=0x81f67808) at SoActionInvocation.m:259
0000016 0x0275b7ce in -[SoActionInvocation callOnObject:inContext:] (self=0x8700c028, _cmd=0x226b51a8, _client=0x7c19d488, _ctx=0x81f67808)
at SoActionInvocation.m:316
0000017 0x027553d9 in -[SoObjectMethodDispatcher dispatchInContext:] (self=0x7d0c7648, _cmd=0x226b59b8, _ctx=0x81f67808)
at SoObjectMethodDispatcher.m:191
0000018 0x0275765a in -[SoObjectRequestHandler handleRequest:inContext:session:application:] (self=0x8ad3dc88, _cmd=0x22667f38, _rq=0x87006a08,
_ctx=0x81f67808, _sn=0x0, app=0x7fff0208) at SoObjectRequestHandler.m:591
0000019 0x026d8697 in -[WORequestHandler handleRequest:] (self=0x8ad3dc88, _cmd=0x22645948, _request=0x87006a08) at WORequestHandler.m:241
0000020 0x0269537d in -[WOCoreApplication dispatchRequest:usingHandler:] (self=0x7fff0208, _cmd=0x22645978, _request=0x87006a08, handler=0x8ad3dc88)
at WOCoreApplication.m:704
0000021 0x0269525e in -[WOCoreApplication dispatchRequest:] (self=0x7fff0208, _cmd=0x3c0029b8, _request=0x87006a08) at WOCoreApplication.m:744
0000022 0x1c0036a3 in -[SOGo dispatchRequest:] (self=0x7fff0208, _cmd=0x226a53b0, _request=0x87006a08) at SOGo.m:436
0000023 0x027445bb in -[WOHttpTransaction _run] (self=0x87006888, _cmd=0x226a53c8) at WOHttpTransaction.m:546
0000024 0x0274766a in -[WOHttpTransaction run] (self=0x87006888, _cmd=0x226a46a8) at WOHttpTransaction.m:599
0000025 0x02740fe5 in -[WOHttpAdaptor runConnection:] (self=0x7d2818c8, _cmd=0x226a46f8, _socket=0x7d0d60c8) at WOHttpAdaptor.m:398
0000026 0x02742ce6 in -[WOHttpAdaptor _handleAcceptedConnection:] (self=0x7d2818c8, _cmd=0x226a4700, _connection=0x7d0d60c8) at WOHttpAdaptor.m:432
0000027 0x027429f2 in -[WOHttpAdaptor _handleConnection:] (self=0x7d2818c8, _cmd=0x226a4780, connection=0x7d0d60c8) at WOHttpAdaptor.m:543
0000028 0x02742eaf in -[WOHttpAdaptor acceptConnection:] (self=0x7d2818c8, _cmd=0x226a4688, _notification=0x852b8168) at WOHttpAdaptor.m:607
0000029 0x0848b71e in -[NSNotificationCenter _postAndRelease:] (self=0x8024e5d8, _cmd=0x2837c1d0, notification=0x852b8168)
at NSNotificationCenter.m:1161
0000030 0x0848a948 in -[NSNotificationCenter postNotificationName:object:userInfo:] (self=0x8024e5d8, _cmd=0x2837c1d8, name=0x28ec809c,
object=0x7d2810c8, info=0x0) at NSNotificationCenter.m:1220
0000031 0x0848a7be in -[NSNotificationCenter postNotificationName:object:] (self=0x8024e5d8, _cmd=0x28ec8028, name=0x28ec809c, object=0x7d2810c8)
at NSNotificationCenter.m:1200
0000032 0x08eef8f2 in -[NSObject(FileObjectWatcher) receivedEvent:type:extra:forMode:] (self=0x7d2810c8, _cmd=0x283d0b40, _fdData=0xb,
_type=ET_RDESC, _extra=0xb, _mode=0x283900c0) at NSRunLoop+FileObjects.m:57
0000033 0x0859f3de in -[GSRunLoopCtxt pollUntil:within:] (self=0x7fff0e88, _cmd=0x28390050, milliseconds=26395, contexts=0x86f1ab88)
at GSRunLoopCtxt.m:636
0000034 0x084dab62 in -[NSRunLoop acceptInputForMode:beforeDate:] (self=0x86f1a928, _cmd=0x28390078, mode=0x283900c0, limit_date=0x7d27ec28)
at NSRunLoop.m:1197
0000035 0x084d8c83 in -[NSRunLoop runMode:beforeDate:] (self=0x86f1a928, _cmd=0x226458b8, mode=0x283900c0, date=0x86f1a3e8) at NSRunLoop.m:1265
0000036 0x02695d31 in -[WOCoreApplication run] (self=0x7fff0208, _cmd=0x3c0028c8) at WOCoreApplication.m:576
0000037 0x1c001b22 in -[SOGo run] () at SOGo.m:260
0000038 0x026c197e in WOApplicationMain (_appClassName=0x3c00196c, argc=5, argv=0xcfbdc0b8) at WOApplicationMain.m:42
0000039 0x026e36bd in WOWatchDogApplicationMain (appName=0x3c00196c, argc=5, argv=0xcfbdc0b8) at WOWatchDogApplicationMain.m:969
0000040 0x1c001697 in gnustep_base_user_main (argc=5, argv=0xcfbdc0b8, env=0xcfbdc0d0) at sogod.m:53
0000041 0x084c9c9e in main (argc=5, argv=Cannot access memory at address 0x4
) at NSProcessInfo.m:933
0000042 0x1c001397 in ___start ()
0000043 0x1c001317 in _start ()
0000044 0x00000000 in ?? ()
(gdb) frame 0
#0 -[NGMimeRFC822DateHeaderFieldParser parseValue:ofHeaderField:] (self=0x88f076b8, _cmd=0x2e295b70, _data=0x8503cbe8, _field=0x0)
at NGMimeRFC822DateHeaderFieldParser.m:130
130 while (!isdigit(p))
(gdb) list
125 static inline char
digitsString(const char string) {
126 const char
p;
127 unsigned int len;
128
129 p = string;
130 while (!isdigit(p))
131 p++;
132 len = 0;
133 while (isdigit(
(p + len)))
134 len++;
#0 -[NGMimeRFC822DateHeaderFieldParser parseValue:ofHeaderField:] (self=0x88f076b8, _cmd=0x2e295b70, _data=0x8503cbe8, _field=0x0)
at NGMimeRFC822DateHeaderFieldParser.m:130
130 while (!isdigit(p))
(gdb) list
125 static inline char
digitsString(const char string) {
126 const char
p;
127 unsigned int len;
128
129 p = string;
130 while (!isdigit(p))
131 p++;
132 len = 0;
133 while (isdigit(
(p + len)))
134 len++;
(gdb) print string
No symbol "string" in current context.
(gdb) po string
No symbol "string" in current context.
(gdb) print string
No symbol "string" in current context.
(gdb) frame 1
0000001 0x0e2be8b8 in -[NGImap4ResponseParser _parseEnvelope] (self=0x7e96a5c8, _cmd=0x2e295bb0) at NGImap4ResponseParser.m:1544
1544 env->date = [[dateParser parseValue:dateStr ofHeaderField:nil] retain];
(gdb) list
1539 /
parse date /
1540
1541 dateStr = [self _parseQuotedStringOrNIL];
1542 [self _consumeOptionalSpace];
1543 if ([dateStr isNotNull])
1544 env->date = [[dateParser parseValue:dateStr ofHeaderField:nil] retain];
1545
1546 /
parse subject /
1547
1548 if ((tmp = [self _parseQuotedStringOrDataOrNIL]) != nil) {
(gdb) print dateStr
$2 = (class NSString
) 0x8503cbe8
(gdb) po dateStr
Tue, 28 Sep 2010 08:51:20 GMT

Additional Information

This happened when scrolling through my trash folder, I only found one mail with the date from the backtrace in the Trash folder. I copied it into a test folder with thunderbird. Afterwards I was suddenly able to enter the test folder without the crasher. diff -u of both mail files on the imap server showed no difference.

I'm on OpenBSD i386, using sope and sogo 1.3.4, and gnustep-base-1.18.0p2

IMAP Server is cyrus imapd.

TagsNo tags attached.

Relationships

has duplicate 0001021 resolvedludovic specific mail crashes sogo in SOPE NGMimeRFC822DateHeaderFieldParser 

Activities

2010-12-01 18:58

 

mail.txt (2,767 bytes)   
Return-Path: <owner-tech+M21683@openbsd.org>
Received: from smtp.l00-bugdead-prods.de ([unix socket])
	 by communicator.ds9 (Cyrus v2.3.14) with LMTPA;
	 Thu, 30 Sep 2010 19:55:25 +0200
X-Sieve: CMU Sieve 2.3
Received: from localhost (localhost [127.0.0.1])
	by smtp.l00-bugdead-prods.de (Postfix) with ESMTP id 0BC7875802
	for <sebastia@l00-bugdead-prods.de>; Thu, 30 Sep 2010 19:55:25 +0200 (CEST)
X-Virus-Scanned: amavisd-new at l00-bugdead-prods.de
Received: from smtp.l00-bugdead-prods.de ([127.0.0.1])
	by localhost (communicator.ds9 [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id n9y6m5Dh4WLI for <sebastia@l00-bugdead-prods.de>;
	Thu, 30 Sep 2010 19:55:14 +0200 (CEST)
Received: from shear.ucar.edu (lists.openbsd.org [192.43.244.163])
	by smtp.l00-bugdead-prods.de (Postfix) with ESMTP id 2175275804
	for <sebastia@l00-bugdead-prods.de>; Thu, 30 Sep 2010 19:55:13 +0200 (CEST)
Received: from openbsd.org (localhost.ucar.edu [127.0.0.1])
	by shear.ucar.edu (8.14.3/8.14.3) with ESMTP id o8UHs2x7023659;
	Thu, 30 Sep 2010 11:54:02 -0600 (MDT)
Received: from cg-p00-fb.rzone.de (cg-p00-fb.rzone.de [81.169.146.194])
	by shear.ucar.edu (8.14.3/8.14.3) with ESMTP id o8UHq5T3014585 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO)
	for <tech@openbsd.org>; Thu, 30 Sep 2010 11:52:08 -0600 (MDT)
Received: from cg-p00-ob.rzone.de (snori-cg-p00-ob.mail [192.168.63.33])
	by snori-fb-03.store (RZmta 23.5) with ESMTP id i0205fm8SGfUe2 ; Tue, 28 Sep 2010 23:51:43 +0200 (MEST)
X-RZG-CLASS-ID: cg00
Received: from hublander.store ([192.168.40.230])
	by snori-cg-03.store (RZmta 23.5) with ESMTP id v05695m8S8JCI0 ; Tue, 28 Sep 2010 10:51:23 +0200 (MEST)
Received: (from Unknown UID 1271990@localhost)
	by post.webmailer.de (8.13.7/8.13.7) id o8S8pKuE021007; Tue, 28 Sep 2010 08:51:20 GMT
Date: Tue, 28 Sep 2010 08:51:20 GMT
Message-Id: <201009280851.o8S8pKuE021007@post.webmailer.de>
To: eedelmayer@se.rr.com, ek@ekusa.com, charlesfitzgerald@gmail.com,
        JOHN.STANLEY@VA.GOV, tech@openbsd.org, colin@na.org,
        info@yeoldehuffnpuff.com, dswestfall@KAUFCAN.COM, gfatula@acadia.net,
        csbaker@linal.com
Subject: susangoe sford
From: "Sappawit.J" <mzaslavsky@markys.biz>
X-RZG-SCRIPT: :fj1WOxH5LLG7PsZR7EjRW1CiW9fjd6ElUGTGpHx5DIxQoeBRjt1frnXuNFoKA78UJzO9mTgSGUkypAjuFSJdTEdNpZbZs/evKAcV2rq4UUF/M3L0
List-Help: <mailto:majordomo@openbsd.org?body=help>
List-Owner: <mailto:tech-owner@openbsd.org>
List-Post: <mailto:tech@openbsd.org>
List-Subscribe: <mailto:majordomo@openbsd.org?body=sub%20tech>
List-Unsubscribe: <mailto:majordomo@openbsd.org?body=unsub%20tech>
X-Loop: tech@openbsd.org
Precedence: list
Sender: owner-tech@openbsd.org

http://devaitsin887.newmail.ru/abekoqi.html

mail.txt (2,767 bytes)   
ludovic

ludovic

2010-12-01 22:09

administrator   ~0001906

Works for me too.

Are you sure you're using the "Inverse" version of SOPE?

buzzdee

buzzdee

2010-12-02 07:26

reporter   ~0001907

Why do you think I don't use it? Do you have seen sth. unusual in the backtrace?
Its maybe due to OpenBSD's "randomness" all over the place, that bugs that stay hidden on other OS/Platforms kick in here.

Yes, I use the Inverse version of SOPE. I use the port I created for OpenBSD:
http://www.openbsd.org/cgi-bin/cvsweb/ports/www/sope/
In the Makefile there you find the URL I used to download the sources.
In the patches directory you find some patches I used to get it to work, and to get rid of some compilation warnings.

As promised in the e-mail I sent, meanwhile some time ago, I'll probably start on the weekend to open some bug reports, and attaching the patches I have, and explain in detail, what they are good for.

sogod SOGoDraftsFolderName INBOX.Drafts
sogod SOGoUserSources '(
{
CNFieldName = cn;
IDFieldName = uid;
IMAPHostFieldName = mailHost;
UIDFieldName = uid;
baseDN = "ou=people,dc=intern";
bindDN = "cn=Manager,dc=intern";
bindPassword = MyPassword;
canAuthenticate = YES;
displayName = "SOGo Accounts";
hostname = ldapHost;
id = public;
isAddressBook = YES;
port = 389;
}
)'
sogod SOGoSMTPServer SMTPServer
sogod SOGoIMAPServer IMAPServer
sogod SOGoLanguage English
sogod NGImap4ConnectionStringSeparator .
sogod SOGoProfileURL postgresql://_sogo:PASSWORD@DBSERVER:5432/sogo/sogo_user_profile
sogod SOGoTimeZone Europe/Berlin
sogod SOGoFoldersSendEMailNotifications YES
sogod SOGoMemcachedHost localhost
sogod SOGoMailingMechanism smtp
sogod SOGoTrashFolderName INBOX.Trash
sogod WOLogFile /var/log/sogo/sogod.log
sogod WOPidFile /var/sogo/sogod.pid
sogod SOGoMailDomain mydomain.de
sogod OCSFolderInfoURL postgresql://_sogo:PASSWORD@DBSERVER:5432/sogo/sogo_folder_info
sogod SOGoSentFolderName INBOX.Sent
sogod SOGoACLsSendEMailNotifications YES
sogod SOGoAppointmentSendEMailNotifications YES
sogod WOWorkersCount 1

ludovic

ludovic

2010-12-02 15:45

administrator   ~0001917

Try to add WOMessageUseUTF8 = YES to your configuration and see if the crashers are still there.

ludovic

ludovic

2010-12-02 15:47

administrator   ~0001918

Also set WOParsersUseUTF8 = YES.

ludovic

ludovic

2010-12-02 15:47

administrator   ~0001919

If you're still getting errors, you might want to give us SSH access, a test account and sudo access for gdb to test this on OpenBSD.

buzzdee

buzzdee

2010-12-02 18:16

reporter   ~0001922

Hi Ludovic,
With those two defaults set, I don't get the crasher anymore.
Now I see messages like the following in the sogod.log:
Dec 02 18:01:23 sogod [16467]: <0x0x2d35b3a0[NSString]> Got incomplete multibyte sequence. ToEncode: UCS-2-INTERNAL FromEncode: UTF-8
Dec 02 18:01:23 sogod [16467]: <0x0x2d35b3a0[NSString]> Got invalid multibyte sequence. ToEncode: UCS-2-INTERNAL FromEncode: UTF-8.

or:
Dec 02 18:07:01 sogod [19776]: <0x0x276d63a0[NSString]> Got invalid multibyte sequence. ToEncode: UCS-2-INTERNAL FromEncode: US-ASCII.
127.0.0.1 - - [02/Dec/2010:18:07:03 GMT] "POST /SOGo/so/sebastia/Mail//0/folderINBOX/folderTrash/headers HTTP/1.1" 200 5264/537 1.918 34814 84% -
Dec 02 18:07:03 sogod [19776]: <0x0x276d63a0[NSString]> Got invalid multibyte sequence. ToEncode: UCS-2-INTERNAL FromEncode: US-ASCII.
127.0.0.1 - - [02/Dec/2010:18:07:04 GMT] "POST /SOGo/so/sebastia/Mail//0/folderINBOX/folderTrash/headers HTTP/1.1" 200 5096/509 1.038 32932 84% -
Those seem to be new to me, I cannot remember having seen them before.

Only the abort in libiconv_close still seems to be there.

buzzdee

buzzdee

2011-05-09 07:38

reporter   ~0002446

Hi,

I still get this error with 1.3.7, and had some time on the weekend to spend a couple of hours to further debug the problem. I came up with attached patch, fixing the problem for me. I found that the problem only happens on timezones that are just only i.e. GMT instead "GMT +100" or the like.

I now only call digitsString(p) in case the strlen of p is > 0.

please review this patch, and consider for inclusion to sope.

ludovic

ludovic

2011-05-09 15:52

administrator   ~0002448

You forgot to attach the patch!

2011-05-09 15:57

 

buzzdee

buzzdee

2011-05-09 15:57

reporter   ~0002449

sorry, now the patch is attached (:

ludovic

ludovic

2011-05-09 20:43

administrator   ~0002451

http://mtn.inverse.ca/revision/info/c5a8d5d7bd08d2c13646aa67cda95ba544c90841

buzzdee

buzzdee

2011-05-10 12:59

reporter   ~0002454

Thanks Ludovic for taking the patch. But as I was told by a fellow OpenBSD porter, the second part of the patch is superfluous:

@@ -186,7 +189,9 @@ static NSTimeZone *parseTimeZone(const c
default:
NSLog (@"parseTimeZone: cannot parse time notation '%s'", newString);
}

  • free(digits);
  • if (digits != NULL) {
  • free(digits);
  • }

so free(digits), even if it is NULL, is valid C (I verified by reading up on that, and recompiled without that part of the patch, and it doesn't crash)
So it should be save to remove this unnecessary if statement.

ludovic

ludovic

2011-05-10 19:58

administrator   ~0002456

Fix updated and pushed.

Issue History

Date Modified Username Field Change
2010-12-01 18:58 buzzdee New Issue
2010-12-01 18:58 buzzdee File Added: mail.txt
2010-12-01 22:09 ludovic Note Added: 0001906
2010-12-02 07:26 buzzdee Note Added: 0001907
2010-12-02 15:45 ludovic Note Added: 0001917
2010-12-02 15:47 ludovic Note Added: 0001918
2010-12-02 15:47 ludovic Note Added: 0001919
2010-12-02 18:16 buzzdee Note Added: 0001922
2011-02-15 22:02 ludovic Status new => assigned
2011-02-15 22:02 ludovic Assigned To => ludovic
2011-05-09 07:38 buzzdee Note Added: 0002446
2011-05-09 15:52 ludovic Note Added: 0002448
2011-05-09 15:57 buzzdee File Added: patch-sope-mime_NGMime_NGMimeRFC822DateHeaderFieldParser_m.orig
2011-05-09 15:57 buzzdee Note Added: 0002449
2011-05-09 20:43 ludovic Note Added: 0002451
2011-05-09 20:43 ludovic Status assigned => resolved
2011-05-09 20:43 ludovic Fixed in Version => 1.3.8
2011-05-09 20:43 ludovic Resolution open => fixed
2011-05-10 12:59 buzzdee Note Added: 0002454
2011-05-10 12:59 buzzdee Status resolved => feedback
2011-05-10 12:59 buzzdee Resolution fixed => reopened
2011-05-10 19:58 ludovic Note Added: 0002456
2011-05-10 19:58 ludovic Status feedback => resolved
2011-05-10 19:58 ludovic Resolution reopened => fixed
2011-05-13 11:03 ludovic Relationship added has duplicate 0001021