Xcode 9 Log: "Month 13 is out of bounds"

I see this weird log when running my app from Xcode 9. I searched my project for for this text, it is not my log. Anyone know what it means?

Replies

Same problem here. I'm not sure if it has to do with the security update or just with the month.

I'm pretty sure its not a Xcode 9 issue, I still use Xcode 8.1 and got this log

I'm seeing the same problem Month 13 is out of bounds after the OSX 10.13.1 security update under Xcode Version 9.1 (9B55). I'm seeing it as an exception breakpoint on a SecItemCopyMatching call when exception breakpoints et.


My RDAR 35795904

OP other RDAR 35792221

Me too.

Same problem here.


Repeated 7 times for me.


Quick fix:

Set Date & Time to yesterday :/

Still the same here.

Taking a closer look at console shows that there are at least 37 apps throwing this error


Greetings from Switzerland, Ronald

---


error 04:49:58.023050 +0100 AirPlayUIAgent Month 13 is out of bounds

error 04:49:58.040260 +0100 amfid Month 13 is out of bounds

error 04:49:58.299699 +0100 bird Month 13 is out of bounds

error 04:49:58.462257 +0100 bluetoothd Month 13 is out of bounds

error 04:50:00.240257 +0100 CalendarAgent Month 13 is out of bounds

error 04:50:00.798840 +0100 com.apple.WebKit.Databases Month 13 is out of bounds

error 04:50:00.847246 +0100 com.apple.WebKit.Plugin.32 Month 13 is out of bounds

error 04:50:00.882614 +0100 com.apple.WebKit.Plugin.64 Month 13 is out of bounds

error 04:50:01.088995 +0100 Console Month 13 is out of bounds

error 04:50:01.110521 +0100 CoreServicesUIAgent Month 13 is out of bounds

error 04:50:01.245818 +0100 DeeTee-Saver Month 13 is out of bounds

error 04:50:01.268254 +0100 deleted Month 13 is out of bounds

error 04:50:01.269257 +0100 Dock Month 13 is out of bounds

error 04:50:01.344761 +0100 FeilTeiperX Month 13 is out of bounds

error 04:50:01.404056 +0100 FolderActionsDispatcher Month 13 is out of bounds

error 04:50:01.424367 +0100 GoogleSoftwareUpdateAgent Month 13 is out of bounds

error 04:50:01.702894 +0100 iTunes Month 13 is out of bounds

error 04:50:01.788291 +0100 iTunesHelper Month 13 is out of bounds

error 04:50:06.139197 +0100 Keyboard Maestro Engine Month 13 is out of bounds

error 04:50:06.223922 +0100 LaterAgent Month 13 is out of bounds

error 04:50:06.254390 +0100 launchservicesd Month 13 is out of bounds

error 04:50:08.437549 +0100 loginwindow Month 13 is out of bounds

error 04:50:08.438418 +0100 nbagent Month 13 is out of bounds

error 04:50:08.559519 +0100 NeoFinder Global QuickFind Month 13 is out of bounds

error 04:50:08.560158 +0100 OneDrive Month 13 is out of bounds

error 04:50:09.536177 +0100 OneDriveLauncher Month 13 is out of bounds

error 04:50:09.538335 +0100 Photos Month 13 is out of bounds

error 04:50:09.558506 +0100 softwareupdated Month 13 is out of bounds

error 04:50:09.558506 +0100 storeassetd Month 13 is out of bounds

error 04:50:09.560374 +0100 storeuid Month 13 is out of bounds

error 04:50:09.941054 +0100 Swiftify Month 13 is out of bounds

error 04:50:09.941096 +0100 TextWrangler Month 13 is out of bounds

error 04:50:09.953221 +0100 TMHelperAgent Month 13 is out of bounds

error 04:50:09.953263 +0100 trustd Month 13 is out of bounds

error 04:50:09.982013 +0100 TypeIt4Me Month 13 is out of bounds

error 04:50:09.982052 +0100 UserEventAgent Month 13 is out of bounds

error 04:50:10.013993 +0100 Xcode Month 13 is out of bounds

