Subj : Re: memory error causing undefined value has no properties To : wyx From : Igor Bukanov Date : Fri Jan 24 2003 01:39 pm To determine if it is a Rhino or JVM bug , could you try to run you scripts with Rhino 1.5R2, 1.5R3 and a release candidate for 1.5R4? Regards, Igor wyx wrote: > hello all, > I use rhino and written a js to calculate some statistic. > In my js file, I used array of javascript object > and also a few array of string and integer. > > So I have a lof of "for/loop" as I need to iterate the values. > > originally, I use "for(var in..)" for each array. > On SunBlade 100 with jdk 1.3.1_04-b02, the js program works fine > and no error. > > however, after I deployed my js to E280 with jdk 1.3.1-b24, it will > some time show the "undefined value has no properties" error. > But this error seems showing randomly, becuase I apply the same set of data, > sometime it will show the error, sometime it will not. > > And lastly, I added some system.out.println in the js file. > and I found that in the "for(var in...)" loop, sometime it will skip > some index and then error thrown. > eg. > idx=151, print something > idx=153, print something > > then error thrown. idx=152 was skipped. > > Then after a pain investigation, I replace all the > "for(var in...)" loop by "for(var x=0; x then the "undefined value..." error never show up. > > I use interpret mode (optimization=-1). > > But so bad is that, there is some memory reference error. > I don't know why sometime, some interger value will be refered > with some garbage. eg. 4.: > So I added the follow line to check it. > > if( parseInt(itemTCount[tt].tCount) != itemTCount[tt].tCount) > java.lang.System.out.println("Error item:["+itemTCount[tt].tCount +"]"); > > What I expect is some string print out. > But so strange that it print something like > Error item:[130] > > so....if the value is 130, then how can it be printed out? > > so..I think there maybe some memory reference error for rhino when > it need to do complicated calculation or has many objects in the scope. > > hope some can help! > > yung .