View Issue Details

IDProjectCategoryView StatusLast Update
0004003SOGoActiveSyncpublic2017-02-01 13:04
Reporterd--j Assigned Toludovic  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.2.5 
Fixed in Version3.2.7 
Summary0004003: Segmentation fault when GET /SOGo/Microsoft-Server-ActiveSync
Description

I did the following curl call (hunting down a ActiveSync problem I have):

curl -i -u validuser:validpassword https://sogoserver/SOGo/Microsoft-Server-ActiveSync

This triggers a segmentation fault.

Here is a gdb debugging session:

Starting program: /usr/sbin/sogod -WOUseWatchDog NO -WONoDetach YES -WOPort 30000 -WOWorkersCount 1 -WOLogFile - -WOPidFile /tmp/sogo-dbg.pid
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Jan 24 17:04:19 sogod [24720]: version 3.2.5 (build @saasweb-buildbox 201701231728) -- starting
Jan 24 17:04:19 sogod [24720]: vmem size check enabled: shutting down app when vmem > 384 MB. Currently at 225 MB
Jan 24 17:04:19 sogod [24720]: <0x0x555555aeb210[SOGoProductLoader]> SOGo products loaded from '/usr/lib/GNUstep/SOGo':
Jan 24 17:04:19 sogod [24720]: <0x0x555555aeb210[SOGoProductLoader]> MailerUI.SOGo, Appointments.SOGo, PreferencesUI.SOGo, MailPartViewers.SOGo, ActiveSync.SOGo, AdministrationUI.SOGo, CommonUI.SOGo, ContactsUI.SOGo, SchedulerUI.SOGo, MainUI.SOGo, Mailer.SOGo, Contacts.SOGo
Jan 24 17:04:19 sogod [24720]: All products loaded - current memory usage at 279 MB
Jan 24 17:04:19 sogod [24720]: |SOGo| WOHttpAdaptor listening on address *:30000
Jan 24 17:04:24 sogod [24720]: |SOGo| starting method 'GET' on uri '/SOGo/Microsoft-Server-ActiveSync'
Jan 24 17:04:24 sogod [24720]: <0x0x555555ba0380[SOGoCache]> Cache cleanup interval set every 300.000000 seconds
Jan 24 17:04:24 sogod [24720]: <0x0x555555ba0380[SOGoCache]> Using host(s) '127.0.0.1:11211' as server(s)
Jan 24 17:04:24 sogod [24720]: <0x0x5555558d8b70[SOGoActiveSyncDispatcher]> EAS - Forbidden access for user (null)
Jan 24 17:04:24 sogod [24720]: |SOGo| request took 0.002746 seconds to execute
Jan 24 17:04:24 sogod [24720]: localhost "GET /SOGo/Microsoft-Server-ActiveSync HTTP/1.0" 403 0/0 0.006 - - 692K
Jan 24 17:05:03 sogod [24720]: |SOGo| starting method 'GET' on uri '/SOGo/Microsoft-Server-ActiveSync'
Jan 24 17:05:03 sogod [24720]: <0x0x555555909cd0[SOGoDAVAuthenticator]> tried wrong password for user 'activesynctest@saasweb.net'!
Jan 24 17:05:03 sogod [24720]: |SOGo| request took 0.004425 seconds to execute
Jan 24 17:05:03 sogod [24720]: localhost "GET /SOGo/Microsoft-Server-ActiveSync HTTP/1.0" 401 12/0 0.005 - - 0
Jan 24 17:05:19 sogod [24720]: |SOGo| starting method 'GET' on uri '/SOGo/Microsoft-Server-ActiveSync'
2017-01-24 17:05:19.686 sogod[24720] ERROR(-[NSNull(misc) forwardInvocation:]): called selector stringByTrimmingSpaces on NSNull !