I believe the error is caused when any application tries to access data files such as plists.


After a restart, my RAM usage was over 100% and same with the CPU. UserEventAgent was causing issues, because it was trying to load

System/Library/LaunchAgents/com.apple.UserEventAgent-Aqua.plist

and

System/Library/LaunchAgents/com.apple.UserEventAgent-LoginWindow.plist

unsucessfully.


The process "***" was also having some issues which resulted in extremely high RAM and CPU usage, and printed the following to the console, along with about 100 other applications on the computer.

Month 13 is out of bounds


To fix the issue


  1. If you're not having troubles using the computer, then set your date to anytime before December 2017
  2. If you are having issues then kill UserEventAgent in Activity Monitor and complete step #1 before it comes back to use up more memory.

This bug is killing my computer. UserEventAgent CPU pegs at 100% and ram usage goes up (past 30 GB if I wait long enough). Resetting the date earlier and then killing the process fixes it. The out of control process didn’t kick in right away; I think I had to reboot first. Someone on Stack Exchange thinks it has to do with plist files that are read. When I sampled the process from Activity Monitor and there were a ton of mentions of various date methods. I wonder if this is related to the iOS date bug that was just patched? Whatever it is, it has made my laptop useless. I hope some reports this properly to Apple.

Haha, great comment, there are about 3.000.000 plist files on a Mac. I filed a bugreport yesterday. Greetings from Switzerland, Ronald Hofmann ---

I have the same problem with XCode 9.1. This text is definitely not in my project.

I restarted my Computer and opened the Console. Launching the Console logs this message six times. I didn't have this message before installing the recent security update. All kinds of processes log this message, even if XCode is not running. This is an OS X bug, not XCode or your project.

I googled this. It's a Mac OS X 10.13. x bug. For some users it's breaking their machine. Earth to Apple, Earth to Apple, come in Apple.

I can confirm my mac is sufferring the same problem with the UserEventsAgent spining the CPU which burns the battery life and exhibiting what looks like a typical memory leak by consuming all memory (RAM) grinding the machine into a resource starved state. All in the context of "month 13 is out of bounds"


In other forums the problem is also echo'd, see section 4


https://apple.stackexchange.com/questions/307512/month-13-is-out-of-bounds


The work-around for myself is to set the date to November and turn off setting the time automatically, be interesting to see if this problem disappears once where in January and if apple do anything about it before then. The problem is reproduceable as by turning on automatic time updates in the preferences the problem rears its ugly head.

> Earth to Apple, Earth to Apple, come in Apple.


this is not the channel to report bugs to Apple, really...

Same to me. In my case the questioned log message appears when File > New is selected and later, every several secondes.

When the CoreFoundation saves some information on a Document-based application to ~/Library/Autosave Information/xxxxx.plist, something goes wrong.

NSApplicationMain internally calls CFAbsoluteTimeGetGregorianDate(), which calls __CFYMDFromAbsolute(), which compares (actually subtracts 0xd i.e. 13 from a register r15d), then ..., logs the error message.

