[Swift-devel] Swift crashing for runs with 1M calls

Yadu Nand yadudoc1729 at gmail.com
Fri Mar 1 14:28:08 CST 2013


Thank Mike, today was a good day :)

Tim, sure, I can try that once we have a large enough net to catch bugs
here.

I will try adding some logging to see progress on the fibonacci code.
Here's the stats for the fibonacci code, and as Tim noted the code is not
recursive.
fibonacci stats (x_func.swift) :
1K   -> 3.059s
10K  -> 5.047s (double check results here)
100K -> 31.85s
1M   -> Exception in thread "Hang checker"
               java.lang.StackOverflowError
               at java.util.HashMap.put(HashMap.java:484)
               at java.util.HashSet.add(HashSet.java:217)

I have a recursion code to calculate N+(N-1)... +2+1 (code :
x_recursion.swift).
This one fails much faster and with very different logs and exceptions:
x_recursion stats:
1K   -> 25s real (i5 8gb)
10K  -> (10% ram 8gb in use by java)
Uncaught exception: java.lang.StackOverflowError in vdl:unitstart @
x_recursion.kml, line: 45
java.lang.StackOverflowError
        at java.lang.String.valueOf(String.java:2959)
        at
org.globus.cog.karajan.util.ThreadingContext.toString(ThreadingContext.java:87)
        at
org.globus.cog.karajan.util.ThreadingContext.toString(ThreadingContext.java:87)
        ...
Exception is: java.lang.StackOverflowError
Near Karajan line: vdl:unitstart @ x_recursion.kml, line: 45
Another uncaught exception while handling an uncaught exception.
java.lang.StackOverflowError
        at
org.globus.cog.karajan.workflow.nodes.FlowNode.failImmediately(FlowNode.java:77)
        at
org.globus.cog.karajan.workflow.nodes.FlowNode.failed(FlowNode.java:245)
        ...
The initial exception was
java.lang.StackOverflowError
        at java.lang.String.valueOf(String.java:2959)
        at
org.globus.cog.karajan.util.ThreadingContext.toString(ThreadingContext.java:87)
        at
org.globus.cog.karajan.util.ThreadingContext.toString(ThreadingContext.java:87)

100K -> ?


-Yadu

On Sat, Mar 2, 2013 at 1:35 AM, Tim Armstrong <tim.g.armstrong at gmail.com>wrote:

> Yadu, awesome, feel free to try and break Swift/T as well :)
>
> There isn't any recursion in Yadu's code - it looks like there's a
> recursive call in the hang checker.
>
> - Tim
>
>
>
> On Fri, Mar 1, 2013 at 2:01 PM, Michael Wilde <wilde at mcs.anl.gov> wrote:
>
>> Hurray!!!!  Nice work, Yadu.
>>
>> I think you need to do a few things here:
>>
>> - put in some (perhaps periodic) logging to see how far fib progressed
>> - try a non-recursive example: fib() is not reflective of most swift
>> scripts and excessively challenges the call stack
>> - learn how to control Java heap and stack limits (the former is
>> documented *I think* in the User Guide and if not needs to be, and should
>> be, in the release notes
>>
>> Others may have some more specific guidance for you.
>>
>> - Mike
>>
>>
>> ----- Original Message -----
>> > From: "Yadu Nand" <yadudoc1729 at gmail.com>
>> > To: "swift-devel" <swift-devel at ci.uchicago.edu>
>> > Sent: Friday, March 1, 2013 1:23:27 PM
>> > Subject: [Swift-devel] Swift crashing for runs with 1M calls
>> >
>> >
>> > Hi,
>> >
>> >
>> > I'm trying to see swift behavior with some stress on and I see
>> > crashes at close to 1M calls/loops.
>> >
>> >
>> > Here's one such case ( x_func.swift code is here ->
>> > https://github.com/yadudoc/swift-basics/blob/master/stress/x_func.swift
>> > ):
>> > Test run with 0.94 ( corei5 with 8Gb ram)
>> >
>> >
>> > yadu at Miranda:~/src/swift-basics/stress$ time swift x_func.swift
>> > -loops=1000000
>> > Swift 0.94RC3 swift-r6268 cog-r3605
>> >
>> >
>> > RunID: 20130302-0019-l2alv5d2
>> > Progress: time: Sat, 02 Mar 2013 00:19:38 +0530
>> > Fibonacci[2] = 1
>> > No events in 10s.
>> > Progress: time: Sat, 02 Mar 2013 00:20:08 +0530
>> > Progress: time: Sat, 02 Mar 2013 00:20:38 +0530
>> > Progress: time: Sat, 02 Mar 2013 00:21:08 +0530
>> > Progress: time: Sat, 02 Mar 2013 00:21:38 +0530
>> > Progress: time: Sat, 02 Mar 2013 00:22:08 +0530
>> > Progress: time: Sat, 02 Mar 2013 00:22:38 +0530
>> > Progress: time: Sat, 02 Mar 2013 00:23:08 +0530
>> > Finding dependency loops...Exception in thread "Hang checker"
>> > java.lang.StackOverflowError
>> > at java.util.HashMap.put(HashMap.java:484)
>> > at java.util.HashSet.add(HashSet.java:217)
>> > at org.griphyn.vdl.karajan.HangChecker.findLoop(HangChecker.java:299)
>> > at org.griphyn.vdl.karajan.HangChecker.findLoop(HangChecker.java:303)
>> >
>> >
>> > Earlier I had posted about iterate failing to compile on 0.94. I ran
>> > a few tests on 0.93
>> > (code :
>> >
>> https://github.com/yadudoc/swift-basics/blob/master/stress/x_iterate.swift
>> > ) with
>> > results:
>> > 100K loops -> 17s real
>> > 1M loops -> No response for a while, then java.lang.OutOfMemory
>> > exception thrown.
>> >
>> >
>> > I'm finding it difficult to keep stats so, I'm placing the stats and
>> > as much run info as
>> > possible in comments in the scripts themselves. All the scripts are
>> > here ->
>> > https://github.com/yadudoc/swift-basics/tree/master/stress
>> >
>> >
>> >
>> >
>> > -Yadu
>> > _______________________________________________
>> > Swift-devel mailing list
>> > Swift-devel at ci.uchicago.edu
>> > https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel
>> >
>> _______________________________________________
>> Swift-devel mailing list
>> Swift-devel at ci.uchicago.edu
>> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel
>>
>
>


-- 
Thanks and Regards,
Yadu Nand B
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-devel/attachments/20130302/07d36c32/attachment.html>


More information about the Swift-devel mailing list