Program received signal SIGSEGV, Segmentation fault.
0x00007fffe7c81bc0 in -[NSString(ActiveSync) protocolVersion] (self=0x555555b2d2d0, _cmd=0x7fffe7ecc130 <_OBJC_SELECTOR_TABLE+4400>) at NSString+ActiveSync.m:153
153 NSString+ActiveSync.m: No such file or directory.
(gdb) bt
#0 0x00007fffe7c81bc0 in -[NSString(ActiveSync) protocolVersion] (self=0x555555b2d2d0, _cmd=0x7fffe7ecc130 <_OBJC_SELECTOR_TABLE+4400>) at NSString+ActiveSync.m:153
0000001 0x00007fffe7c9b043 in -[SOGoActiveSyncDispatcher dispatchRequest:inResponse:context:] (self=0x555555c356c0, _cmd=0x7fffe83190e0 <_OBJC_SELECTOR_TABLE+128>, theRequest=0x5555558ee3b0, theResponse=0x555555b45a40,
theContext=0x5555559245d0) at SOGoActiveSyncDispatcher.m:3956
0000002 0x00007fffe8110899 in -[SOGoMicrosoftActiveSyncActions microsoftServerActiveSyncAction] (self=0x555555cbfe30, _cmd=0x555555c30fc0) at SOGoMicrosoftActiveSyncActions.m:59
0000003 0x00007ffff6c1299e in -[WODirectAction performActionNamed:] (self=0x555555cbfe30, _cmd=0x7ffff6fe2660 <_OBJC_SELECTOR_TABLE+928>, _actionName=0x555555cd91e0) at WODirectAction.m:97
0000004 0x00007ffff6ca3933 in -[SoActionInvocation callOnObject:withPositionalParametersWhenNotNil:inContext:] (self=0x555555cbfa90, _cmd=0x7ffff6fe2690 <_OBJC_SELECTOR_TABLE+976>, _client=0x5555558f02e0, _positionalArgs=0x0,
_ctx=0x5555559245d0) at SoActionInvocation.m:300
0000005 0x00007ffff6ca3a5f in -[SoActionInvocation callOnObject:inContext:] (self=0x555555cbfa90, _cmd=0x7ffff6fdec00 <_OBJC_SELECTOR_TABLE+672>, _client=0x5555558f02e0, _ctx=0x5555559245d0) at SoActionInvocation.m:316
0000006 0x00007ffff6c9df60 in -[SoObjectMethodDispatcher dispatchInContext:] (self=0x555555cbf6f0, _cmd=0x7ffff6fe02e0 <_OBJC_SELECTOR_TABLE+1536>, _ctx=0x5555559245d0) at SoObjectMethodDispatcher.m:191
0000007 0x00007ffff6ca0421 in -[SoObjectRequestHandler handleRequest:inContext:session:application:] (self=0x555555b19510, _cmd=0x7ffff6f619b0 <_OBJC_SELECTOR_TABLE+848>, _rq=0x5555558ee3b0, _ctx=0x5555559245d0, _sn=0x0, app=0x5555558f02e0)
at SoObjectRequestHandler.m:584
0000008 0x00007ffff6c2464e in -[WORequestHandler handleRequest:] (self=0x555555b19510, _cmd=0x7ffff6f2a1d0 <_OBJC_SELECTOR_TABLE+1616>, _request=0x5555558ee3b0) at WORequestHandler.m:237
0000009 0x00007ffff6be4a8e in -[WOCoreApplication dispatchRequest:usingHandler:] (self=0x5555558f02e0, _cmd=0x7ffff6f2a220 <_OBJC_SELECTOR_TABLE+1696>, _request=0x5555558ee3b0, handler=0x555555b19510) at WOCoreApplication.m:712
0000010 0x00007ffff6be4dad in -[WOCoreApplication dispatchRequest:] (self=0x5555558f02e0, _cmd=0x555555764510 <_OBJC_SELECTOR_TABLE+1648>, _request=0x5555558ee3b0) at WOCoreApplication.m:752
0000011 0x000055555555cc03 in -[SOGo dispatchRequest:] (self=0x5555558f02e0, _cmd=0x7ffff6fc7940 <_OBJC_SELECTOR_TABLE+1760>, _request=0x5555558ee3b0) at SOGo.m:572
0000012 0x00007ffff6c8e967 in -[WOHttpTransaction _run] (self=0x555555c587e0, _cmd=0x7ffff6fc7970 <_OBJC_SELECTOR_TABLE+1808>) at WOHttpTransaction.m:566
0000013 0x00007ffff6c8ecdd in -[WOHttpTransaction run] (self=0x555555c587e0, _cmd=0x7ffff6fc56b0 <_OBJC_SELECTOR_TABLE+1168>) at WOHttpTransaction.m:619
0000014 0x00007ffff6c8a952 in -[WOHttpAdaptor runConnection:] (self=0x555555cafd90, _cmd=0x7ffff6fc5750 <_OBJC_SELECTOR_TABLE+1328>, _socket=0x555555c4fb90) at WOHttpAdaptor.m:373
0000015 0x00007ffff6c8ab72 in -[WOHttpAdaptor _handleAcceptedConnection:] (self=0x555555cafd90, _cmd=0x7ffff6fc5760 <_OBJC_SELECTOR_TABLE+1344>, _connection=0x555555c4fb90) at WOHttpAdaptor.m:407
0000016 0x00007ffff6c8af7b in -[WOHttpAdaptor _handleConnection:] (self=0x555555cafd90, _cmd=0x7ffff6fc5800 <_OBJC_SELECTOR_TABLE+1504>, connection=0x555555c4fb90) at WOHttpAdaptor.m:466
0000017 0x00007ffff6c8b41a in -[WOHttpAdaptor acceptConnection:] (self=0x555555cafd90, _cmd=0x7ffff6fc5670 <_OBJC_SELECTOR_TABLE+1104>, _notification=0x5555559311f0) at WOHttpAdaptor.m:527
0000018 0x00007ffff53ac0d7 in -[NSNotificationCenter _postAndRelease:] (self=0x5555558cd970, _cmd=<optimized out>, notification=0x5555559311f0) at NSNotificationCenter.m:1307
0000019 0x00007ffff6049a33 in -[NSObject(FileObjectWatcher) receivedEvent:type:extra:forMode:] (self=0x5555558f6530, _cmd=0x7ffff590a490 <_OBJC_SELECTOR_TABLE+304>, _fdData=0x7, _type=ET_RDESC, _extra=0x7,
_mode=0x7ffff58991f0 <_OBJC_INSTANCE_2>) at NSRunLoop+FileObjects.m:58
0000020 0x00007ffff54b3d2b in -[GSRunLoopCtxt pollUntil:within:] (self=<optimized out>, _cmd=0x7ffff58983e0 <_OBJC_SELECTOR_TABLE+1216>, milliseconds=<optimized out>, contexts=<optimized out>) at GSRunLoopCtxt.m:642
0000021 0x00007ffff53f2500 in -[NSRunLoop acceptInputForMode:beforeDate:] (self=0x555555c0e320, _cmd=0x7ffff5898420 <_OBJC_SELECTOR_TABLE+1280>, mode=0x7ffff58991f0 <_OBJC_INSTANCE_2>, limit_date=<optimized out>) at NSRunLoop.m:1217
0000022 0x00007ffff53f29b2 in -[NSRunLoop runMode:beforeDate:] (self=0x555555c0e320, _cmd=<optimized out>, mode=0x7ffff58991f0 <_OBJC_INSTANCE_2>, date=0x555555d52990) at NSRunLoop.m:1288
0000023 0x00007ffff6be42b9 in -[WOCoreApplication run] (self=0x5555558f02e0, _cmd=0x555555764260 <_OBJC_SELECTOR_TABLE+960>) at WOCoreApplication.m:584
---Type <return> to continue, or q <return> to quit---q
Quit
(gdb) po self
/SOGo/Microsoft-Server-ActiveSync
(gdb) po components
("/SOGo/Microsoft-Server-ActiveSync")
(gdb) po [components objectAtIndex: 0]
/SOGo/Microsoft-Server-ActiveSync
(gdb) po [[components objectAtIndex: 0] dataByDecodingBase64]
Cannot access memory at address 0x0
(gdb) p [[components objectAtIndex: 0] dataByDecodingBase64]
$6 = (struct NSData *) 0x0

