Relationship Graph

Relationship Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0001569SOGoWeb Preferencespublic2012-03-29 12:51
Reporterpolymorf Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.3.11 
Summary0001569: Sieve script maximum length
Description

When saving Preférences with a too big generated sieve script SOGO die with signal 11.

Easy reproductible with a Vacation message adding charaters one by one, the biggest generated script without error is 1024 characters length :

wc -c /xxxx/sieve/sogo.sieve
1024 /xxxx/sieve/sogo.sieve

Can't add one more characters without error.

I use sogo-1.3.11 on FreeBSD with dovecot-managesieve-0.11.13

TagsNo tags attached.

Activities

ludovic

ludovic

2012-01-30 19:38

administrator   ~0003342

I don't have this issue with Cyrus so it must be something wrong with Dovecot.

Try to sniff the managesieve traffic between SOGo and Dovecot when you try to save your large vacation message.

polymorf

polymorf

2012-01-31 10:24

reporter   ~0003346

interface: lo0
filter: (ip or ip6) and ( port 2000 )

T XXX.XXX.XXX.XXX:2000 -> XXX.XXX.XXX.XXX:50061 [AP]
"IMPLEMENTATION" "dovecot".."SIEVE" "fileinto reject envelope encoded-character vacation su
baddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body
enotify environment mailbox date imapflags".."SASL" "PLAIN LOGIN".."NOTIFY" "mailto".."VER
SION" "1.0"..OK "Dovecot ready."..
#
T XXX.XXX.XXX.XXX:50061 -> XXX.XXX.XXX.XXX:2000 [AP]
AUTHENTICATE "PLAIN" {28+}..XXXXXXXXXXXXXXXXXXXXXXXXXXX

T XXX.XXX.XXX.XXX:50061 -> XXX.XXX.XXX.XXX:2000 [AP]
..
#
T XXX.XXX.XXX.XXX:2000 -> XXX.XXX.XXX.XXX:50061 [AP]
OK "Logged in."..
#
T XXX.XXX.XXX.XXX:50061 -> XXX.XXX.XXX.XXX:2000 [AP]
SETACTIVE ""
#
T XXX.XXX.XXX.XXX:2000 -> XXX.XXX.XXX.XXX:50061 [AP]
OK "No scripts currently active."..
#
T XXX.XXX.XXX.XXX:50061 -> XXX.XXX.XXX.XXX:2000 [AP]
..

T XXX.XXX.XXX.XXX:50061 -> XXX.XXX.XXX.XXX:2000 [AP]
DELETESCRIPT "sogo"..
#
T XXX.XXX.XXX.XXX:2000 -> XXX.XXX.XXX.XXX:50061 [AP]
NO (NONEXISTENT) "Script does not exist."..

SOGo die with signal 11 after this.

ludovic

ludovic

2012-02-08 20:17

administrator   ~0003395

Install the SOPE, SOGo and GNUstep debugging symbols, run SOGo with only one process, attach to it using GDB and produce a stacktrace when it crashes.

polymorf

polymorf

2012-02-24 10:21

reporter   ~0003481

The stacktrace is as follow :

