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

Group
 
 

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

Submitter:  Sam Thompson <sthompso>
Submitted:  Tue 15 Mar 2016 04:35:59 PM UTC
   
 
Category:  Base/Foundation Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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>
Group 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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

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
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by sthompso (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-03-15 CaS StatusNone Fixed
        Open/ClosedOpen Closed
    2016-03-15 sthompso Attached File- Added DateFormatTest.m, #36654

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code