Looks like the line
components = [NSMutableArray arrayWithArray: [[[self componentsSeparatedByString: @"?"] lastObject] componentsSeparatedByString: @"&"]];
(an there unconditionally calling lastObject on the inner array) is the culprit.

Sorry, my Objective-C knowledge is a little rusty so I'm not comfortable to provide a fix for this.

TagsNo tags attached.

Activities

There are no notes attached to this issue.

Related Changesets

sogo: master 50d8975f

2017-02-01 13:03:27

ludovic

Details Diff
(fix) improve EAS parameters parsing (fixes 0004003) Affected Issues
0004003
mod - ActiveSync/NSString+ActiveSync.m Diff File
mod - ActiveSync/SOGoActiveSyncDispatcher.m Diff File

sogo: v2 4bb5d15c

2017-02-01 13:03:27

ludovic

Details Diff
(fix) improve EAS parameters parsing (fixes 0004003) Affected Issues
0004003
mod - ActiveSync/NSString+ActiveSync.m Diff File
mod - ActiveSync/SOGoActiveSyncDispatcher.m Diff File

Issue History

Date Modified Username Field Change
2017-01-24 11:24 d--j New Issue
2017-02-01 13:04 ludovic Changeset attached => sogo master 50d8975f
2017-02-01 13:04 ludovic Assigned To => ludovic
2017-02-01 13:04 ludovic Resolution open => fixed
2017-02-01 13:04 ludovic Changeset attached => sogo v2 4bb5d15c
2017-02-01 13:04 ludovic Status new => resolved
2017-02-01 13:04 ludovic Fixed in Version => 3.2.7