Program received signal SIGSEGV, Segmentation fault.
0x00000008022e1b2f in GSFromUnicode (dst=0x0, size=0x7fffffffd338, src=0x8075c1000, slen=2340, enc=NSUnicodeStringEncoding, zone=0x0, options=4) at Unicode.m:2489
2489 else if (ptr != buf && ptr != *dst)
Current language: auto; currently minimal
(gdb) bt
#0 0x00000008022e1b2f in GSFromUnicode (dst=0x0, size=0x7fffffffd338, src=0x8075c1000, slen=2340, enc=NSUnicodeStringEncoding, zone=0x0, options=4) at Unicode.m:2489
0000001 0x0000000802149981 in -[GSMutableString lengthOfBytesUsingEncoding:] (self=0x807590610, _cmd=Variable "_cmd" is not available.
) at GSString.m:1387
0000002 0x00000008014ebd1f in -[NGSieveClient putScript:script:] (self=0x806b79db0, _cmd=0x8008083d0, _name=0x8008065c0, _script=0x807590610) at NGSieveClient.m:508
0000003 0x00000008006bd064 in -[SOGoSieveManager updateFiltersForLogin:authname:password:account:] (self=0x806a75f50, _cmd=0x805553cb0, theLogin=0x806a76560, theAuthName=0x806a76500,
thePassword=0x806a76470, theAccount=0x806bfbc10) at SOGoSieveManager.m:838
0000004 0x000000080542ec4d in -[SOGoMailAccount updateFilters] (self=0x806bfbc10, _cmd=0x805f8ef00) at SOGoMailAccount.m:307
0000005 0x0000000805e871cf in -[UIxPreferences defaultAction] (self=0x806b54a90, _cmd=0x8013c65d0) at UIxPreferences.m:1049
0000006 0x00000008011b9946 in -[SoActionInvocation callOnObject:withPositionalParametersWhenNotNil:inContext:] () from /usr/local/GNUstep/Local/Library/Libraries/libNGObjWeb.so.4.9
0000007 0x00000008011b4ea6 in -[SoObjectMethodDispatcher dispatchInContext:] () from /usr/local/GNUstep/Local/Library/Libraries/libNGObjWeb.so.4.9
0000008 0x00000008011b6bf6 in -[SoObjectRequestHandler handleRequest:inContext:session:application:] () from /usr/local/GNUstep/Local/Library/Libraries/libNGObjWeb.so.4.9
0000009 0x000000080113f7e2 in -[WORequestHandler handleRequest:] (self=0x804b65550, _cmd=0x801312b60, _request=0x804d85c10) at WORequestHandler.m:241
0000010 0x00000008010f397e in -[WOCoreApplication dispatchRequest:usingHandler:] (self=0x804a67d10, _cmd=0x801312bd0, _request=0x804d85c10, handler=0x804b65550) at WOCoreApplication.m:704
0000011 0x00000008010f3d3f in -[WOCoreApplication dispatchRequest:] (self=0x804a67d10, _cmd=0x509d10, _request=0x804d85c10) at WOCoreApplication.m:744
0000012 0x00000000004034b4 in -[SOGo dispatchRequest:] (self=0x804a67d10, _cmd=0x8013ad0e0, _request=0x804d85c10) at SOGo.m:451
0000013 0x00000008011a6313 in -[WOHttpTransaction _run] (self=0x804d60a10, _cmd=0x8013ad110) at WOHttpTransaction.m:581
0000014 0x00000008011a6730 in -[WOHttpTransaction run] (self=0x804d60a10, _cmd=0x8013aae90) at WOHttpTransaction.m:634
0000015 0x00000008011a1ab0 in -[WOHttpAdaptor runConnection:] (self=0x804d0e790, _cmd=0x8013aaf30, _socket=0x804d0e800) at WOHttpAdaptor.m:384
0000016 0x00000008011a1d39 in -[WOHttpAdaptor _handleAcceptedConnection:] (self=0x804d0e790, _cmd=0x8013aaf40, _connection=0x804d0e800) at WOHttpAdaptor.m:418
0000017 0x00000008011a2224 in -[WOHttpAdaptor _handleConnection:] (self=0x804d0e790, _cmd=0x8013aaff0, connection=0x804d0e800) at WOHttpAdaptor.m:477
0000018 0x00000008011a256f in -[WOHttpAdaptor acceptControlMessage:] (self=0x804d0e790, _cmd=0x8013aad50, aNotification=0x804d5fe90) at WOHttpAdaptor.m:516
0000019 0x0000000802203289 in -[NSNotificationCenter _postAndRelease:] (self=0x804ab4a30, _cmd=Variable "_cmd" is not available.
) at NSNotificationCenter.m:1161
0000020 0x000000080198c005 in -[NSObject(FileObjectWatcher) receivedEvent:type:extra:forMode:] (self=0x804a377c0, _cmd=0x8024ea180, _fdData=0x7, _type=ET_RDESC, _extra=0x7, _mode=0x80248b200)
at NSRunLoop+FileObjects.m:57
0000021 0x00000008022e4b5c in -[GSRunLoopCtxt pollUntil:within:] (self=0x804c65c90, _cmd=Variable "_cmd" is not available.
) at GSRunLoopCtxt.m:637
0000022 0x0000000802242ff6 in -[NSRunLoop acceptInputForMode:beforeDate:] (self=0x804b65150, _cmd=0x80248b170, mode=0x80248b200, limit_date=Variable "limit_date" is not available.
) at NSRunLoop.m:1182
0000023 0x000000080224163b in -[NSRunLoop runMode:beforeDate:] (self=0x804b65150, _cmd=0x801312a40, mode=0x80248b200, date=0x804ac1750) at NSRunLoop.m:1250
0000024 0x00000008010f3067 in -[WOCoreApplication run] (self=0x804a67d10, _cmd=0x509b30) at WOCoreApplication.m:576
0000025 0x0000000000402a64 in -[SOGo run] (self=0x804a67d10, _cmd=0x801352450) at SOGo.m:275
0000026 0x0000000801149ee3 in -[WOWatchDog _runChildWithControlSocket:] (self=0x804c65b90, _cmd=0x801352530, controlSocket=0x804a377c0) at WOWatchDogApplicationMain.m:499
0000027 0x000000080114a3c2 in -[WOWatchDog _spawnChild:] (self=0x804c65b90, _cmd=0x801352610, child=0x804b647d0) at WOWatchDogApplicationMain.m:563
0000028 0x000000080114abdd in -[WOWatchDog _ensureChildren] (self=0x804c65b90, _cmd=0x801352820) at WOWatchDogApplicationMain.m:653
0000029 0x000000080114c14e in -[WOWatchDog run:argc:argv:] (self=0x804c65b90, _cmd=0x801352930, newAppName=0x5080a0, newArgC=7, newArgV=0x7fffffffe448) at WOWatchDogApplicationMain.m:927
0000030 0x000000080114c9bd in WOWatchDogApplicationMain (appName=0x5080a0, argc=7, argv=0x7fffffffe448) at WOWatchDogApplicationMain.m:1036
0000031 0x0000000000401b2f in gnustep_base_user_main (argc=7, argv=0x7fffffffe448, env=0x7fffffffe488) at sogod.m:53

