gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue with NSDateFormatter on Windows with ICU...


From: Richard Frith-Macdonald
Subject: Re: Issue with NSDateFormatter on Windows with ICU...
Date: Tue, 27 Nov 2012 14:47:03 +0000

On 27 Nov 2012, at 13:57, Gregory Casamento wrote:

> Hey guys,
> 
> I am having a problem starting up Gorm on Windows.   I have traced it to this 
> section of code in NSDateFormatter...
> 
> 125
> 126         length = udat_toPattern (internal->_formatter, 0, NULL, 0, &err);
> 127         value = NSZoneMalloc (z, sizeof(unichar) * length);
> 128         err = U_ZERO_ERROR;
> 129         udat_toPattern (internal->_formatter, 0, value, length, &err);
> 
> The issue is that length is coming back as -1, which, when the NSZoneMalloc 
> tries to allocate ends up trying to allocate all available memory since the 
> value is interpreted as unsigned.
> 
> The only reason Gorm gets this issue and the other apps I tested don't is due 
> to the fact that none of the others attempt to use NSDateFormatter. 

I know nothing about this code directly, but I had a little look anyway:

All the documentation I can find online says that udat_toPattern() should 
return a length ... so this problem shouldn't happen.
But I guess it's returning -1 as an error condition of some sort ... just 
looking at it I'd guess the problem must be incorrect initialisation of 
internal->_formatter.
So I'd recommend you try looking for a problem earlier on, to do wioth 
initialisation of the formatter.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]