bugGNUstep - Bugs: bug #47422, [NSCalendarDate...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #47422: [NSCalendarDate descriptionWithCalendarFormat] hangs with some dates

Submitted by:  Sam Thompson <sthompso>
Submitted on:  Tue 15 Mar 2016 04:35:59 PM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Tue 15 Mar 2016 07:14:58 PM UTC, comment #2:

PS thanks for the example/test app ... I adapted it a little and added it to the regression tests.

Richard Frith-Macdonald <CaS>
Project Member
Tue 15 Mar 2016 07:08:22 PM UTC, comment #1:

Thanks very much ... I fixed the loop/hang problem, and also added a check to constrain the value to lie between distantPast and distantFuture (inclusive) when running on a 32bit system.

Richard Frith-Macdonald <CaS>
Project Member
Tue 15 Mar 2016 04:35:59 PM UTC, original submission:

Trying to format some representations of dates using [NSCalendarDate descriptionWithCalendarFormat], causes a hang within GNUStep library.

Please find attached sample application source-code which demonstrates the behavior.

The first date succeeds, but the second results in a hang.

Output:
$ obj/DateFormatTest.exe
daysSince1970: 8640000000. secondsSinceReference: 746495021692800.
Converted to 07-06-139044
daysSince1970: 2147483651. secondsSinceReference: 185541609139200.

Have seen the hang is somewhere within:
absoluteGregorianDay () / gregorianDateFromAbsolute () from gnustep-base-1_24.dll. These functions are used within the descriptionWithCalendarFormat implementation, within a few while-loops.

While the "problem date" in the test may seem overboard, I still wouldn't expect the hanging behavior.

GNUStep version: 1.24.6.
Platform: Windows.
GCC: 4.7.2.

Sam Thompson <sthompso>

 

Attached Files
file #36654:  DateFormatTest.m added by sthompso (1KiB - application/octet-stream - Sample source-code demonstrating the behavior is attached.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by CaS (Posted a comment)
  • -unavailable- added by sthompso (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 15 Mar 2016 07:08:22 PM UTCCaSStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Tue 15 Mar 2016 04:35:59 PM UTCsthompsoAttached File-=>Added DateFormatTest.m, #36654

    Back to the top


    Powered by Savane 3.1-cleanup1