Patch RFC: Broken compilation with Sun CC, missing include statement

Jens Erat jens.erat at uni-konstanz.de
Tue Sep 22 03:17:11 EDT 2015


Hi Ellie,

string.h should be fine, at least it is for us.

By now, we also received feedback from Oracle, there is a known problem
with the Sun CC:

> Bug 20474916 : Fails compiling a program with the new header file
> string.h of Sol11.2

Regards from Lake Constance, Germany,
Jens

Am 18.09.2015 um 02:31 schrieb ellie timoney:
> Hi Jens,
> 
>> After several hours of debugging, we traced it back to a missing include
>> statement in times.c (strings.h missing). This resulted in the Sun CC
> 
> strings.h (plural), or string.h (singular)?  Your email says strings.h
> but your patch adds string.h.
> 
> On Linux (which most of us use), string.h (singular) is automatically
> included by inclusion of memory.h, which lib/times.c includes.
> 
> Also on Linux, the strcasecmp and strncasecmp functions are defined in
> both string.h (singular) and strings.h (plural) for backward
> compatibility, though I believe POSIX puts these properly in strings.h
> (plural).  Given that string.h (singular) seems to be enough to fix
> things for you, even though lib/times.c uses strcasecmp, I guess the Sun
> compiler has the same backward compatibility.
> 
> But since we're depending on strchr (and friends) and strcasecmp, it's
> proper to explicitly include these headers.  So I'll apply your patch
> and also add strings.h (plural) at the same time.
> 
> Thanks,
> 
> ellie
> 
> On Thu, Sep 17, 2015, at 06:24 PM, Jens Erat wrote:
>> Dear Cyrus maintainers,
>>
>>
>> building Cyrus IMAP 2.5.6 on Solaris 11 using the Sun CC, I experienced
>> issues when acting as replication target with the sync server crashing
>> for mails containing US timezones.
>>
>> After several hours of debugging, we traced it back to a missing include
>> statement in times.c (strings.h missing). This resulted in the Sun CC
>> falling back to some included function (thus compilation works), but
>> this one again is broken and returns 32 bit pointers instead of 64 bit
>> pointers in `strchr`.
>>
>> In the end, two problems add up here:
>>
>> - times.c trusting in strings.h already being included (which seemingly
>> is a false assumption considering the sync server)
>> - Sun CC probably being broken (we already issued a service request with
>> Oracle)
>>
>> I attached a proposed patch adding an include statement in times.c,
>> maybe it should be put somewhere further up in the include chain instead.
>>
>> Kind regards from Lake Constance, Germany,
>> Jens Erat
>>
>>
>> -- 
>> Jens Erat
>> Universität Konstanz
>> Kommunikations-, Infomations-, Medienzentrum (KIM)
>> Abteilung Basisdienste
>> D-78457 Konstanz
>> Mail: jens.erat at uni-konstanz.de
>> Email had 2 attachments:
>> + cyrus-imapd-2.5.6-patch-times-include.patch
>>   1k (text/x-patch)
>> + smime.p7s
>>   7k (application/pkcs7-signature)

-- 
Jens Erat
Universität Konstanz
Kommunikations-, Infomations-, Medienzentrum (KIM)
Abteilung Basisdienste
D-78457 Konstanz
Mail: jens.erat at uni-konstanz.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4893 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.andrew.cmu.edu/pipermail/cyrus-devel/attachments/20150922/8267a9a8/attachment.bin 


More information about the Cyrus-devel mailing list