Re: [swift-dev] large dictionary literal overflows swiftc stack

2016-03-23 Thread Joseph Pamer via swift-dev
Thanks for digging into this! I’m seeing the same thing you are - in Swift 3, we’ve solved the problem for array literals, but dictionary literals are still susceptible. I’ll take a look to see why the current round of optimizations aren’t being applied to them. - Joe > On Mar 23, 2016, at 11:

Re: [swift-dev] large dictionary literal overflows swiftc stack

2016-03-23 Thread Rafkind, Jon via swift-dev
I ran a test to see the maximum number of elements swift could handle before crashing and the numbers are swift 2.2: 1213 swift 3-dev (mar 16 snapshot): 976 I don't know why swift 3 is lower than swift 2.2, but I'm guessing its due to the same underlying cause, which is running out of stack spa

Re: [swift-dev] large dictionary literal overflows swiftc stack

2016-03-22 Thread Kyle Jessup via swift-dev
> Ok I will test with swift 3, but just to avoid any confusion I am not a > developer on PerfectLib. I am! Admittedly, that dictionary contains many obsolete mime type mappings which could be pruned (anyone serving Lotus 1-2-3 files?). However, 816 items is not an absurdly large number so it’s

Re: [swift-dev] large dictionary literal overflows swiftc stack

2016-03-22 Thread Rafkind, Jon via swift-dev
The root cause seems to be the program's stack was simply too small, and not an infinite loop in the type checker. On Linux the default stack size is 8192kb, but at least on my system, I needed to use a minimum of 11884kb. On 03/22/2016 03:35 PM, Rafkind, Jon wrote: FWIW when I compile the swift

Re: [swift-dev] large dictionary literal overflows swiftc stack

2016-03-22 Thread Rafkind, Jon via swift-dev
FWIW when I compile the swift/llvm 2.2 codebase with RelWithDebInfo there is no crash, but in Debug mode there is a crash. I can live with this for now since I will release my tool in RelWithDebInfo anyway. If I have time I will try to find the root cause behind the crash with Debug. On 03/22/2

Re: [swift-dev] large dictionary literal overflows swiftc stack

2016-03-22 Thread Joe Groff via swift-dev
> On Mar 22, 2016, at 1:41 PM, Rafkind, Jon wrote: > > Ok I will test with swift 3, but just to avoid any confusion I am not a > developer on PerfectLib. I was just using that file as a test case for my > application that is based on the swiftc code base. My application is designed > to consu

Re: [swift-dev] large dictionary literal overflows swiftc stack

2016-03-22 Thread Rafkind, Jon via swift-dev
Ok I will test with swift 3, but just to avoid any confusion I am not a developer on PerfectLib. I was just using that file as a test case for my application that is based on the swiftc code base. My application is designed to consume arbitrary swift 2.2 code. If there is a problem with swift 3

Re: [swift-dev] large dictionary literal overflows swiftc stack

2016-03-22 Thread Dmitri Gribenko via swift-dev
On Tue, Mar 22, 2016 at 12:17 PM, Rafkind, Jon via swift-dev wrote: > I have to support swift 2.2 for the time being because I have to support the > current release of xcode. I will upgrade to swift 3 when it is released. I understand your motivation, but I would still recommend trying to update

Re: [swift-dev] large dictionary literal overflows swiftc stack

2016-03-22 Thread Rafkind, Jon via swift-dev
I have to support swift 2.2 for the time being because I have to support the current release of xcode. I will upgrade to swift 3 when it is released. BTW it doesnt look like my attachment made it, so here is a link to the file: https://github.com/PerfectlySoft/Perfect/blob/master/PerfectLib/Mime

Re: [swift-dev] large dictionary literal overflows swiftc stack

2016-03-22 Thread Joe Groff via swift-dev
I'd recommend testing to see if this is improved in Swift 3, if it's practical to switch your codebase over. There are some type checker improvements there that didn't make it into Swift 2. -Joe > On Mar 22, 2016, at 12:13 PM, Rafkind, Jon via swift-dev > wrote: > > Attached is a file from a

[swift-dev] large dictionary literal overflows swiftc stack

2016-03-22 Thread Rafkind, Jon via swift-dev
Attached is a file from a project called PerfectLib that contains a dictionary literal with 816 entries in it. On my system with exactly 559 entries (meaning the last entry is "res") the file can be compiled, but with 560 or more it crashes. It looks like the crash is an infinite loop, I see man