/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
CoreFoundation`__CFYMDFromAbsolute:
    0x7fff417f7050 <+0>:    pushq  %rbp
    0x7fff417f7051 <+1>:    movq   %rsp, %rbp
    ...
    0x7fff417f73d8 <+904>:  cmpl   $0xd, %r15d
    0x7fff417f73dc <+908>:  movb   %r14b, %r13b
    0x7fff417f73df <+911>:  jl     0x7fff417f7398            ; <+840>
    0x7fff417f73e1 <+913>:  movl   $0x10, %esi
    0x7fff417f73e6 <+918>:  movq   %rbx, %rdi
    0x7fff417f73e9 <+921>:  callq  0x7fff4190a194            ; symbol stub for: os_log_type_enabled
    0x7fff417f73ee <+926>:  testb  %al, %al
    0x7fff417f73f0 <+928>:  movb   %r14b, %r13b
    0x7fff417f73f3 <+931>:  je     0x7fff417f7398            ; <+840>
    0x7fff417f73f5 <+933>:  jmp    0x7fff417f7350            ; <+768>
    ...
    0x7fff417f7350 <+768>:  movq   %rsp, %r13
    0x7fff417f7353 <+771>:  movq   %rsp, %rax
    0x7fff417f7356 <+774>:  leaq   -0x10(%rax), %r8
    0x7fff417f735a <+778>:  movq   %r8, %rsp
    0x7fff417f735d <+781>:  movb   $0x0, -0x10(%rax)
    0x7fff417f7361 <+785>:  movb   $0x1, -0xf(%rax)
    0x7fff417f7365 <+789>:  movb   $0x0, -0xe(%rax)
    0x7fff417f7369 <+793>:  movb   $0x4, -0xd(%rax)
    0x7fff417f736d <+797>:  movl   %r15d, -0xc(%rax)
    0x7fff417f7371 <+801>:  movl   $0x10, %edx
    0x7fff417f7376 <+806>:  movl   $0x8, %r9d
    0x7fff417f737c <+812>:  leaq   -0xda383(%rip), %rdi
    0x7fff417f7383 <+819>:  movq   %rbx, %rsi
    0x7fff417f7386 <+822>:  leaq   0x3afb13(%rip), %rcx      ; "Month %d is out of bounds"
    0x7fff417f738d <+829>:  callq  0x7fff41909b4c            ; symbol stub for: _os_log_error_impl

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = watchpoint 1
    frame #0: 0x00007fff68e4b664 libsystem_c.dylib`strcspn + 25
    frame #1: 0x00007fff6904bb26 libsystem_trace.dylib`os_log_fmt_compose + 1271
    frame #2: 0x00007fff69051c8b libsystem_trace.dylib`_os_log_impl_compose + 132
    frame #3: 0x00007fff690516bd libsystem_trace.dylib`_os_log_impl_mirror_to_stderr + 385
    frame #4: 0x00007fff690511a2 libsystem_trace.dylib`_os_log_impl_flatten_and_send + 5512
    frame #5: 0x00007fff6904fbfb libsystem_trace.dylib`_os_log_error_impl + 87
  * frame #6: 0x00007fff417f7392 CoreFoundation`__CFYMDFromAbsolute + 834
    frame #7: 0x00007fff417f6f3b CoreFoundation`CFAbsoluteTimeGetGregorianDate + 91
    frame #8: 0x00007fff417d3660 CoreFoundation`_CFAppendXML0 + 2240
    frame #9: 0x00007fff417d38fe CoreFoundation`_CFAppendXML0 + 2910
    frame #10: 0x00007fff417d30ac CoreFoundation`_CFAppendXML0 + 780
    frame #11: 0x00007fff417d2b8a CoreFoundation`_CFPropertyListCreateXMLData + 202
    frame #12: 0x00007fff4179ce77 CoreFoundation`CFPropertyListCreateData + 135
    frame #13: 0x00007fff438b0090 Foundation`+[NSPropertyListSerialization dataWithPropertyList:format:options:error:] + 37
    frame #14: 0x00007fff4392babd Foundation`-[NSArray(NSArray) writeToFile:atomically:] + 164
    frame #15: 0x00007fff3f12ad24 AppKit`-[NSDocumentController(NSInternal) _writeAutoreopenRecords:] + 625
    frame #16: 0x00007fff3f12aa22 AppKit`-[NSDocumentController(NSInternal) _writeAutoreopenRecordsForOpenDocuments] + 250
    frame #17: 0x00007fff3f954603 AppKit`-[NSDocument(NSDocumentSaving) _finishSavingToURL:ofType:forSaveOperation:changeCount:] + 938
    frame #18: 0x00007fff3f956beb AppKit`__85-[NSDocument(NSDocumentSaving) _saveToURL:ofType:forSaveOperation:completionHandler:]_block_invoke_2.1047 + 229
    frame #19: 0x00007fff3f9568c6 AppKit`__85-[NSDocument(NSDocumentSaving) _saveToURL:ofType:forSaveOperation:completionHandler:]_block_invoke.1046 + 204
    frame #20: 0x00007fff3f9583c7 AppKit`__85-[NSDocument(NSDocumentSaving) _saveToURL:ofType:forSaveOperation:completionHandler:]_block_invoke_2.1146 + 589
    frame #21: 0x00007fff3f95816b AppKit`__85-[NSDocument(NSDocumentSaving) _saveToURL:ofType:forSaveOperation:completionHandler:]_block_invoke.1143 + 454
    frame #22: 0x00007fff3f9563d3 AppKit`__85-[NSDocument(NSDocumentSaving) _saveToURL:ofType:forSaveOperation:completionHandler:]_block_invoke_3.999 + 1962
    frame #23: 0x00007fff3f395214 AppKit`-[NSDocument(NSDocumentSerializationAPIs) continueFileAccessUsingBlock:] + 238
    frame #24: 0x00007fff3f95348d AppKit`__119-[NSDocument(NSDocumentSaving) _fileCoordinator:asynchronouslyCoordinateReadingContentsAndWritingItemAtURL:byAccessor:]_block_invoke_2 + 94
    frame #25: 0x00007fff3f313cac AppKit`__62-[NSDocumentController(NSInternal) _onMainThreadInvokeWorker:]_block_invoke.2153 + 157
    frame #26: 0x00007fff417bc79c CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
    frame #27: 0x00007fff4179f713 CoreFoundation`__CFRunLoopDoBlocks + 275
    frame #28: 0x00007fff4179f4d8 CoreFoundation`__CFRunLoopRun + 3128
    frame #29: 0x00007fff4179e607 CoreFoundation`CFRunLoopRunSpecific + 487
    frame #30: 0x00007fff40ab3866 HIToolbox`RunCurrentEventLoopInMode + 286
    frame #31: 0x00007fff40ab35d6 HIToolbox`ReceiveNextEventCommon + 613
    frame #32: 0x00007fff40ab3354 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 64
    frame #33: 0x00007fff3edb144f AppKit`_DPSNextEvent + 2085
    frame #34: 0x00007fff3f546508 AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044
    frame #35: 0x00007fff3eda625d AppKit`-[NSApplication run] + 764
    frame #36: 0x00007fff3ed753fe AppKit`NSApplicationMain + 804
    frame #37: 0x0000000100061b6d xxxxx`main at AppDelegate.swift:13
    frame #38: 0x00007fff68da2145 libdyld.dylib`start + 1
    frame #39: 0x00007fff68da2145 libdyld.dylib`start + 1