polymorf

polymorf

2012-03-28 18:19

reporter   ~0003667

Switch from lengthOfBytesUsingEncoding to length in SOPE sope-mime/NGImap4/NGSieveClient.m fix this issue.

2012-03-28 18:20

 

NGSieveClient.patch (500 bytes)   
--- sope-mime/NGImap4/NGSieveClient.m.orig	2012-03-28 20:04:02.000000000 +0200
+++ sope-mime/NGImap4/NGSieveClient.m	2012-03-28 20:09:34.000000000 +0200
@@ -506,7 +506,7 @@
   s = [s stringByAppendingString:_name];
   s = [s stringByAppendingString:@"\" "];
   s = [s stringByAppendingFormat:@"{%d+}\r\n%@",
-         [_script lengthOfBytesUsingEncoding: NSUTF8StringEncoding],
+         [_script length],
          _script];
   map = [self processCommand:s];
   return [self normalizeResponse:map];
NGSieveClient.patch (500 bytes)   
polymorf

polymorf

2012-03-28 20:58

reporter   ~0003668

This is not a SOGo/SOPE bug this bug was fixed in GNUStep revision 32434.

This issue can be close, Thanks

Issue History

Date Modified Username Field Change
2012-01-04 12:13 polymorf New Issue
2012-01-30 19:38 ludovic Note Added: 0003342
2012-01-30 19:38 ludovic Severity major => minor
2012-01-31 10:24 polymorf Note Added: 0003346
2012-02-08 20:17 ludovic Note Added: 0003395
2012-02-24 10:21 polymorf Note Added: 0003481
2012-03-28 18:19 polymorf Note Added: 0003667
2012-03-28 18:20 polymorf File Added: NGSieveClient.patch
2012-03-28 20:58 polymorf Note Added: 0003668
2012-03-29 12:51 ludovic Status new => closed
2012-03-29 12:51 ludovic Resolution open => fixed