Message4408

Author zyasoft
Recipients fwierzbicki, jsaiz, zyasoft
Date 2009-04-02.02:29:53
SpamBayes Score 3.287098e-08
Marked as misclassified No
Message-id <1238639397.61.0.895550530236.issue1288@psf.upfronthosting.co.za>
In-reply-to
Content
This NameError also occurs on java1.6.0_07 configuration with trunk on
OS 10.5

Jython 2.5b3+ (trunk:6136M, Apr 1 2009, 20:07:38) 
[Java HotSpot(TM) 64-Bit Server VM (Apple Inc.)] on java1.6.0_07

But not so when running on java 5 or soylatte on OS X 10.5

I think the likely reason is that the loops are using Java locals (what
we call temporary variables in the Jython compilation) that are
optimized away by a buggy version of the JVM, since fixed after
1.6.0_07. Let's remove the use of temp vars by trying this version,
where we explicitly assign the ranges to a name:

rmax = 300
X = range(10)
for i in X:
    Y = range(1)
    for j in Y:
        r=0 
        while(r<rmax):
            Z = range(r)
            for k in Z:
                continue
            r+=1
        print i,j

And that works on all versions.

Given that, I'm closing this as being a JVM bug until we have evidence
to the contrary.
History
Date User Action Args
2009-04-02 02:29:57zyasoftsetmessageid: <1238639397.61.0.895550530236.issue1288@psf.upfronthosting.co.za>
2009-04-02 02:29:57zyasoftsetrecipients: + zyasoft, fwierzbicki, jsaiz
2009-04-02 02:29:57zyasoftlinkissue1288 messages
2009-04-02 02:29:54zyasoftcreate