Simulate what CoreFoundation does:
(lldb) platform shell TZ=GMT date
Sun Dec  3 02:17:12 GMT 2017
(lldb) p (double)CFAbsoluteTimeGetCurrent()
(double) $8 = 533960243.91267997
(lldb) p/x (long)CFAbsoluteTimeGetGregorianDate(533960243.91267997, NULL)
2017-12-03 11:17:49.458467+0900 xxxxx[93243:38316408] Month 13 is out of bounds
(long) $9 = 0x1102030c000007e1

Bingo! The error message appears.

What about a returned value?
(lldb) p 0x00007e1
(int) $10 = 2017
(lldb) p 0x0c
(int) $11 = 12
(lldb) p 0x03
(int) $12 = 3
(lldb) p 0x02
(int) $13 = 2
(lldb) p 0x11
(int) $14 = 17

Looks good with 2017-12-03 02:17.

What about the contents of the file xxxxx.plist?

<?xml version="1.0" encoding="UTF-8"?>
...
<plist version="1.0">
<array>
  <dict>
  ...
  <date>2017-12-02T16:13:24Z</date>

The element <date> has a date converted by the above function, which looks fine, too.


MacOS 10.13, Xcode Version 9.0 (9A235).

I hope somebody skillful find a primary cause.

Same issue on a mid-2011 iMac that was upgraded to High Sierra on Dec 2. CPU goes crazy and run out of memory within a minute of rebooting. Setting the date back to November fixes the issue and we will stay there until hopefully we get an Apple fix. BTW - no issues in safe mode.